I have a house full of tradfri lights which I want to come on when the sun sets but only if either I’m home or my partner is home. At the moment, I have an automation which is working if we are both home…but that’s the problem, it requires we are both home. So I need to use a condition as an OR instead of AND but I keep getting configuration file errors. Here is my YAML:
- id: '1554383174732'
alias: Sunset
trigger:
- event: sunset
platform: sun
condition:
condition: or
conditions:
- condition: state
entity_id: 'person.jess'
state: 'home'
- condition: state
entity_id: 'person.kieran'
state: 'home'
# condition:
# - condition: state
# entity_id: person.jessica
# state: home
# - condition: state
# entity_id: person.kieran
# state: home
But now I get the following when validating the config file:
Error loading /config/configuration.yaml: while parsing a block collection in "/config/automations.yaml", line 1, column 1 expected <block end>, but found '?' in "/config/automations.yaml", line 16, column 1
I’m really not sure where I’m going wrong. You can see my original AND condition has been commented out.
Thanks Pippyn, that appears to have worked! I didn’t realise indentation was so important so will read up on it.
My config file is checking out okay now!
Just need to wait a few hours now
Another issues I’m having (don’t want to put up a seperate post) is that I have a set of 4 kitchen lights which I have grouped in Hass.io as group.kitchen. I have set up the Alexa integration via Home Assistant Cloud but when I ask Alexa to “set the kitchen lights” to say 80%, she will reply saying “kitchen lights doesn’t support this”… any way around this?
For your Alexa problem, I dont have Alexa either, but I think the reason it is not working, is because you have grouped the lights, through the groups.yaml. You have to group the lights from the lights.yaml file. That means you have to do it like this: