There are other capabilities that are more useful for things like this. You could use either button
or scene_activation
, for example, both of which provide a timestamp attribute that your event can modify:
event_targets:
interactive_notification_responses:
name: "Handle notification responses"
capabilities:
- scene_activation
events:
- event:
event_type: mobile_app_notification_action
data:
action: "LAUNDRY_INSIDE"
response:
"scene_activation.scene_id":
expr: "event.data.action"
"scene_activation.since":
expr: "time()"
The entity value is not changing, because the value doesn't change, right? Or is the event not even triggered? (I don't see the entity flashing in the entities section, when I try to trigger the event)
That's right. Adding a check to see if since
changes will address this.
Can I add attribute metadata to the rule trigger to see if there was an update?
You could do that as well, but it's more complicated because right now, the metadata is only accessible in expressions, so you'd need to make a local variable in your rule to grab that metadata.