Hello,
I need to have an action if both my and my wife not at home.
I use nmap to know if a person is at home, but the wifi of cell phone is off often.
So the rule is:
if both person are not at home during one hour, take the action.
I think I can have the time as a condtion, nice for even ‘after’ or befor, but not ‘for’:
condition:
condition: and
conditions:
- condition: state
entity_id: 'person.vorms'
state: 'not_home'
- condition: state
entity_id: 'person.caron'
state: 'home'
- condition: time
for: 01:00:00
Is that a mean to write it ?
many thanks for your help.
Best regards
depending on your wishes, you’d better create a group with both entities, and use the state changing of the group (if you want the being away from home for your wife and you to be together, as you describe)
personally, Id create a binary_sensor, with a delay_off value and use the binary_sensor’s state as the trigger for the automation.
or,
you could have a condition in the automation like this:
I’ve never used it like that as far as I know and the docs don’t say you can use ‘for:’ in a condition that I saw. However, I just wrote a test automation to test it and it seemed to have worked. May need further testing tho.