I have the automations as in the code below.
I have added
for:
minutes: 5
because if the device was offline (read the ip scan lost the wifi-connected device) for just a very short time I get to many false notifications.
The offline notifications has decreased, but the online notifications keep the same and should not be triggered if “the device went up within 5 minutes”.
How can this be done?
automation:
- alias: ip_espble01_on
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.ip_espble01
to: 'on'
action:
- service: notify.telegram
data:
title: ESPBLE01
message: 'online'
- alias: ip_espble01_off
initial_state: true
trigger:
- platform: state
entity_id: binary_sensor.ip_espble01
to: 'off'
for:
minutes: 5
action:
- service: notify.telegram
data:
title: ESPBLE01
message: '5 minutes off'