Is there a way to include conditions
checks using the on_sunrise
or on_sunset
automations?
If there is, I can’t figure out the syntax. Currently, I have:
sun:
latitude: !secret latitude
longitude: !secret longitude
on_sunrise:
- elevation: -10°
then:
- fan.turn_on:
id: ${node_name}
but I want to include a check for a global variable I set elsewhere called use_morning_precharge
. Something like this:
- if:
condition:
and:
- lambda: return id(use_morning_precharge) == true;
Is there any way to gate the action by both the sun’s elevation value and the global variable?