30 minutes before sun.sun below horizon

Hello,

Maybe easy answer, but how can i set my automation that trigger the light on 30 minutes before sun below horizon? i use the enitity sun.sun

config is now?

condition: state
entity_id: sun.sun
state: below_horizon

what can i do to use this 30 minutes before below_horizon?

It is recommended to use the sun elevation attribuate as a trigger, rather than a time offset for this.
Simple reason is that, depending on the season, a time based offset might be too much or too little.

This is how I do it. I do 50 minutes beforehand, but that’s easily changed.

alias: 'Timed Lights: Hallway'
description: ''
trigger:
  - platform: sun
    event: sunset
    offset: '-00:50:00'
condition: []
action:
  - service: scene.turn_on
    target:
      entity_id:
        - scene.hallway_full_bright
    data:
      transition: 5
mode: single
1 Like