Using alert with iOS actionable notifications

I am trying to use the alert feature with iOS actionable notifications. I have the following in my config:

alert:
  abode_updates:
    name: Abode updates are off
    done_message: Abode updates enabled
    entity_id: input_boolean.abodeupdate
    state: 'off'
    repeat: 30
    can_acknowledge: True
    skip_first: True
    notifiers:
      - ios_abode_updates

I configured the notifier as follows:

notify:
  - platform: group
    name: ios_abode_updates
    services:
      - service: ios_alokiosiphone
        data:
          message: 'Enable Abode updates?'
          data:
            push:
              badge: 0
              category: "abode_updates"

The iOS notifications are configured as:

ios:
  push:
    categories:
      - name: Abode Updates
        identifier: 'abode_updates'
        actions:
          - identifier: 'ENABLE_ABODE_UPDATES'
            title: 'Enable Abode Updates'
            activationMode: 'background'
            authenticationRequired: yes
            destructive: yes
            behavior: 'default'

I get the notification, but the action is not carried out. If I put it in an automation, it works. If anyone has a working example of using alert with iOS notifications, I would love to see it.

1 Like

This works for me.

  - name: ios_group_chicken
    platform: group
    services:
      - service: ios_chelseas_iphone_app
        data:
          title: 'Alert'
          data:
            push:
              category: 'chicken_door'

Ahh…looks like it does not like message in there. That makes sense, message is coming from the alert. I will try it out. BTW…can you extend this to add multiple users?

yes, I have multiple users like this.

  - name: ios_group_chicken
    platform: group
    services:
      - service: ios_chelseas_iphone_app
        data:
          title: 'Alert'
          data:
            push:
              category: 'chicken_door'
      - service: ios_ryans_iphone_app
        data:
          title: 'Alert'
          data:
            push:
              category: 'chicken_door'

not really sure if this is the right place to respond but you seem heavy into these iOS actionable notifications…

all i would like is a notification with an option to set an input_boolean to off, or on depending on the alert of course .

something like this:

  action:
    service: notify.ios_iphone #w_m
    data:
      message: "somethingmin on, check the situation home)"
#      data:
#        push:
#          badge: 5
      action_data: # Anything passed in action_data will get echoed back to Home Assistant.
        entity_id: input_boolean.notify_master_switch
        my_custom_data: 'On'

this is incorrect, but i cant find any documentation how together the input_boolean set correctly.
Please have a look?

Thanks,
Marius

Check out my solution here.

o wow thats impressive. will have to study on this…

quick one: not really sure how to get from the action_data: entity_id to the actual action.

as said, for starters i simply want the notification tell me something is picked up and present me with a button on with i can activate an automation.

i have the picking up, the following notification and the final automation. Just need the linking button in the iOS app…

Please see if you can help me there?

selecting a sound file directly works fine, but doing so with a template based on an input_select doesn’t just yet.
What must i change to get it to play this:]

sequence:
  - service: notify.ios_telefoonmhb
    data:
      title: "Play Sound"
      message: "Sound is playing"
      data:
        push:
          sound: "{{states.input_select.speech_sound.state}}"

call it a sound_template ;-)?

You want a data_template:

sequence:
  - service: notify.ios_telefoonmhb
    data_template:
      title: "Play Sound"
      message: "Sound is playing"
      data:
        push:
          sound: "{{states.input_select.speech_sound.state}}"

thanks,
figured that out indeed. working nicely.

Any thoughts why this wont sound? i see the message on my phone, the template is correct in the dev-tools, but n sound is playing:

- service: notify.ios_phone
    data_template:
      title: "Activity Speech"
      message: "Please listen"
      data:
        push:
          sound: >
           {% if is_state ('input_select.activity','Opstart') %} "US-EN-Morgan-Freeman-Welcome-Home.wav"
           {% elif is_state ('input_select.activity', 'Opstaan') %} "US-EN-Morgan-Freeman-Good-Morning.wav"
           {% elif is_state ('input_select.activity','Aan de slag') %} "US-EN-Morgan-Freeman-Turning-On-The-Lights.wav"
           {% elif is_state ('input_select.activity', 'Home theater') %} "US-EN-Morgan-Freeman-Starting-Movie-Mode.wav"
           {% elif is_state ('input_select.activity','Gym') %} "US-EN-Morgan-Freeman-Motion-In-Game-Room.wav"
           {% elif is_state ('input_select.activity', 'Selamat makan') %} "US-EN-Morgan-Freeman-Motion-In-Kitchen.wav"
           {% elif is_state ('input_select.activity', 'Uit huis') %} "US-EN-Morgan-Freeman-Vacate-The-Premises.wav"
           {% elif is_state ('input_select.activity', 'Naar bed') %} "US-EN-Morgan-Freeman-Good-Night.wav"
           {% endif %}

Having a hard time getting this to work. Any pointers?