i have created an action named OS lights on’ on my app so i can see it in the apple watch.
i have then added the config below to my configuration to turn on lights (in this test only one light)
but there is some error, but i’m not seeing the error.
when saving the configuration i get the following error:
Invalid config for [automation]: required key not provided @ data[‘action’]. Got None
required key not provided @ data[‘trigger’][1][‘platform’]. Got None. (See /config/configuration.yaml, line 45). Please check the docs at https://home-assistant.io/integrations/automation/
anyone that sees what is wrong? when i remove my automation part, the problem is solved.
nevermind. i managed to solve it in Node-Red using the all events trigger on ios.action_fired and then checking with a switch for the value of payload.event.actionName to see which action was triggered. so solved in Node-red instead of the configuration-file.
Sorry to butt in, but I tried your example (with the name of the light changed to match mine) and received no errors; however, the action does not fire. Here is my config:
I don’t think I made a format error, but it is possible. (note: I tried it with the single quotes you had, tried it with double quotes, and with no quotes as pictured here) I can run the action in Home Assistant through the Developer page, but I only get beeps when I try it on my watch. Any advice how I can get it to work from my watch?
My first guess is either the event_type or actionName. I personally use ios.notification_action_fired in my automations and a string which looks like a constant, but isn’t, as the actionName (as can be seen below in my example).
The automation you posted is only a part of the entire flow, so maybe there’s something wrong in another part.
I made an actionable notification for when my alarm is armed (it shows up on my Apple Watch or other iOS device).
This is the service which is called when my alarm is armed:
service: notify.ios
data:
title: Alarm armed
message: The alarm has been activated!
data:
push:
category: alarm_armed
thread-id: notification-alarm-armed
badge: 0
The category which belongs to this notification (which gives the ability on your Apple Watch to select ‘Disarm alarm’):
And the automation which is triggered when ‘Disarm alarm’ has been selected on the Apple Watch (or any other iOS device like an iPhone):
alias: turn_alarm_off
trigger:
platform: event
event_type: ios.notification_action_fired
event_data:
actionName: ALARM_DISARM
action:
# whatever you want to do in this action.
@Tom_Rubbens thanks for your detailed answer. I think I failed to convey my message. Sorry about that.
I too have managed to configure my iOS devices, and I’m able to trigger actions already from my iPhone and Apple Watch. And I love it.
My question is: my wife too needs to switch on the lights etc but I feel I need to configure the actions on her iOS devices from scratch, unless I’m able to take that configuration into the yaml (so that it is available for any user) or at least export my current actions and easily import them into my wife’s devices.
I did configure the actions from scratch on each iOS device using it. So, I’m afraid I don’t have a solution for you…
Interested if somebody has a solution. Because it can help me too.