Automation based on mobile_app_notification_action event type not working

Hi there,

soooo this one is driving me nuts, usually I’m able to figure this stuff out myself, but with this one I see no other options than to turn to you lovely people :smiley:

What I’m trying to achieve:
Get a notification on my phone (iOS) once the moisture of my plant sensors is below a certain threshold - this part works with no problems through this script:

alias: Water Plant Test
sequence:
  - service: notify.notify
    data:
      title: Plant test
      message: >-
        Moisture: {{ states('sensor.plant_sensor_361a_moisture')
        }}%
      data:
        actions:
          - action: DONE_GOLDEN
            title: Done
            icon: sfsymbols:checkmark
          - action: URI
            title: Show Map
            icon: sfsymbols:map
            uri: /ui-lovelace-minimalist/plants
          - action: IGNORE_GOLDEN
            title: Ignore
            icon: sfsymbols:xmark
            destructive: true
        image: /local/push-images/golden_photos_grey.png
        sound: NavigationGenericManeuver.caf
mode: single
icon: ios:drop-circle

Which is called through this automation:

alias: Water Plant Test Automation
description: ""
trigger:
  - type: value
    platform: device
    device_id: xxx
    entity_id: sensor.plant_sensor_361a_moisture
    domain: sensor
    below: 20
condition: []
action:
  - service: script.water_plants_test
    data: {}
  - service: input_boolean.turn_on
    data: {}
    target:
      entity_id: input_boolean.golden_photos_water_reminder
mode: single

This also turns on a helper, which is a simple toggle on/off, which is used to send me reminders every 6h (this part also works without issues).

Now the problematic part:
Once I select Done/Ignore through the iOS notification, nothing happens. The automation that handles this part looks like this:

alias: Water Plant Test Automation (Reminder off)
description: ""
trigger:
  - platform: event
    event_type: mobile_app_notification_action
    event_data:
      ACTION: DONE_GOLDEN
  - platform: event
    event_type: mobile_app_notification_action
    event_data:
      ACTION: IGNORE_GOLDEN
condition: []
action:
  - service: input_boolean.turn_off
    data: {}
    target:
      entity_id: input_boolean.golden_photos_water_reminder
mode: single

I also tried ios.notification_action_fired instead of mobile_app_notification_action, but sadly the input boolean doesn’t turn off, which results in me getting notifications every few hours to water the plants, even though I already did that.

(I know I could just turn off the reminder once the plant sensor recognises on its own that there is enough water in the soil, but I’m planning to use this kind of automation for various other things, this is just an example for testing purposes.)

Listening to the event through the developer tools also returns this:

Sooooo it SHOULD work, right? What am I missing here? :sweat_smile:

Any help would be appreciated, thank you in advance!

Even more confusing:

Firing the event manually through the developer tools triggers the automation :thinking:

action should be all lower case

Oh boy… thanks for pointing that out, it is indeed working now! :grinning_face_with_smiling_eyes:

1 Like