Android notification to trigger shell_command

I defined a script that uses a shell_command (curl hiting a URL) to open the garage door. Now I want to trigger this with a Samsung Smart tag.

For this I defined a notification that is sent to my phone when the Smart tag button is pressed. Also defined an automation (inside “automations.yaml” file) with last_notification that is supposed to catch this notification and launch the action. But this is not working. :frowning:

If I launch the automation manually (with “Run” in the web interface) the garage door opens. But when I push the Smart tag button the notification is received by the phone (text: “Sesame pressed”) but the garage door does not open.

“Last notification” sensor is enabled and “Disable allow list” is also enabled. I gave Home Assistant app permission to “Phone”. But no joy!

The automation code is the following:

alias: button_pressed
description: ''
trigger:
  - platform: template
    value_template: '{{ "Sesame pressed" in states("sensor.SM_s918b_last_notification") }}'
condition: []
action:
  - service: shell_command.open_garage
    data: {}
mode: single

Any suggestions to further debug are welcome. :slight_smile: