Awesome App! Actionable Notifications examples?

@robbiet480 - Just wanted to say thank you for continuing work on this app! I’ve just started using it and its working very well. I like the ability to do push notifications and I would love to implement actionable ones as described here.

Does anyone have a working setup that they have out on github, or would be able to share here… showing some real-life working examples of actionable notifications being used with the iOS app?

TIA!

1 Like

Here is one example:

I had a hell of a time getting it going. Seems it is rather sensitive to capitalization. Also don’t forget to update your push settings each time you make a change to the ios file.

automation:
  - alias: Living Room Lamps on at Bedtime
    trigger:
      platform: state
      entity_id: sensor.charging_adamsiphone
      to: 'Charging'
    condition:
      condition: and
      conditions:
        - condition: state
          entity_id: switch.edimax2
          state: 'on'
        - condition: time
          after: '20:00:00'
    action:
      - service: notify.ios_adams_iphone
        data:
          #title: "Living Room Lamps are On"
          message: "The Living Room Lamps are on and you are in bed"
          data:
            push:
              badge: 0
              category: 'lamps'

  - alias: Lamps on bedtime notification
    trigger:
      platform: event
      event_type: ios.notification_action_fired
      event_data:
        actionName: LAMPS_OFF
    action:
      - service: switch.turn_off
        entity_id: switch.edimax2
      - service: light.turn_off
        entity_id: light.yeelightrgb2
ios:
  push:
    categories:
      - name: Lamps Off
        identifier: 'Lamps'
        actions:
          - identifier: 'LAMPS_OFF'
            title: 'Lamps Off'
            activationMode: 'background'
            authenticationRequired: yes
            destructive: yes
            behavior: 'default'
          - identifier: 'DISMISS'
            title: 'Dismiss'
            activationMode: 'background'
            authenticationRequired: yes
            destructive: no
            behavior: 'default'
1 Like

tl;dr: is this do-able when using the alert component, instead of automations?


Thanks for the example… I see you’re doing this with an automation… however, I have a setup where I use the alert component to send alerts to my ios when the garage door is open for a length of time, then it lets me know when it is closed again (but only after a notification from the alert). I would like this notification to be actionable and be able to dismiss it or close the door.

My question is, HOW can I add

            push:
              badge: 0
              category: 'lamps'

part to the alert since it doesn’t even have a message: part, like the automation does?

here is what I have for the alert now:

garage_door:
  name: '{{now().strftime("%H:%M %Y-%m-%d")}}: Garage door has been OPEN for {{ relative_time(states.cover.garage_door.last_changed) }}.'
  entity_id: cover.garage_door
  state: 'open'
  repeat:
  - 15
  - 30
  - 60
  - 120
  can_acknowledge: True
  skip_first: True
  done_message: '{{now().strftime("%H:%M %Y-%m-%d")}}: Garage door is now closed :)'
  notifiers:
    - ios_sc_phone_hassapp

Sorry, I haven’t used the alert component so I can’t help there.

TO use alert with actionable notifications, you will have to create a group. See example here and then use it in alert as shown here. Basically, create a notify group as:

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

and alert like:

  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

The problem with this approach is that you will have to create a separate notify group for every actionable notification. I wish it can be templatized.

1 Like

TY!! I was going to ask next how to get the alert dismissal to work but then I found this little example: http://automatedhome.party/2017/06/05/using-the-home-assistant-alert-component-with-telegram-acknowledge/

service: alert.turn_off

Ill give it all a try and see how it goes. thanks for the help guys.

I just posted a video on YouTube, check it out…

2 Likes