@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?
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
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
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:
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.