Hello. I get irregular notifications from sensor, only if something happens. Therefore I would like to start automation every time when sensor sends new value. That may be same value as few days ago, so in fact the sensor does not change state, it is just updated with same value. How can I do that please?
According to State trigger:
Fires when the state of any of given entities changes. If only
entity_id
is given, the trigger will fire for all state changes, even if only state attributes change. If only one offrom_state
orto_state
are given, the trigger will fire on any matching state change, but not if only attributes change.
So use a state trigger and do not fill in either to:
or from:
. This, of course, assumes the sensor updates somehow even if the state value doesn’t change (e.g., an attribute changes.)
Thanks I am testing it. In the meanwhile, I discovered I can create trigger on incoming mqtt event:
alias: Test telegram
description: ''
trigger:
- platform: mqtt
topic: mqpr03_210312/sensor/mqpr03pr2/state
condition: []
action:
- service: notify.jan_b
data:
message: Topic received
mode: single