Hi All,
I have some time to migrate my actions but didn’t work your correct for me.
Can someone help me?
First part work correct. I get a notification with the options thats inside the category:
categories:
- name: "MEDICINE"
identifier: "MEDICINE"
actions:
- identifier: "MEDICINE_SNOOZE"
title: "Remind me later again"
activationMode: "background"
authenticationRequired: false
destructive: true
behavior: "default"
- identifier: "MEDICINE_TAKE_THEM"
title: "I take my medicine"
activationMode: "background"
authenticationRequired: false
destructive: true
behavior: "default"
But when press on the button there is nothing happen (The wait_for_trigger part)
- id: "a7c65cfc-cd58-4475-8df7-fafbd8f9c647"
alias: "Notification - Take medication"
trigger:
- platform: time
at: "13:49:00"
condition: []
action:
- service: notify.mobile_app_peter_iphone
data:
title: "Medication"
message: "Take your medication!"
data:
push:
category: "MEDICINE"
- wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "MEDICINE_TAKE_THEM"
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "MEDICINE_SNOOZE"
- choose:
- conditions: "{{ wait.trigger.event.data.action == MEDICINE_TAKE_THEM }}"
sequence:
- service: notify.mobile_app_peter_iphone
data:
title: "HA - Notification"
message: "Well done, now you can sleep this night"
- conditions: "{{ wait.trigger.event.data.action == MEDICINE_SNOOZE }}"
sequence:
- service: notify.mobile_app_peter_iphone
data:
title: "HA - Medication ALERT"
message: "Take your medication!"
data:
push:
category: "MEDICINE"
Here the JSON output of both actions:
Event 1 fired 13:49:
{
"event_type": "mobile_app_notification_action",
"data": {
"action": "MEDICINE_TAKE_THEM"
},
"origin": "REMOTE",
"time_fired": "2021-12-23T12:49:05.874207+00:00",
"context": {
"id": "4db41d9a7ede03421a77b24126017402",
"parent_id": null,
"user_id": "9863ce4921dc47dab852efee983e12c9"
}
}
Event 0 fired 13:46:
{
"event_type": "mobile_app_notification_action",
"data": {
"action": "MEDICINE_SNOOZE"
},
"origin": "REMOTE",
"time_fired": "2021-12-23T12:46:05.802795+00:00",
"context": {
"id": "cb2ddb8996589d7868749892e46d20cf",
"parent_id": null,
"user_id": "9863ce4921dc47dab852efee983e12c9"
}
}
What do I wrong ?
Cheers,
Happy X-MAS for all of you!!