Added a new bedroom button box.
This commit is contained in:
70
bedroom_lilygo_t7v13.yaml
Normal file
70
bedroom_lilygo_t7v13.yaml
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
substitutions:
|
||||||
|
device_name: bedroom_tkm_lily2
|
||||||
|
device_ip: 192.168.87.47
|
||||||
|
|
||||||
|
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 #middle button
|
||||||
|
- 34 #T button
|
||||||
|
- 35 #L button
|
||||||
|
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: 100ms ### <---- debounce time, was 100ms
|
||||||
|
# - delayed_off: 10s ### <---- delay to capture state change on wake up
|
||||||
|
name: "TKM Test 33 middle button"
|
||||||
|
id: tkm_test_33
|
||||||
|
- platform: gpio
|
||||||
|
pin:
|
||||||
|
number: GPIO34
|
||||||
|
mode: INPUT_PULLUP
|
||||||
|
filters:
|
||||||
|
- delayed_on: 100ms ### <---- debounce time, was 100ms
|
||||||
|
# - delayed_off: 10s ### <---- delay to capture state change on wake up
|
||||||
|
name: "TKM Test 34 T button"
|
||||||
|
id: tkm_test_34
|
||||||
|
- platform: gpio
|
||||||
|
pin:
|
||||||
|
number: GPIO35
|
||||||
|
mode: INPUT_PULLUP
|
||||||
|
filters:
|
||||||
|
- delayed_on: 100ms ### <---- debounce time, was 100ms
|
||||||
|
name: "TKM Test 35 L button"
|
||||||
|
id: tkm_test35
|
||||||
@@ -3,62 +3,36 @@ esphome:
|
|||||||
platform: ESP32
|
platform: ESP32
|
||||||
board: wemos_d1_mini32 #esp-wrover-kit
|
board: wemos_d1_mini32 #esp-wrover-kit
|
||||||
on_boot:
|
on_boot:
|
||||||
- priority: -100 #900 tried down to 500
|
|
||||||
then:
|
|
||||||
- lambda: |-
|
|
||||||
id(wake_up_reason1) = esp_sleep_get_ext1_wakeup_status();
|
|
||||||
- priority: 900 #900 tried down to 500
|
- priority: 900 #900 tried down to 500
|
||||||
then:
|
then:
|
||||||
- lambda: |-
|
- lambda: |-
|
||||||
id(wake_up_reason) = esp_sleep_get_ext1_wakeup_status();
|
id(wake_up_reason) = esp_sleep_get_ext1_wakeup_status();
|
||||||
|
|
||||||
|
# - priority: 901 #900 tried down to 500
|
||||||
#esp_default_wake_deep_sleep();
|
# then:
|
||||||
#id(wake_up_reason) = log(esp_sleep_get_ext1_wakeup_status())/log(2);
|
# - lambda: |-
|
||||||
|
# esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);
|
||||||
# - priority: 300.0 # after sensor setup, before WIFI initialization
|
# gpio_pullup_dis(GPIO_NUM_33);
|
||||||
# then:
|
# gpio_pulldown_en(GPIO_NUM_33);
|
||||||
# - light.turn_on:
|
# gpio_pullup_dis(GPIO_NUM_34);
|
||||||
# id: emergency_light
|
# gpio_pulldown_en(GPIO_NUM_34);
|
||||||
# brightness: 100%
|
# gpio_pullup_dis(GPIO_NUM_35);
|
||||||
# red: 100%
|
# gpio_pulldown_en(GPIO_NUM_35);
|
||||||
# green: 0%
|
|
||||||
# blue: 0%
|
|
||||||
# - priority: 225.0 # after WIFI initialization
|
|
||||||
# then:
|
|
||||||
# - light.turn_on:
|
|
||||||
# id: emergency_light
|
|
||||||
# brightness: 100%
|
|
||||||
# red: 0%
|
|
||||||
# green: 0%
|
|
||||||
# blue: 100%
|
|
||||||
|
|
||||||
wifi:
|
wifi:
|
||||||
ssid: "Meneely"
|
ssid: "Meneely"
|
||||||
password: "punxsutawney1"
|
password: "punxsutawney1"
|
||||||
|
|
||||||
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
|
||||||
# ap:
|
|
||||||
# ssid: "BigBlue1 Fallback Hotspot"
|
|
||||||
# password: "QNWj7LmaNoD6"
|
|
||||||
manual_ip:
|
manual_ip:
|
||||||
# Set this to the IP of the ESP
|
|
||||||
static_ip: 192.168.87.36
|
static_ip: 192.168.87.36
|
||||||
# Set this to the IP address of the router. Often ends with .1
|
|
||||||
gateway: 192.168.86.1
|
gateway: 192.168.86.1
|
||||||
# The subnet of the network. 255.255.255.0 works for most home networks.
|
|
||||||
subnet: 255.255.254.0
|
subnet: 255.255.254.0
|
||||||
fast_connect: True
|
fast_connect: True
|
||||||
|
|
||||||
# captive_portal:
|
# captive_portal:
|
||||||
|
|
||||||
# Enable logging
|
|
||||||
logger:
|
logger:
|
||||||
level: INFO
|
level: INFO
|
||||||
|
|
||||||
# Enable Home Assistant API
|
|
||||||
api:
|
api:
|
||||||
|
|
||||||
ota:
|
ota:
|
||||||
|
|
||||||
mqtt:
|
mqtt:
|
||||||
@@ -84,9 +58,9 @@ deep_sleep:
|
|||||||
sleep_duration: 40s #24h
|
sleep_duration: 40s #24h
|
||||||
esp32_ext1_wakeup:
|
esp32_ext1_wakeup:
|
||||||
pins:
|
pins:
|
||||||
- 4 #yellow
|
- 33 #yellow
|
||||||
- 12 #orange
|
- 34 #orange
|
||||||
- 32 #green
|
- 35 #white
|
||||||
mode: ANY_HIGH
|
mode: ANY_HIGH
|
||||||
id: deep_sleep_1
|
id: deep_sleep_1
|
||||||
|
|
||||||
@@ -95,50 +69,32 @@ globals:
|
|||||||
type: int
|
type: int
|
||||||
restore_value: no
|
restore_value: no
|
||||||
initial_value: '0'
|
initial_value: '0'
|
||||||
- id: wake_up_reason1
|
|
||||||
type: int
|
|
||||||
restore_value: no
|
|
||||||
initial_value: '0'
|
|
||||||
sensor:
|
sensor:
|
||||||
- platform: template
|
- platform: template
|
||||||
name: "Remote Control Wake Reason"
|
name: "Remote Control Wake Reason"
|
||||||
accuracy_decimals: 0
|
accuracy_decimals: 0
|
||||||
lambda: |-
|
lambda: |-
|
||||||
return id(wake_up_reason);
|
return id(wake_up_reason);
|
||||||
- platform: template
|
|
||||||
name: "Remote Control Wake Reason1"
|
|
||||||
accuracy_decimals: 0
|
|
||||||
lambda: |-
|
|
||||||
return id(wake_up_reason1);
|
|
||||||
# on_value:
|
|
||||||
# then:
|
|
||||||
# - if:
|
|
||||||
# condition:
|
|
||||||
# lambda: 'return id(wake_up_reason) == 4;'
|
|
||||||
# then:
|
|
||||||
# - logger.log: "4, yellow wire touched"
|
|
||||||
# else:
|
|
||||||
# - logger.log: "Non-yellow wire touched"
|
|
||||||
|
|
||||||
binary_sensor:
|
binary_sensor:
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
pin:
|
pin:
|
||||||
number: GPIO4
|
number: GPIO33
|
||||||
mode: INPUT_PULLUP
|
mode: INPUT_PULLUP
|
||||||
# filters:
|
# filters:
|
||||||
# - delayed_on: 10ms ### <---- debounce time, was 100ms
|
# - delayed_on: 10ms ### <---- debounce time, was 100ms
|
||||||
# - delayed_off: 10s ### <---- delay to capture state change on wake up
|
# - delayed_off: 10s ### <---- delay to capture state change on wake up
|
||||||
name: "TKM Test 4 (yellow)"
|
name: "TKM Test 33 (yellow)"
|
||||||
id: tkm_test_4
|
id: tkm_test_33
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
pin:
|
pin:
|
||||||
number: GPIO12
|
number: GPIO34
|
||||||
mode: INPUT_PULLUP
|
mode: INPUT_PULLUP
|
||||||
name: "TKM Test 12 (orange)"
|
name: "TKM Test 34 (orange)"
|
||||||
id: tkm_test_12
|
id: tkm_test_34
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
pin:
|
pin:
|
||||||
number: GPIO32
|
number: GPIO35
|
||||||
mode: INPUT_PULLUP
|
mode: INPUT_PULLUP
|
||||||
name: "TKM Test 32 (green)"
|
name: "TKM Test 35 (white)"
|
||||||
id: tkm_test32
|
id: tkm_test_35
|
||||||
|
|||||||
100
bedroom_tkm2.yaml
Normal file
100
bedroom_tkm2.yaml
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
esphome:
|
||||||
|
name: bedroom_tkm1
|
||||||
|
platform: ESP32
|
||||||
|
board: wemos_d1_mini32 #esp-wrover-kit
|
||||||
|
on_boot:
|
||||||
|
- priority: 900 #900 tried down to 500
|
||||||
|
then:
|
||||||
|
- lambda: |-
|
||||||
|
id(wake_up_reason) = esp_sleep_get_ext1_wakeup_status();
|
||||||
|
|
||||||
|
# - priority: 901 #900 tried down to 500
|
||||||
|
# then:
|
||||||
|
# - lambda: |-
|
||||||
|
# esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);
|
||||||
|
# gpio_pullup_dis(GPIO_NUM_33);
|
||||||
|
# gpio_pulldown_en(GPIO_NUM_33);
|
||||||
|
# gpio_pullup_dis(GPIO_NUM_34);
|
||||||
|
# gpio_pulldown_en(GPIO_NUM_34);
|
||||||
|
# gpio_pullup_dis(GPIO_NUM_35);
|
||||||
|
# gpio_pulldown_en(GPIO_NUM_35);
|
||||||
|
|
||||||
|
wifi:
|
||||||
|
ssid: "Meneely"
|
||||||
|
password: "punxsutawney1"
|
||||||
|
manual_ip:
|
||||||
|
static_ip: 192.168.87.36
|
||||||
|
gateway: 192.168.86.1
|
||||||
|
subnet: 255.255.254.0
|
||||||
|
fast_connect: True
|
||||||
|
|
||||||
|
# captive_portal:
|
||||||
|
|
||||||
|
logger:
|
||||||
|
level: INFO
|
||||||
|
api:
|
||||||
|
ota:
|
||||||
|
|
||||||
|
mqtt:
|
||||||
|
broker: 192.168.86.99
|
||||||
|
discovery: True
|
||||||
|
username: ha
|
||||||
|
password: lorrie
|
||||||
|
# keepalive: 2s
|
||||||
|
birth_message:
|
||||||
|
topic: bedroom_tkm1/status
|
||||||
|
payload: coming_online_birth
|
||||||
|
will_message:
|
||||||
|
topic: bedroom_tkm1/status
|
||||||
|
payload: going_offline_will
|
||||||
|
on_message:
|
||||||
|
topic: bedroom_tkm1/ota_mode
|
||||||
|
payload: 'ON'
|
||||||
|
then:
|
||||||
|
- deep_sleep.prevent: deep_sleep_1
|
||||||
|
|
||||||
|
deep_sleep:
|
||||||
|
run_duration: 20s
|
||||||
|
sleep_duration: 40s #24h
|
||||||
|
esp32_ext1_wakeup:
|
||||||
|
pins:
|
||||||
|
- 33 #yellow
|
||||||
|
- 34 #orange
|
||||||
|
- 35 #white
|
||||||
|
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 (white)"
|
||||||
|
id: tkm_test_35
|
||||||
6
bedroom_tkm_lily2/partitions.csv
Normal file
6
bedroom_tkm_lily2/partitions.csv
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
nvs, data, nvs, 0x009000, 0x005000,
|
||||||
|
otadata, data, ota, 0x00e000, 0x002000,
|
||||||
|
app0, app, ota_0, 0x010000, 0x1C0000,
|
||||||
|
app1, app, ota_1, 0x1D0000, 0x1C0000,
|
||||||
|
eeprom, data, 0x99, 0x390000, 0x001000,
|
||||||
|
spiffs, data, spiffs, 0x391000, 0x00F000
|
||||||
|
@@ -2,6 +2,7 @@ Name in ESPHome IP assigned Board Chip ID
|
|||||||
bigblue1 192.168.87.31 ESP32/esp-wrover-kit ESP32D0WDQ5 (revision 1) Battery shield, 18650
|
bigblue1 192.168.87.31 ESP32/esp-wrover-kit ESP32D0WDQ5 (revision 1) Battery shield, 18650
|
||||||
bedroom_tkm1 192.168.87.36 ESP32/wemos_d1_mini32 ESP32D0WDQ6 (revision 1) D1 mini, 4xAmazon 2021-01-20. Doesn't give pin ID used to wake from deep sleep
|
bedroom_tkm1 192.168.87.36 ESP32/wemos_d1_mini32 ESP32D0WDQ6 (revision 1) D1 mini, 4xAmazon 2021-01-20. Doesn't give pin ID used to wake from deep sleep
|
||||||
esp32_cam1 192.168.87.17 ESP32/esp32cam ESP32-CAM, 2xAmazon 2020-12-17
|
esp32_cam1 192.168.87.17 ESP32/esp32cam ESP32-CAM, 2xAmazon 2020-12-17
|
||||||
bedroom_tkm_lily1 192.168.87.44 ESP32 LilyGo T7 V1.5, with USB and battery
|
|
||||||
sonoffmini_1 192.168.87.41 ESP8266/esp01_1m Sonoff Mini - Now on Tim's nightstand
|
sonoffmini_1 192.168.87.41 ESP8266/esp01_1m Sonoff Mini - Now on Tim's nightstand
|
||||||
|
bedroom_tkm_lily1 192.168.87.44 esp32dev ESP32 LilyGo T7 V1.5, with USB and battery
|
||||||
sonoffmini_45 192.168.87.45 ESP8266/esp01_1m Sonoff Mini - Now on Lorrie's nightstand
|
sonoffmini_45 192.168.87.45 ESP8266/esp01_1m Sonoff Mini - Now on Lorrie's nightstand
|
||||||
|
bedroom_tkm_lily2 192.168.87.47 esp32dev ESP32 LilyGo T7 V1.3, with USB and battery
|
||||||
|
|||||||
Reference in New Issue
Block a user