Is it possible to compare time ?
I have MQTT time update:
- platform: mqtt state_topic: "owsensors" name: "mqtt_owsensors_update" value_template: '{{ now().strftime("%X") }}'
and I want to configure automation, to set all to STATE_UNKNOWN after expiry time, something like this:
automation:
- alias: mqtt_expire
trigger:
platform: template
value_template: “{% if is_state(‘sensor.mqtt_owsensors_update’ < now().strftime(”%X") - 30) %}true{% endif %}"
condition: state
entity_id: sensor.mqtt_temperature
state: STATE_UNKNOWN
How to set STATE_UNKNOWN for all sensors in one group ?