I think i have discovered a bug. And im pretty sure that this how it works. But the question is if it’s a bug or a limitation, and in that case maybe the documentation needs to be updated.
But i have discovered, that the actionable notification only works if the app is open on the phone either by being in the background or by being open.It does not work if you have completely closed the app…
The notification is sent and is received but the action taken is not send back to your hass. And off cause automation and souch triggered by any action taken will not work, because the action is not sent.
I have tested a couple of times, and i can only get it to work if the app some how is open, either fully or in background.
- alias: HOMESTATUS Push if mikkel is coming home
trigger:
platform: state
entity_id: device_tracker.mikkelsiphone
state: 'home'
condition:
condition: and
conditions:
- condition: state
entity_id: input_boolean.at_home
state: 'off'
action:
service: notify.ios_mikkels_iphone
data:
message: 'Velkommen hjem, skal huset låses op'
data:
push:
category: 'UNLOCK_HOME'
- alias: HOMESTATUS Set home state when notification triggerede
trigger:
platform: event
event_type: ios.notification_action_fired
event_data:
actionName: UNLOCK_HOUSE
action:
service: input_boolean.turn_on
entity_id: input_boolean.at_home
All this is working, when in testing. But when used in real day, it don’t seem to set the input_boolean when the app havn’t been used for some time or if the app is closed?
Thanks for that @FleshFear, thanks to you I was able to fix this issue! I wasn’t properly initializing the API for every way that the app could be opened, like when it was terminated and a notification action came in.
Fix in either 1.0.3 or 1.0.4, should be out within 24 hours or so either way.