Automations - Should they trigger when HA reboots if conditions are met?

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.

Thanks.

That was the point of the threads I linked for you. Those people are achieving exactly that, or at least trying to

Can you explain why? My understanding is that setting the initial state to on doesn’t set the lights to on but instead sets the automation as “active”

Without using initial state the automation wouldn’t function unless I opened up the HA dashboard and turned it on

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.