Easy automation - light

Dear all,

thanks first for your help.

I test some automations with my outside lights but the trigger is not working. The lights doensnt turn off/on with the automation.

My groups:

    licht_vorgarten:
    name: Licht_Vorgarten
    entities:
    - light.eingangstuer_links
    - light.eingangstur_rechts

    licht_terasse:
    name: Licht_Terasse
    entities:
    - light.lampe_links
    - light.lampe_rechts

and my automation:

- id: outdoor_light_at_night

alias: Outdoor lights at night
initial_state: ‘on’
trigger:
platform: sun
event: sunset
offset: “00:45:00”
action:
- service: homeassistant.turn_on
entity_id:
- group.licht_vorgarten

  • id: outdoor_light_off_midnight
    alias: ‘Turn off Light at Midnight’
    trigger:
    platform: time
    at: ‘20:00:00’
    action:
    service: homeassistant.turn_off
    entity_id:
    - group.licht_vorgarten

  • id: testlight
    alias: test
    trigger:
    platform: time
    at: ‘20:15:00’
    action:
    service: light.turn_off
    entity_id: light.lampe_rechts

The last automation is a test and the automation works if I click on trigger at the dashboard. Then the light goes off. But it doesnt turn off with the time … do you have any idea?

Enviroment:
Hassbian on PI3

Thanks.

Best regards

The entities in the groups are not indented correctly, add 2 spaces

Thanks for your answer.
One more question. In the examples I see sometimes:
service: homeassistant.turn_off
and
service: light.turn_off

What I have to use?

BR

alkru002

You can use whichever you like, light.turn_off/on is specifically for lights, switch.turn_off/on is for switches and homeassistant.turn_off/on can be used on scenes, scripts etc as well as lights and switches, so it depends on what you are trying to turn on/off.

I think you are correct to use homeassistant.turn_off/on as you are trying to turn_on/off a group :slight_smile:

1 Like

found my mistake… time zone was wrong :slight_smile:

Thanks for your help!!!

1 Like