iOS Actionable notifications - again!

Hi,

I know that this has been an issue before and I have to the best of my ability tried to find a solution in other posts - but I still do not get it to work.

As of now I get a push message but the alternative actions are not shown.

I have updated push settings in notification settings in the app on my iPhone.

I have the following setup. I will try to include as much as possible.

hass.io v.0.87.0

In configuration.yaml I have:

ios: !include yaml/ios.yaml

I yaml/ios.yaml I have:

  push:
    categories:
      - name: Test
        identifier: 'test'
        actions:
          - identifier: 'LAMP_OFF'
            title: 'Turn off'
            authenticationRequired: true
          - identifier: 'IGNORE'
            title: 'Do nothing'
            authenticationRequired: true

I have two automations - one to send the push notice (17) and one to handle the action choosen (18):

 - id: '17'
  alias: Test push notification
  trigger:
  - platform: state
    entity_id: light.golvlampa_3
    for:
      seconds: 30
    from: 'off'
    to: 'on'
  condition:
    condition: state
    entity_id: light.golvlampa_3
    state: 'on'
  action:
  - service: notify.ios_fredriks_iphone7
    data_template:
      message: Trying to turn the lamp off..
      title: ”Our house"
      data:
        push:
          category: 'test'
          badge: 0
- id: '18'
  alias: Test push off
  trigger:
    platform: event
    event_type: ios.notification_action_fired
    event_data:
      actionName: 'LAMP_OFF'
  action:
  - service: light.turn_off
    entity_id: light.golvlampa_3

As of now automation 17 renders the message as expected but not the actionable notifications. Therefore automation 18 is not relevant yet.

I can see two potential problems:

  1. The push categories in ios.yaml are not correct and therefore do not load (how do I know?)
  2. The push data in automation 17 are incorrect or insufficient.

I do not understand the significance of including or not including a badge number. What function does it have?

In some cases I see that action_data are specified. I do not know when and if that is needed. The following description in the documentation is not clear to me:

  • actionData is a dictionary with parameters passed in the action_data dictionary of the push dictionary in the original notification.

I would be very happy if somebody could help me.

Have you written an automation for the IGNORE action?

You need to or the test catagory wont work.

It has no significance. You can use it to display any data you want to, or not.

Ok - so even if I do not want anything to happen there needs to be something.
Can I have only one action?
I will try to include an automation 19 that simply notifies me that the message has been ignored.

Yes you can.

Ok - I will try both.

Tried with an automation for IGNORE - but still nothing in my iPhone - or only the message no actionable notifications.

I have also tried by simplifying with only one action - ‘LAMP_OFF’. Again no success.

I still do not understand why the actionable item does not appear on the iPhone. Can there be some setting on the phone that I need to change? I checked un settings/notices but did not identify anything.

I believe that I had made the error of using capital letters in yaml (actionName and authorizationRequired). Removing the capital letter game me the actions in my notifications.

Must have been something else. That’s how the examples are written and it is how mine work too:

  trigger:
    platform: event
    event_type: ios.notification_action_fired
    event_data:
      actionName: DISARMALARM

OK. Now my new problem is that all events are triggered when I choose one action. I have three categories with two action each. When I get the push notice relating to one of the categories (the one I have used here), and I press one of the actions (Turn off) it does turn off the light but also the Do nothing action is triggered as well the actions related to the two other categories!!! Any idea why?

Contrary to my expectation of capital letters it was necessary to use actionName and not action name.