Files
ESPHome/bedroom_lilygo_t7v15.yaml
2021-01-31 20:27:23 -05:00

65 lines
1.5 KiB
YAML

substitutions:
device_name: bedroom_tkm_lily1
device_ip: 192.168.87.44
esphome:
name: ${device_name}
platform: ESP32
board: esp32dev
on_boot:
- priority: 900 #900 tried down to 500
then:
- lambda: |-
id(wake_up_reason) = log(esp_sleep_get_ext1_wakeup_status())/log(2);
<<: !include standard_wifi.yaml
logger:
level: INFO
api:
ota:
<<: !include standard_mqtt_deepsleep.yaml
deep_sleep:
run_duration: 20s
sleep_duration: 40s #24h
esp32_ext1_wakeup:
pins:
- 33 #yellow
- 34 #orange
- 35 #green
mode: ANY_HIGH
id: deep_sleep_1
globals:
- id: wake_up_reason
type: int
restore_value: no
initial_value: '0'
sensor:
- platform: template
name: "Remote Control Wake Reason"
accuracy_decimals: 0
lambda: |-
return id(wake_up_reason);
binary_sensor:
- platform: gpio
pin:
number: GPIO33
mode: INPUT_PULLUP
# filters:
# - delayed_on: 10ms ### <---- debounce time, was 100ms
# - delayed_off: 10s ### <---- delay to capture state change on wake up
name: "TKM Test 33 (yellow)"
id: tkm_test_33
- platform: gpio
pin:
number: GPIO34
mode: INPUT_PULLUP
name: "TKM Test 34 (orange)"
id: tkm_test_34
- platform: gpio
pin:
number: GPIO35
mode: INPUT_PULLUP
name: "TKM Test 35 (green)"
id: tkm_test35