diff --git a/bedroom_tkm1.yaml b/bedroom_tkm1.yaml index ef46304..4a8f270 100644 --- a/bedroom_tkm1.yaml +++ b/bedroom_tkm1.yaml @@ -1,100 +1,28 @@ +substitutions: + device_name: bedroom_tkm1 + device_ip: 192.168.87.36 + esphome: - name: bedroom_tkm1 + name: ${device_name} 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: +<<: !include standard_wifi.yaml 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 - +# <<: !include standard_mqtt_deepsleep.yaml deep_sleep: - run_duration: 20s - sleep_duration: 40s #24h - esp32_ext1_wakeup: - pins: - - 33 #yellow - - 34 #orange - - 35 #white - mode: ANY_HIGH + run_duration: 12s + sleep_duration: 5min #10s #24h id: deep_sleep_1 -globals: - - id: wake_up_reason - type: int - restore_value: no - initial_value: '0' +# Example configuration entry 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 + - platform: adc + pin: 34 + name: "Living Room Brightness" + update_interval: 5s + id: lr_bright01 + attenuation: 11db \ No newline at end of file diff --git a/chip_list_esp32.txt b/chip_list_esp32.txt index 88817ef..b42e9f1 100644 --- a/chip_list_esp32.txt +++ b/chip_list_esp32.txt @@ -1,9 +1,10 @@ Name in ESPHome IP assigned Board Chip ID Description -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 +DEFUNCT bigblue1 192.168.87.31 ESP32/esp-wrover-kit ESP32D0WDQ5 (revision 1) Battery shield, 18650 +DEFUNCT 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 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 bedroom_tkm_lily2 192.168.87.47 esp32dev ESP32 LilyGo T7 V1.3, with USB and battery bedroom_tkm_lily1 192.168.87.48 esp32dev ESP32 LilyGo T7 V1.5, with USB and battery +lr_bright_87_49 192.168.87.49 ESP32/wemos_d1_mini32 \ No newline at end of file diff --git a/lr_bright_87_49.yaml b/lr_bright_87_49.yaml new file mode 100644 index 0000000..02993de --- /dev/null +++ b/lr_bright_87_49.yaml @@ -0,0 +1,26 @@ +substitutions: + device_name: lr_bright_87_49 + device_ip: 192.168.87.49 + +esphome: + name: ${device_name} + platform: ESP32 + board: wemos_d1_mini32 + +<<: !include standard_wifi.yaml +# logger: +# level: INFO +# api: +ota: +<<: !include standard_mqtt_deepsleep.yaml +deep_sleep: + run_duration: 2s + sleep_duration: 9min #40s #24h + id: deep_sleep_1 +sensor: + - platform: adc + pin: 34 + name: "Living Room Brightness" + update_interval: 1s + id: lr_bright01 + attenuation: 11db \ No newline at end of file diff --git a/lr_bright_87_49/partitions.csv b/lr_bright_87_49/partitions.csv new file mode 100644 index 0000000..f846601 --- /dev/null +++ b/lr_bright_87_49/partitions.csv @@ -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 diff --git a/write_lr_bright b/write_lr_bright new file mode 100644 index 0000000..9bacc31 --- /dev/null +++ b/write_lr_bright @@ -0,0 +1 @@ +esphome lr_bright_87_49.yaml run --upload-port /dev/ttyS9