Actionable Notification not working - help

Hi there! I’m trying the actionable notification on the iOS. But pressing the action buttons doesn’t do anything. I double checked the codes, and they all looked ok, but nothing is working when pressing the button.

I tried manually running the automation ios_notification_action_fired and they work, but not from button press in notification.

here is my ios.yaml:

push:
  categories:
    - name: Garage Door Timer
      identifier: 'GARAGE_DOOR_TIMER'
      actions:
        - identifier: 'CLOSE_GARAGE_DOOR'
          title: 'Close the Garage Door'
          activationMode: 'background'
          authenticationRequired: true
          destructive: true
          behavior: 'default'
        - identifier: 'IGNORE_GARAGE_DOOR'
          title: 'Leave it Open'
          activationMode: 'background'
          authenticationRequired: true
          destructive: true

and my automation:

#Garage Door - Close When Left Open
- alias: Garage Door Timer
  trigger:
  - platform: state
    entity_id: input_boolean.garage_door_switch
    to: 'on'
    for: '00:30:00'
  condition: "{{ is_state('input_boolean.garage_door_switch', 'on') }}"
  action:
    service: notify.mobile_app_chris_iphone
    data:
      title: Home Automation Message
      message: 'Garage Door was left open for 30 minutes. Close it?'
      data:
        push:
          category: 'GARAGE_DOOR_TIMER'

#Garage Door - Timer Close Action
- alias: Garage Door - Timer Close Action
  trigger:
    platform: event
    event_type: ios_notification_action_fired
    event_data:
      actionName: CLOSE_GARAGE_DOOR
  #condition: "{{ is_state('input_boolean.garage_door_switch', 'off') }}"
  action:
    service: script.turn_on
    entity_id: script.home_lights_script
    #service: input_boolean.turn_off
    #entity_id: input_boolean.garage_door_switch
  mode: single

#Garage Door - Timer Ignore Action
- alias: Garage Door - Timer Ignore Action
  trigger:
    platform: event
    event_type: ios_notification_action_fired
    event_data:
      actionName: IGNORE_GARAGE_DOOR
  condition: "{{ is_state('input_boolean.garage_door_switch', 'on') }}"
  action:
    service: input_boolean.turn_on
    entity_id: input_boolean.garage_door_switch
  mode: single

I changed the service action in Garage Door - Timer Close Action to lights script to test it, but it’s not working (manual triggering it works).

I also noticed that the destructive doesn’t make the button text red?

        - identifier: 'CLOSE_GARAGE_DOOR'
          title: 'Close the Garage Door'
          activationMode: 'background'
          authenticationRequired: true
          destructive: true

I think your problem is this:

A unique identifier for the category. Must be lowercase and have no special characters or spaces (underscores are ok).

From the docs on category parameters.

E.g. change

push:
  categories:
    - name: Garage Door Timer
      identifier: 'GARAGE_DOOR_TIMER'

to

push:
  categories:
    - name: Garage Door Timer
      identifier: 'garage_door_timer'

.

If this doesn’t fix it, also check that the notification categories exist under the mobile app’s settings.

I haven’t used the destructive option, unfortunately.

Hi! Thanks for responding. Actually my previous identifiers were originally in lower case, like garage_door_timer. I thought maybe changing it to uppercase would somehow make any difference. But I’ll switch it back to lowercase as stated.

I checked the notification settings on the app. I didn’t know about this settings.

Here’s the screenshots:

Do I need to change anything in the app settings? I can see the Garage Door Timer synced.

The destructive button is not really necessary. I just thought it’s a lot easier to see the message if it’s in red. But I wonder why it doesn’t make the text red.

I didn’t mention this explicitly but perhaps should’ve. It’s the lowercase identifier that should be referenced in the automation. Also change e.g.

category: 'GARAGE_DOOR_TIMER'

to

category: 'garage_door_timer'

.

If that doesn’t work, try to simplify and only specify identifier and title under your actions to see if that works?

I still can’t get it working. the destructive red text worked though. But not the buttons.

here’s my current ios.yaml:

push:
  categories:
    - name: Garage Door Timer
      identifier: 'garage_door_timer'
      actions:
        - identifier: 'close_garage'
          title: 'Close the Garage Door'
          destructive: true
        - identifier: 'ignore_garage'
          title: 'Leave it Open'
          destructive: false

this is the automation.

#Actionable Notification
#Garage Door - Close When Left Open
- alias: Garage Door Timer
  trigger:
  - platform: state
    entity_id: input_boolean.garage_door_switch
    to: 'on'
    for: '00:30:00'
  #condition: "{{ is_state('input_boolean.garage_door_switch', 'on') }}"
  action:
    service: notify.mobile_app_chris_iphone
    data:
      title: Home Automation Message
      message: 'Garage Door was left open for 30 minutes. Close it?'
      data:
        push:
          category: 'garage_door_timer'

#Garage Door - Timer Close Action
- alias: Garage Door - Timer Close Action
  trigger:
    platform: event
    event_type: ios_notification_action_fired
    event_data:
      actionName: close_garage
  #condition: "{{ is_state('input_boolean.garage_door_switch', 'off') }}"
  action:
    service: script.home_lights_script
    #service: input_boolean.turn_off
    #entity_id: input_boolean.garage_door_switch
  mode: single

#Garage Door - Timer Ignore Action
- alias: Garage Door - Timer Ignore Action
  trigger:
    platform: event
    event_type: ios_notification_action_fired
    event_data:
      actionName: ignore_garage
  #condition: "{{ is_state('input_boolean.garage_door_switch', 'on') }}"
  action:
    service: input_boolean.turn_on
    entity_id: input_boolean.garage_door_switch
  mode: single

I think I got it. This should be:

event_type: ios.notification_action_fired

.

1 Like

I updated the event type as ios.notification_action_fired, but I still can’t get the buttons work. I even restarted Home Assistant. It’s annoying that I can’t find which part I’m missing because there’s no error in the log.

I figured it out. I read from another thread that the actionName and identifier has to be both in uppercase or it will not work.

Here’s my ios.yaml:

push:
  categories:
    - name: Garage Door Timer
      identifier: 'garage_door_timer'
      actions:
        - identifier: 'CLOSE_GARAGE'
          title: 'Close the Garage Door'
          destructive: true
        - identifier: 'IGNORE_GARAGE'
          title: 'Leave it Open'
          destructive: false

and my automation:

#Actionable Notification
#Garage Door - Close When Left Open
- alias: Garage Door Timer
  trigger:
  - platform: state
    entity_id: input_boolean.garage_door_switch
    to: 'on'
    for: '00:30:00'
  condition: "{{ is_state('input_boolean.garage_door_switch', 'on') }}"
  action:
    service: notify.mobile_app_chris_iphone
    data:
      title: Home Automation Message
      message: 'Garage Door was left open for 30 minutes. Close it?'
      data:
        push:
          category: 'garage_door_timer'

#Garage Door - Timer Close Action
- alias: Garage Door Timer Close Action
  trigger:
    platform: event
    event_type: ios.notification_action_fired
    event_data:
      actionName: CLOSE_GARAGE
  condition: "{{ is_state('input_boolean.garage_door_switch', 'on') }}"
  action:
    service: input_boolean.turn_off
    entity_id: input_boolean.garage_door_switch
  mode: single

#Garage Door - Timer Ignore Action
- alias: Garage Door Timer Ignore Action
  trigger:
    platform: event
    event_type: ios.notification_action_fired
    event_data:
      actionName: IGNORE_GARAGE
  condition: "{{ is_state('input_boolean.garage_door_switch', 'on') }}"
  action:
    service: input_boolean.turn_on
    entity_id: input_boolean.garage_door_switch
  mode: single
1 Like