using
template:
- trigger:
- platform: event
event_type: hue_event
event_data:
id: auditorium_tap_switch_button
sensor:
- name: Hue tap switch last event
state: >
{{trigger.event.data.subtype}}
I get a nice sensor showing the button pressed, because subtype holds that info . Next I can trigger upon state change of that sensor (which I find way easier than creating a device_trigger automation in the UI tbh…
:
{
"event_type": "hue_event",
"data": {
"id": "auditorium_tap_switch_button",
"device_id": "6854508929ede1f8f5e14273b9925bf9",
"unique_id": "38185770-7c55-4c41-9d31-64a57a8d8dc4",
"type": "initial_press",
"subtype": 3
},
"origin": "LOCAL",
"time_fired": "2021-12-06T18:55:51.226364+00:00",
"context": {
"id": "dc36b6a7c32518e1d1fad8937d29a8e1",
"parent_id": null,
"user_id": null
}
}
Event 3 fired 19:55:
{
"event_type": "hue_event",
"data": {
"id": "auditorium_tap_switch_button",
"device_id": "6854508929ede1f8f5e14273b9925bf9",
"unique_id": "2e26537a-f3ae-4e81-8c08-e52c30c407fe",
"type": "initial_press",
"subtype": 4
},
"origin": "LOCAL",
"time_fired": "2021-12-06T18:55:50.025285+00:00",
"context": {
"id": "e4ef91ec98b4742344baff4ac153f239",
"parent_id": null,
"user_id": null
}
}
however, it wont change state upon clicking the same button multiple times.
How can I add the time_fired to the trigger, so it re-eveluates upon clicking the same button?
Is not as simple as adding:
template:
- trigger:
- platform: event
event_type: hue_event
event_data:
id: auditorium_tap_switch_button
sensor:
- name: Hue tap switch last event
state: >
{{trigger.event.data.subtype}}
attributes:
last_triggered: >
{{trigger.event.time_fired}}
creating the last_triggered:
triggering so I guess it is
thanks for having a look