Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- substitutions:
- name: main-stair-bottom
- friendly_name: Main Stair Bottom
- project_name: "vdbxio.FLIP-C3-alt"
- project_version: "0.9.6"
- ap_password: "GenericPassword"
- status_pin: "10"
- onboard_rgb_pin: "8"
- rgb_pin: "7"
- package_git: "github://vdbxio/wiki/esphome/flip-c3-alt.yaml"
- dashboard_import:
- package_import_url: ${package_git}
- esphome:
- name: ${name}
- name_add_mac_suffix: false
- friendly_name: ${friendly_name}
- project:
- name: "${project_name}"
- version: "${project_version}"
- wifi:
- ssid: !secret wifi_ssid
- password: !secret wifi_password
- ap:
- password: ${ap_password}
- esp32:
- board: esp32-c3-devkitm-1
- framework:
- type: arduino
- version: latest
- i2c:
- sda: 1
- scl: 0
- scan: True
- id: bus_a
- frequency: 100k
- logger:
- api:
- ota:
- time:
- - platform: homeassistant
- button:
- - platform: restart
- name: ${friendly_name} Restart
- - platform: factory_reset
- name: Restart with Factory Default Settings
- disabled_by_default: True
- captive_portal:
- web_server:
- local: True
- sensor:
- - platform: wifi_signal # Reports the WiFi signal strength/RSSI in dB
- name: "WiFi Signal dB"
- id: wifi_signal_db
- update_interval: 30s
- entity_category: "diagnostic"
- - platform: copy # Reports the WiFi signal strength in %
- source_id: wifi_signal_db
- name: "WiFi Signal Percent"
- filters:
- - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0);
- unit_of_measurement: "%"
- entity_category: "diagnostic"
- - platform: internal_temperature
- name: "ESP32-C3 Temperature"
- - platform: vl53l0x
- #name: "Breakbeam Sensor Dist"
- id: breakbeam_sensor_dist
- address: 0x29
- update_interval: 0.1s
- long_range: true
- internal: true
- #
- # Only send a value back if breakbeam_sensor changes.
- #
- filters:
- - lambda: !lambda |-
- /**
- * YOU MIGHT WANT TO CONFIGURE THIS.
- * Distance below which to trip the virtual break beam sensor.
- * '0.5' meters is about 20 inches.
- */
- static double minTripDistance = 1.1;
- if (x <= minTripDistance) {
- if (id(breakbeam_sensor).state == true) {
- // Beam was already broken
- return {};
- }
- // Beam was just broken
- id(breakbeam_sensor).publish_state(true);
- ESP_LOGI("breakbeam_sensor_dist", "Set breakbeam_sensor to Detected");
- return {};
- }
- else {
- if (id(breakbeam_sensor).state == false) {
- // Beam was already un-broken
- return {};
- }
- // Beam was just un-broken
- id(breakbeam_sensor).publish_state(false);
- ESP_LOGI("breakbeam_sensor_dist", "Set breakbeam_sensor to Cleared");
- return {};
- }
- # - platform: adc
- # pin: 2
- # name: "ADC Pin 2"
- # accuracy_decimals: 5
- # update_interval: 1s
- # attenuation: auto
- # filters:
- # - multiply: 2.0
- # - platform: adc
- # pin: 3
- # name: "ADC Pin 3"
- # accuracy_decimals: 5
- # update_interval: 1s
- # attenuation: auto
- # filters:
- # - multiply: 2.0
- ##
- ## The virutal break beam sensor.
- ## The state of this will be controlled
- ## by breakbeam_sensor_dist's lambda as necessary.
- ##
- binary_sensor:
- - name: "Breakbeam Sensor"
- id: breakbeam_sensor
- platform: template
- device_class: motion
- wled:
- light:
- - platform: status_led
- name: "Status LED"
- id: stats_led
- pin: ${status_pin}
Advertisement
Add Comment
Please, Sign In to add comment