Light automation not working?

Hi,

from what i can see this is pretty simple automation which I think i’ve implemeted correctly however it never gets triggered?

  - alias: 'Night Lighting'
trigger:
  - platform: sun
    event: sunset
    offset: "-00:50:00"
  - platform: state
    entity_id: group.all_devices
    to: 'home'
condition:
  condition: and
  conditions:
    - condition: state
      entity_id: group.all_devcies
      state: 'home'
    - condition: sun
      after: sunset
      after_offset: "-00:50:00"
action:
    service: scene.turn_on
    entity_id: scene.nomal_night

There look to be typing errors in there, your second group.all_devices says group.all_devcies. Also, is your scene nomal_night?

1 Like

Also your conditions duplicate your triggers…

I use that in many automations, since the triggers are or statements. That automation will run the scene when everybody is home, and it’s later than 50 minutes before sunset, regardless of whether people are home at that time, or later.

1 Like

There is also a wrong indent below action (not sure if it matters here)
it should be

action:
  service: scene.turn_on
  entity_id: scene.nomal_night

and not

action:
    service: scene.turn_on
    entity_id: scene.nomal_night