corrections in reconnecting automation (#20884)

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
elschnert 2021-12-29 19:35:39 +01:00 committed by GitHub
parent 29d3149dd1
commit a8746d1ee4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -485,16 +485,16 @@ template:
- binary_sensor:
- name: "Homematic is sending updates"
state: >-
{{ now() - as_timestamp(state_attr('sensor.office_voltage', 'last_changed'), 601) < 600 }}
{{ (now() - states.sensor.office_voltage.last_changed).seconds < 600 }}
automation:
- alias: "Homematic Reconnect"
trigger:
platform: state
entity_id: binary_sensor.homematic_up
entity_id: binary_sensor.homematic_is_sending_updates
to: "off"
action:
# Reconnect, if sensor has not been updated for over 3 hours
# Reconnect, if sensor has not been updated for over 10 minutes
service: homematic.reconnect
```