michel72
(Michel - espthings.io)
1
Hi,
How can I migrate from this depricated solution to something that does exactly the same for the mobile app?
ios:
push:
categories:
- name: Forgot Alarm
identifier: "forgotalarm"
actions:
- identifier: "ALARMON"
title: "Alarm on"
activationMode: "background"
authenticationRequired: no
destructive: yes
behavior: "default"
automation:
- id: push_notification_action_forgot_alarm
alias: "Push notification action - Forgot alarm"
initial_state: on
trigger:
platform: event
event_type: ios.notification_action_fired
event_data:
actionName: ALARMON
action:
service: alarm_control_panel.alarm_arm_away
entity_id: alarm_control_panel.alarm
Cheers,
Michel
michel72
(Michel - espthings.io)
2
Nobody willing and able to respond?
ghassan
(Ghassan Christensen)
3
Hi @michel72
I just succeeded migrating one of my automations and will try to guide you the way I did.
Instead of defining the categories on your iphone in the companion app, you specify these directly when sending the notification like this
- service: notify.mobile_appXXXXXXXX
data:
title: Forgot Alarm!
message: Would you like to turn the alarm on?
data:
actions:
- action: ALARMON
title: "Alarm on"
activationMode: "background"
authenticationRequired: no
destructive: yes
- action: ALARMOFF
title: "Alarm off"
And in the response to the event, the event type is changed to mobile_app_notification_action
and actionName replaced by action
automation:
- id: push_notification_action_forgot_alarm
alias: "Push notification action - Forgot alarm"
initial_state: on
trigger:
platform: event
event_type: mobile_app_notification_action
event_data:
action: ALARMON
action:
For more details see Actionable Notifications | Home Assistant Companion Docs (home-assistant.io)
Hope it works for you, otherwise let me know and I will try to help you further.
Kind regards,
Ghassan
michel72
(Michel - espthings.io)
4
That is absolutely great.
Based on your clear explanation I was able to get this changed and working again!
Thanks!
Michel
ghassan
(Ghassan Christensen)
5
Hi Michel,
That is great,
Please remember to tag my answer as a solution
kind regards,
Ghassan
{{ trigger.event.data[“textInput”] }} not working with this migration tried it on google and alexa ( it was perfectly working with ios push .
- service: notify.mobile_app_iphone_xs_rami
data:
title: Alarm kitchen
message: Someone is in the kitchen
data:
attachment:
content-type: jpeg
entity_id: camera.raspicam
actions:
- action: "TTS_ALARMLIVINGROOM_ALEXA"
title: "Home TTS Alarm alexa"
behavior: 'textInput'
textInputButtonTitle: 'Send TTS'
textInputPlaceholder: 'alexa?'
- action: 'TTS_ALARMLIVINGROOM_GOOGLE'
title: 'Home TTS Alarm google'
behavior: 'textInput'
textInputButtonTitle: 'Send TTS'
textInputPlaceholder: 'google'
- alias: "Home TTS Alarm google"
trigger:
platform: event
event_type: mobile_app_notification_action
event_data:
action: TTS_ALARMLIVINGROOM_GOOGLE
action:
- service: tts.cloud_say
data_template:
entity_id: media_player.living_room_speaker
message: >-
{{ trigger.event.data["textInput"] }}
cache: true
- alias: "Home TTS Alarm alexa"
trigger:
platform: event
event_type: mobile_app_notification_action
event_data:
action: TTS_ALARMLIVINGROOM_ALEXA
action:
- service: notify.alexa_media_rami_s_2nd_echo_dot
data:
target:
- media_player.rami_s_2nd_echo_dot
data:
type: announce
message: '{{ trigger.event.data["textInput"] }}'
~