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: - binary_sensor:
- name: "Homematic is sending updates" - name: "Homematic is sending updates"
state: >- state: >-
{{ now() - as_timestamp(state_attr('sensor.office_voltage', 'last_changed'), 601) < 600 }} {{ (now() - states.sensor.office_voltage.last_changed).seconds < 600 }}
automation: automation:
- alias: "Homematic Reconnect" - alias: "Homematic Reconnect"
trigger: trigger:
platform: state platform: state
entity_id: binary_sensor.homematic_up entity_id: binary_sensor.homematic_is_sending_updates
to: "off" to: "off"
action: 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 service: homematic.reconnect
``` ```