I made an automation where my security camera automatic turn off when all persons leave the home. I have made it like this:
- id: '1717422963048'
alias: Camera On
description: ''
trigger:
- platform: state
entity_id:
- person.1
- person.2
from: home
to: not_home
condition:
- condition: state
entity_id:
- person.1
state: not_home
- condition: state
entity_id:
- person.2
state: not_home
action:
- service: camera.turn_on
data: {}
target:
device_id:
- Camera 1
- Camera 2
If I make if the other way around the problems is that we both need to be home before camera turn off. Can someone help with an “or” function so the camera will turn off when one of us arrive home.
And if it is possible I would also like to include the the camera always should be on from 10pm to 7 am if someone is home.