Hi. I’ve configured a basic actionable notification sent to my mobile companion app, but when I listen for the event data, it does’t show up??? I’ve listened to notify.mobile_app_action and i’ve tried listening to ios.action_fired. Any ideas from anyone?
Post the automation
I use ios_action_fired.
Have you checked traces to determine why it may not be triggering?
whats traces? How do I do that… EDIT: FIGURED IT OUT
Here is my yaml
alias: Deadmans Switch Check-In
description: ""
triggers:
- trigger: time
at: "07:00:00"
conditions: []
actions:
- action: notify.mobile_app_iphone
metadata: {}
data:
data:
push:
sticky: "true"
sound:
name: default
critical: 1
volume: 1
actions:
- action: CHECKED_IN
title: Yes, I'm here
message: hey
title: dude
- wait_for_trigger:
- trigger: event
event_type: ios_action_fired
event_data:
action: CHECKED_IN
timeout:
hours: 24
minutes: 0
seconds: 0
milliseconds: 0
continue_on_timeout: false
- data:
entity_id: input_datetime.last_check_in
timestamp: "{{ now().timestamp() | int }}"
action: input_datetime.set_datetime
mode: single
try below
alias: Deadmans Switch Check-In
description: ""
triggers:
- trigger: time
at: "07:00:00"
id: time
- trigger: event
event_type: ios_action_fired
event_data:
action: CHECK_IN
id: iosaction
conditions: []
actions:
- if:
- condition: trigger
id:
- time
then:
- data:
message: Are You Here?
data:
tag: checkin
actions:
- action: CHECK_IN
title: dude
destructive: true
enabled: true
action: notify.mobile_app_iphone
else:
- if:
- condition: trigger
id:
- iosaction
then:
- data:
entity_id: input_datetime.last_check_in
timestamp: "{{ now().timestamp() | int }}"
enabled: true
action: input_datetime.set_datetime
- data:
message: You have been Checked In
data:
tag: checkin
enabled: true
action: notify.mobile_app_iphone
Hey. I got this error msg when trying to put in that yaml;
Message malformed: Unable to determine action @ data[‘actions’][0][‘else’][0][‘then’][0]
I’ve never nested if statements under actions before so this is new territory for me.
EDIT: I got this script working, but for some reason I had to change the event to mobile_app_notification_action ?? There is no ios_action_fired event set up in my HA Platform??
Thanks for you help.
i edited the previous post.
it was missing action “action: input_datetime.set_datetime”
this will survive reboot since if system reboot while automation was “waiting” it would cancel. since it will work based on receiving notification action it works always. Trigger IDs are great
Thanks very much for your help!