I recently bought an AppleTV to act as a homekit hub and have connected it to HA via the homekit hub. I am exposing only 1 device from HA - cover.toyota and that is working great. Via Carplay, I can see the status, open/close the door, etc.
What I would like to do now is if the garage door is opened from carplay, then also disable alarmo when it opens. I found a few examples online regarding how to capture the homekit_state_change event, but it doesn’t seem to be triggering for me. Here is my yaml and my automation.
If I manually run the automation, it seems to work fine, but it doesn’t automatically trigger. The logbook seems to indicate the event is being seen. Feels like I am missing something. Any suggestions?
Go to Developer Tools → Events → Listen to events
Enter homekit_state_change
Click Start Listening
Open the garage door with CarPlay
Observe the displayed event details
If no event is displayed then Home Assistant didn’t receive an event with that name.
FWIW, I don’t have a Homekit-compatible garage door opener to test but I do have ecobee Switch+ switches (Homekit; they have several built-in sensors for motion, light, and temperature). Home Assistant doesn’t detect a homekit_state_change event when the switch is turned on/off or when it detects motion. Not exactly equivalent to testing your garage door but just thought I would let you know the results.
Thanks for the reply. That is even more confusing.
I am seeing the open and close events. But my automation isn’t running at all. The time on the automation shows that it has never run. I even narrowed down the automation to only the detect and a notify. I ran it manually and the notify works - but something is causing it not to trigger.
Do what Pieter said; the event details show there’s no action key but there’s a service key with the desired value (open_cover). Changing action to service should do the trick.
When you execute an automation’s Run command, it simply executes the automation’s actions (i.e. it doesn’t exercise the trigger or the condition).
Thanks for all you participating in this discussion. Indeed changing it from action to service causes the automation to execute. I was trying to follow the example on the homekit page and I guess I just didn’t understand the nuances of the options.