Hello, is there a way to optimize this automation?
What I’m looking for is: when both devices are disconnected from the network/wifi an alert is generated (only when both are off for more than X time.
alias: PingPhonesTracker
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.192_168_68_50
- binary_sensor.192_168_68_59
to: "off"
for:
hours: 0
minutes: 5
seconds: 0
condition:
- condition: state
entity_id: binary_sensor.192_168_68_50
state: "off"
- condition: state
entity_id: binary_sensor.192_168_68_59
state: "off"
action:
- service: notify.mobile_app_iphonealejo
data:
message: "No phones connected, proceed to turn off all system"
mode: single