#How to send reply notification in response to a mobile_app_notification_action?

1 messages · Page 1 of 1 (latest)

iron flume
#

Hi you all. :)
I have an automation which is triggered by a mobile_app_notification_action, so, a 'button' in a notification that I sent to multiple devices in another script. Now my automation handles the event that someone, on one of these devices, pressed the button. This works fine ofc, but I also want to send a little confirmation message, replacing the original notification.
The problem: I can't determine which device I want to send a confirmation message to. All I seem to have is a device_id or the trigger.context to work with, but I can't tie that to any notify.mobile_app_* service.
I tried

action: notify.send_message
target:
  device_id: dba5de5bf7f34593
# Error: Referenced devices dba5de5bf7f34593 are missing or not currently available
``` without success.
I used the `context.user_id` to figure out the person's name
```yaml
{{ (states.person|selectattr('attributes.user_id','eq',trigger.event.context.user_id)|first).attributes.friendly_name | title }}
``` and tried to do something similar with the notify service, but couldn't figure it out yet. Can someone help?
#

Here's the trigger data from the traces:

this:
  entity_id: automation.dishwasher_notify
  state: 'on'
  attributes:
    id: '1757934925000'
    last_triggered: '2025-10-08T12:30:28.213504+00:00'
    mode: parallel
    current: 0
    max: 10
    friendly_name: Dishwasher Notify
  last_changed: '2025-10-06T19:11:56.401866+00:00'
  last_reported: '2025-10-08T12:30:28.691121+00:00'
  last_updated: '2025-10-08T12:30:28.691121+00:00'
  context:
    id: 01K71WTBVKV3BT6F6GYBVAWZ8S
    parent_id: 01K71WTBTQ5WRGTHZXBED8SWJ8
    user_id: null
trigger:
  id: reaction_companion
  idx: '3'
  alias: reaction companion emptied
  platform: event
  event:
    event_type: mobile_app_notification_action
    data:
      when_relative: 'false'
      notification_icon: mdi:dishwasher
      sticky: 'true'
      tag: dishwasher_finished
      when: '1759926628'
      title: Dishwasher finished!
      webhook_id: ______________________________
      message: |-
        ran 54 minutes
        14:30:28
      action_1_title: Emptied
      chronometer: 'false'
      action_1_key: dishwasher_emptied
      server_id: '3'
      action: dishwasher_emptied
      device_id: dba5de5bf7f34593
    origin: REMOTE
    time_fired: '2025-10-08T22:42:51.251927+00:00'
    context:
      id: 01K72ZVNQKM3KTXK25F927NZ6S
      parent_id: null
      user_id: 9bcb10c41acc41ca838ba03b311100fd
  description: event 'mobile_app_notification_action'
modern geyser
iron flume
#

how does that help me send a confirmation to only that one person who clicked the button?

modern geyser
#
....
actions:
  - variables:
      person: |
        {{ (states.person
        |selectattr('attributes.user_id','eq',trigger.event.context.user_id)
        |first).attributes.friendly_name | title }}"
  - action: notify.{{person|slugify}}
    data:
      message: "{{person}}, thanks for doing the dishes.
iron flume
#

okay smart, as long as the service contains the persons name that works. but on my system they are called notify.mobile_app_ONE_A5000 and stuff like that. I could rename them, yes, but...

modern geyser
#

The Notify Group creates a new service...

iron flume
#

I dont want to send a confirmation to the whole group though. Or am I misunderstanding sth?

modern geyser
#

I think you're misunderstanding Notify Groups. They do not have to relay to multiple notifiers.

iron flume
#

I don't think I'm getting it. 😅 Should I make a 'group' for each person/device? Essentially making an alias for each?

modern geyser
#

Yes, that is what I was suggesting... at least for the people. It may seem a bit silly, but it does make it easier when you change phones if all your automations already point to the "alias"... you just swap what the alias points to.