Agreed. It’s not an ‘issue’ but that is besides the point. I am merely trying to see if I can have an automation that will get around the default state if under normal circumstances it would be on.
This is the automation I am currently using:
- action:
- data:
brightness_pct: 75
effect: white
entity_id: light.lounge
service: light.turn_on
alias: Turn Lounge Light On after Sunset (if HA restarts)
condition:
- condition: state
entity_id: sun.sun
state: "below_horizon"
trigger:
- platform: homeassistant
event: start
I am sure that will work if Hass restarts after sunset. But I would like it to trigger if it is 1:50 before sunset or less.
I think you are onto something with this. I’ll investigate. You can do some maths in Templates.
Automations are active on start by default. The problem with setting an initial state for anything is that if your system is rebooted/restarted, then the last state of the objects will not be restored to the last known state, but will instead be set to your initial state. So if you had an action that turned off an automation, and you restarted HA, your automation would be re-enabled when it shouldn’t be.