mirror of
https://github.com/jdillenburg/esphome.git
synced 2026-01-08 22:40:39 -07:00
Screenshot added
This commit is contained in:
@@ -4,6 +4,8 @@ Welcome to my ESPhome configuration directory. This repository contains the ESP
|
|||||||
* [Garage Door Controller](http://...#garage-door-controller)
|
* [Garage Door Controller](http://...#garage-door-controller)
|
||||||
|
|
||||||
## <a name="garage-door-controller">Garage Door Controller</a>
|
## <a name="garage-door-controller">Garage Door Controller</a>
|
||||||
|

|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
* TFmini-S Sensor code to measure vehcile's distance from front of garage.
|
* TFmini-S Sensor code to measure vehcile's distance from front of garage.
|
||||||
* LED Strip to display green for pulling vehicle into garage, yellow to slow down, and red to stop.
|
* LED Strip to display green for pulling vehicle into garage, yellow to slow down, and red to stop.
|
||||||
|
|||||||
BIN
README_Assets/garage-door-controller-dashboard-example_small.png
Normal file
BIN
README_Assets/garage-door-controller-dashboard-example_small.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 80 KiB |
@@ -32,7 +32,7 @@ wifi:
|
|||||||
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
||||||
ap:
|
ap:
|
||||||
ssid: "Garage-Door-Controller"
|
ssid: "Garage-Door-Controller"
|
||||||
password: !secret garage_door_ap_password
|
password: "eXbhM8qXvoM3"
|
||||||
|
|
||||||
captive_portal:
|
captive_portal:
|
||||||
|
|
||||||
@@ -105,7 +105,7 @@ uart:
|
|||||||
after:
|
after:
|
||||||
delimiter: "\n"
|
delimiter: "\n"
|
||||||
sequence:
|
sequence:
|
||||||
- lambda: UARTDebug::log_string(direction, bytes);
|
- lambda: UARTDebug::log_string(direction, bytes);
|
||||||
|
|
||||||
#******************** Binary Sensor *********************
|
#******************** Binary Sensor *********************
|
||||||
binary_sensor:
|
binary_sensor:
|
||||||
@@ -180,6 +180,56 @@ sensor:
|
|||||||
float current_count = id(effect_counter);
|
float current_count = id(effect_counter);
|
||||||
id(effect_counter) = 0;
|
id(effect_counter) = 0;
|
||||||
return current_count/10.0;
|
return current_count/10.0;
|
||||||
|
#**************** TIMEOUT OF 30 SECONDS ************************
|
||||||
|
# See lights_off_when_still script for timeout value
|
||||||
|
- platform: template
|
||||||
|
name: "Vehicle average speed"
|
||||||
|
id: vehicle_average_speed
|
||||||
|
unit_of_measurement: "cm/s"
|
||||||
|
accuracy_decimals: 3
|
||||||
|
update_interval: 500ms
|
||||||
|
lambda: |-
|
||||||
|
static float previous_distance = 0;
|
||||||
|
static uint32_t last_update = 0;
|
||||||
|
float rate = 0;
|
||||||
|
|
||||||
|
if (last_update != 0) {
|
||||||
|
float time_delta = (millis() - last_update) / 1000.0;
|
||||||
|
float value_delta = id(distance_sensor_raw).state - previous_distance;
|
||||||
|
rate = value_delta / time_delta;
|
||||||
|
}
|
||||||
|
|
||||||
|
previous_distance = id(distance_sensor_raw).state;
|
||||||
|
last_update = millis();
|
||||||
|
|
||||||
|
return rate;
|
||||||
|
filters:
|
||||||
|
- sliding_window_moving_average:
|
||||||
|
window_size: 20 # average 10 seconds worth of speed
|
||||||
|
send_every: 1 # check average speed every 1/2 second
|
||||||
|
on_value:
|
||||||
|
then:
|
||||||
|
- if:
|
||||||
|
condition:
|
||||||
|
- lambda: 'return abs(id(vehicle_average_speed).state) < 1.0;' # 0.02 mph really slow!
|
||||||
|
then:
|
||||||
|
- if:
|
||||||
|
condition:
|
||||||
|
- and:
|
||||||
|
- light.is_on: led_strip
|
||||||
|
- not:
|
||||||
|
script.is_running: lights_off_when_still
|
||||||
|
then:
|
||||||
|
script.execute: lights_off_when_still
|
||||||
|
else:
|
||||||
|
- if:
|
||||||
|
condition:
|
||||||
|
- light.is_off: led_strip
|
||||||
|
then:
|
||||||
|
- script.stop: lights_off_when_still
|
||||||
|
- light.turn_on:
|
||||||
|
id: led_strip
|
||||||
|
effect: "Distance Effect"
|
||||||
|
|
||||||
#******************** Cover *********************
|
#******************** Cover *********************
|
||||||
cover:
|
cover:
|
||||||
@@ -196,7 +246,7 @@ cover:
|
|||||||
lambda: |-
|
lambda: |-
|
||||||
return id(closed_sensor).state ? COVER_OPEN : COVER_CLOSED;
|
return id(closed_sensor).state ? COVER_OPEN : COVER_CLOSED;
|
||||||
|
|
||||||
# LED Strip configuration
|
#********** LED Strip configuration **********
|
||||||
light:
|
light:
|
||||||
- platform: esp32_rmt_led_strip
|
- platform: esp32_rmt_led_strip
|
||||||
rmt_channel: 1
|
rmt_channel: 1
|
||||||
@@ -278,3 +328,13 @@ light:
|
|||||||
it.range(start_index, end_index) = color;
|
it.range(start_index, end_index) = color;
|
||||||
it.range(end_index, total_leds) = Color::BLACK;
|
it.range(end_index, total_leds) = Color::BLACK;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
script:
|
||||||
|
- id: lights_off_when_still
|
||||||
|
mode: restart
|
||||||
|
then:
|
||||||
|
- delay: 30s
|
||||||
|
- light.turn_off:
|
||||||
|
id: led_strip
|
||||||
|
transition_length:
|
||||||
|
seconds: 5
|
||||||
|
|||||||
Reference in New Issue
Block a user