From 4baeee7db4e8ba19a66401a69b9074579ace268f Mon Sep 17 00:00:00 2001 From: Tim Meneely Date: Thu, 11 Feb 2021 09:39:52 -0500 Subject: [PATCH] Adding battery voltage measurement --- bedroom_lilygo_t7v13.yaml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/bedroom_lilygo_t7v13.yaml b/bedroom_lilygo_t7v13.yaml index 7734e6f..1323c72 100644 --- a/bedroom_lilygo_t7v13.yaml +++ b/bedroom_lilygo_t7v13.yaml @@ -20,9 +20,9 @@ ota: <<: !include standard_mqtt_deepsleep.yaml deep_sleep: run_duration: 20s - sleep_duration: 40s #24h - esp32_ext1_wakeup: - pins: + sleep_duration: 240s #24h + esp32_ext1_wakeup: + pins: - 33 #middle button - 34 #T button - 35 #L button @@ -40,28 +40,35 @@ sensor: accuracy_decimals: 0 lambda: |- return id(wake_up_reason); + - platform: adc + pin: GPIO39 + attenuation: 11db + name: "Battery Voltage" + update_interval: 10s + filters: + - multiply: 0.83 #(3.24/3.90) binary_sensor: - platform: gpio - pin: + 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 + # - delayed_off: 10s ### <---- delay to capture state change on wake up name: "TKM Test 33 middle button" id: tkm_test_33 - platform: gpio - pin: + 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 + # - delayed_off: 10s ### <---- delay to capture state change on wake up name: "TKM Test 34 T button" id: tkm_test_34 - platform: gpio - pin: + pin: number: GPIO35 mode: INPUT_PULLUP filters: