Automation not firing action

Hello.

I am under the impression the below should turn off the light if

  • on for 1 minute
  • after sundown
  • before sunrise

Unfortunately it does not.

If I remove the conditoin, light correctly turns off after 1 minute.

Can someone nudge me in the right direction please? I do not really know what to search for in the doc to help myself.

Any help towards the doc would be very much appreciated.

Best regards.

Marc.

alias: 5 min off sdb soir
description: ''
trigger:
  - platform: device
    type: turned_on
    device_id: 0ad3a272d71d65ed25cda230b6fef8d5
    entity_id: switch.lumiere_salle_de_bain
    domain: switch
    for:
      hours: 0
      minutes: 1
      seconds: 0
      milliseconds: 0
condition:
  - condition: sun
    before: sunrise
    after: sunset
action:
  - type: turn_off
    device_id: 0ad3a272d71d65ed25cda230b6fef8d5
    entity_id: switch.lumiere_salle_de_bain
    domain: switch
mode: single

condition:
  condition: or
  conditions:
    - condition: sun
      before: sunrise
    - condition: sun
      after: sunset

The issue was it can’t be both before sunrise AND after sunset at the same time. the events are referenced to midnight.

Wow!

Thank you. I switched my GUI in english to follow instructions by my english is not good. You are helping me understand 2 mistakes.

Thank you very much!

1 Like