Hello together,
im struggeling now a long time and now i want to ask Community as a last try.
My Simple UseCase:
ESP-Home → Battery powered ESP controlling (Binary) Christmas-lights. For saving Energy the ESP goes to deepsleep then comes up set light on or off and go to deepsleep again.
My Work so far:
I made a small Hardware-setup with two mosfets to be able to toggle my lights on and off and keep state when input pin is floating. IT works perfectly fine, also in combination with the ESP-Home
The Problem:
when entering DeepSleep, the output pin is taken to Ground. I want it floating to have my hardware toggle keep the state. So always it shut my lights off. im googling and reading all the docs about output and deepsleep, but there is no hint how to let the pin simple flowing instead of pulling it to ground
My Code:
esp8266:
board: esp01_1m
esphome:
name: esphome_lamp
friendly_name: lamp control with deep sleep
# switch.turn_off: cool
on_boot:
priority: -100
then:
- delay: 10s
- logger.log: "Checking state"
- lambda: |-
if (id(lightOn).state) {
ESP_LOGD("main", "go on please");
id(gpio15).turn_on();
} else {
ESP_LOGD("main", "go off please");
id(gpio15).turn_off();
}
- delay: 5s
#- deep_sleep.enter: deep_sleep_1
deep_sleep:
run_duration: 1min
sleep_duration: 1min
id: deep_sleep_1
binary_sensor:
- platform: homeassistant
internal: True
id: "lightOn"
entity_id: "input_boolean.tt"
output:
- platform: gpio
pin: GPIO15
id: "gpio15"
btw the deep_sleep enter is just commented out for testing. It now just goes to deepsleep after 1 minute instead of directly after set wanted output. Later it should sleep for 15 minutes come up and directly go to sleep again
thanks a lot in advance