How to trigger on changes to "last_updated"?

I’m currently migrating from HomeSeer to Home Assistant. I have a Qubino Flush Dimmer and want to trigger automations when the button connected to I2 is pressed. The button is mono-stable why the time the circuit is closed is very short.

The press is registred but the value isn’t changing (from 0 to 0) why I need to trigger on something else. I’m thinking that “last_updated” could be used. I guess I need to use a template but I don’t know where to start. Any help would be much appreciated as this is a feature I’m using frequently.

{
“event_type”: “state_changed”,
“data”: {
“entity_id”: “sensor.multilevel_power_switch_instance_2_home_security”,
“old_state”: {
“entity_id”: “sensor.multilevel_power_switch_instance_2_home_security”,
“state”: “0”,
“attributes”: {
“node_id”: 21,
“label”: “Clear”,
“friendly_name”: “Qubino Flush Dimmer: Instance 2: Home Security”
},
“last_changed”: “2020-09-26T16:24:19.617440+00:00”,
“last_updated”: “2020-09-26T16:24:19.617440+00:00”,
“context”: {
“id”: “baacf081001411eba46151cd9554435a”,
“parent_id”: null,
“user_id”: null
}
},
“new_state”: {
“entity_id”: “sensor.multilevel_power_switch_instance_2_home_security”,
“state”: “0”,
“attributes”: {
“node_id”: 21,
“label”: “Clear”,
“friendly_name”: “Qubino Flush Dimmer: Instance 2: Home Security”
},
“last_changed”: “2020-09-26T20:26:32.116387+00:00”,
“last_updated”: “2020-09-26T20:26:32.116387+00:00”,
“context”: {
“id”: “90b84b36003611eb8708af594a04c77f”,
“parent_id”: null,
“user_id”: null
}
}
},
“origin”: “LOCAL”,
“time_fired”: “2020-09-26T20:26:32.116434+00:00”,
“context”: {
“id”: “90b84b36003611eb8708af594a04c77f”,
“parent_id”: null,
“user_id”: null
}
}

A simple state trigger is all you need. Without a from or to it’ll trigger on any state or attribute change, which would include last_updated. You could add a template condition if you wanted to narrow down the changes.

3 Likes

So simple, thank you! I’ve been down that road before, but then I used a different entity why I didn’t get it to work at that point. Now I get the automation to trigger, but it takes a good 4-5 sec which isn’t optimal when it comes to controlling lighting.

In the event list in the OpenZwave addon I see an instant registration of the button push but this doesn’t seem to be sent into HA.