Evening all,
I have an automation that sends a notification to my wife phone with 3 action buttons using random text for each button. When she clicks on the button I want to be able to pickup the text of the button she picked and wondering if this is possible and if so examples pretty please as I cannot figure it out.
Here is the action code to send the notification:
- service: notify.mobile_app_pixel_7_pro
data_template:
message: 'Notification text goes here'
title: Reward Game
data:
channel: rewardgame
tag: rewardgame
visibility: public
actions:
- action: reward1
title: '{{ ["option 1", "option 2", "option 3"]
| random }}'
- action: reward2
title: '{{ ["option 1", "option 2", "option 3"]
| random }}'
- action: reward3
title: '{{ ["option 1", "option 2", "option 3"]
| random }}'
I then want to do something like this when she presses the button:
- id: REWARD1
alias: Reward 1 was pressed
trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: reward1
action:
- service: notify.mobile_app_pixel_7_pro
data:
message: clear_notification
data:
tag: rewardgame
- service: notify.mobile_app_pixel_7_pro
data:
message: clear_notification
data:
tag: rewardclaim
- service: notify.mobile_app_mc
data_template:
message: '{{ button title here}} was pressed'
title: Reward Game
data:
channel: rewardgame
tag: rewardgame
visibility: public
Is this possible?