I am trying to create a simple automation to turn off all the lights when all device trackers are “not_home”, but even if one device tracker is not_home the automation executes.
I would appreciate any help with this:
automation:
alias: Lights Off
trigger:
- platform: state
entity_id: group.all_devices
to: 'not_home'
action:
service: switch.turn_off
entity_id: group.all_switches
A cleaner way is to use the device_sunlight_trigger…
Putting these four lines in to your configuration.yaml will have the following effects:
All lights will switch off when nobody is home.
If it is dark and somebody comes home, the light (or group) defined in the light_group line will come on.
If somebody is home and it starts to get dark, the light (or group) defined in the light_group line will come on, slowly fading in as the sun goes down
only just discovered this, im trying to find info on the light_profiles. Are they also built in, and applicable out of the box, or do we have to create these ourselves?
Howdy @Mariusthvdb, it looks like from the light component page that there are four light profiles built into Home Assistant, but that you can add additional ones to light_profiles.csv . Follow the link mentioned in the light_profile parameter to see what the existing profiles look like (click on the raw version on github).