I am new to home assistant and managed to pair up my Philips Hue lights, but am struggling to get the automation working for them to come on 15 mins before sunset. I have tried various things, but cannot get it right. This is the code I have currently. The group of lights I want to come on are called light.kitchen when I look at the entity id in states.
automation 2:
alias: Turn on light when sun sets
initial_state: True
hide_entity: True
trigger:
platform: sun
event: sunset
offset: “-00:15:00”
condition:
condition: state
entity_id: group.all_devices
state: ‘home’
action:
service: homeassistant.turn_on
entity_id: light.kitchen
Thanks for the responses. I tried changing to light.turn_on but it made no difference. Images attached of what I have in the configuration.yaml file for the lights, the attribute and the other bit I have in my configuration file which put displayed the light groups I had set up in my hue app.
In my entities I don’t have anything called group.all_devices which made me think maybe that line is incorrect. But I have group.all_lights and group.all_automations . I have tried these and it didn’t work with those either
I tried following those steps, but keep getting an error saying the id I am entering for the lights is invalid. I assume its the long unique ID I use for each light in place of the [“1”, “2”, “3”] in the guide? I find the guides are a bit vague for the beginner.
Removing that has done the trick. Thanks very much for that. I did wonder about that section and think it could be a bit clearer in the guides for the beginner, but maybe that’s just me!
I guess that condition section is only needed if you are adding another condition for the lights coming on, as well as the sun setting? (i.e. being home at the time)