Upon sunset I’d like to put a device into deep sleep and have it wake up at sunrise. It appears the way to do this is to use ‘deep_sleep.enter’ with ‘sleep_duration:’ set to the time to sunrise. How do you calculate time to sunrise? Will this work?
The other option seems to fit your use case better
on_...:
then:
- deep_sleep.enter:
id: deep_sleep_1
until: !lambda 'return id(sun_next_rising)'
time_id: sntp_id ## id of which ever time component you are using not the sunrise sensor
You should use the next sunrise sensor from HA rather than the full sun component. You will also need to have the deep sleep key without anything else in your config