substitutions: devicename: roode8266 friendly_name: $devicename external_components: refresh: always source: type: git url: https://github.com/Lyr3x/Roode ref: master esphome: name: $devicename esp8266: board: d1_mini wifi: networks: - ssid: !secret ssid1 password: !secret ssid1_password use_address: $devicename fast_connect: True power_save_mode: none domain: .local captive_portal: api: password: !secret api_password reboot_timeout: 60min services: - service: recalibrate then: - lambda: "id(roode_platform)->recalibration();" ota: password: !secret ota_password web_server: port: 80 auth: username: admin password: !secret web_password # Enable logging logger: level: INFO i2c: sda: 4 scl: 5 # VL53L1X sensor configuration is separate from Roode people counting algorithm vl53l1x: calibration: # The ranging mode is different based on how long the distance is that the sensor need to measure. # The longer the distance, the more time the sensor needs to take a measurement. # Available options are: auto, shortest, short, medium, long, longer, longest ranging: auto roode: id: roode_platform # Smooth out measurements by using the minimum distance from this number of readings sampling: 2 # This controls the size of the Region of Interest the sensor should take readings in. roi: { height: 16, width: 6 } # The detection thresholds for determining whether a measurement should count as a person crossing. # A reading must be greater than the minimum and less than the maximum to count as a crossing. # These can be given as absolute distances or as percentages. # Percentages are based on the automatically determined idle or resting distance. detection_thresholds: # defaults for both zones. These also default to 0% & 85% as previously done. # min: 234mm # absolute distance max: 85% # percent based on idle distance # The people counting algorithm works by splitting the sensor's capability reading area into two zones. # This allows for detecting whether a crossing is an entry or exit based on which zones was crossed first. zones: invert: true button: - platform: restart name: $friendly_name Restart entity_category: config - platform: template name: $friendly_name Recalibrate on_press: - lambda: id(roode_platform)->recalibration(); entity_category: config number: - platform: roode people_counter: id: counter name: $friendly_name people counter binary_sensor: - platform: status name: $friendly_name API Status - platform: roode presence_sensor: name: $friendly_name presence sensor: - platform: roode id: roode_sensors distance_entry: name: $friendly_name distance zone 0 filters: - delta: 100 distance_exit: name: $friendly_name distance zone 1 filters: - delta: 100 max_threshold_entry: name: $friendly_name max zone 0 max_threshold_exit: name: $friendly_name max zone 1 min_threshold_entry: name: $friendly_name min zone 0 min_threshold_exit: name: $friendly_name min zone 1 roi_height_entry: name: $friendly_name ROI height zone 0 roi_width_entry: name: $friendly_name ROI width zone 0 roi_height_exit: name: $friendly_name ROI height zone 1 roi_width_exit: name: $friendly_name ROI width zone 1 sensor_status: name: Sensor Status - platform: wifi_signal name: $friendly_name RSSI update_interval: 60s - platform: uptime name: Uptime Sensor id: uptime_sensor update_interval: 60s internal: true on_raw_value: then: - text_sensor.template.publish: id: uptime_human state: !lambda |- int seconds = round(id(uptime_sensor).raw_state); int days = seconds / (24 * 3600); seconds = seconds % (24 * 3600); int hours = seconds / 3600; seconds = seconds % 3600; int minutes = seconds / 60; seconds = seconds % 60; return ( (days ? String(days) + "d " : "") + (hours ? String(hours) + "h " : "") + (minutes ? String(minutes) + "m " : "") + (String(seconds) + "s") ).c_str(); text_sensor: - platform: roode version: name: $friendly_name version - platform: roode entry_exit_event: name: $friendly_name last direction - platform: template name: $friendly_name Uptime Human Readable id: uptime_human icon: mdi:clock-start