Hi all. I have an automation that I am using that is exhibiting some strange behavior, but only when both parties enter/leave the residence at the same time.
I WANT it to function like this:
If person “x” is away and comes home when the sun is down, the light is turned on and then turned off after the predetermined time. This works perfectly when one person in the automation comes home, however when both return home the light turns on briefly then immediately turns off. What am I missing here? See code below.
Edit, I don’t think I did the code block formatting correctly sorry for that.*
`# FLOOD LIGHTS ARRIVAL #
alias: Porch Light Arrival
trigger:
platform: state
entity_id: binary_sensor.matt_home
from: ‘off’
to: ‘on’
platform: state
entity_id: binary_sensor.brittany_home
from: ‘off’
to: ‘on’
condition:
condition: state
entity_id: sun.sun
state: ‘below_horizon’
action:
trigger:
platform: state
entity_id:
- binary_sensor.matt_home
- binary_sensor.brittany_home
from: ‘off’
to: ‘on’
etc...
Also in future please select your code and press the </> button in the message toolbar or follow the instructions in the blue banner at the top of the page to format your code correctly. Indentation is important in YAML.
Well, I didn’t say it couldn’t. I suggested this based on what others have said. I have many automations with multiple triggers and I’m not aware of any having issues like this. But that could just be because I haven’t noticed (yet.) It could also be that I tend to put long action sequences, especially ones with delays or waits, into scripts rather than putting the actions directly into the automations anyway.