Thanks in advance for this killer plugin, and for updating it from legacy. It's a key link in my system, where I use Home Assistant as the central player but also use Siri and an Amazon Echo to run commands through Home Assistant (so it can keep track of states and be in charge of more advanced automation as things expand).
I've recently run into a minor issue -- after a modest amount of work, I've finally made a custom garage door opener, complete with state detection. It's working great with Home Assistant, and I can use my Echo to control it by voice, and it even works on HomeKit iOS apps. Its backend is a small script that is called by the command_line switch component.
The issue is that I'd like to be able to call the "friendly name" something like "garage" or "garage door," but when I try to tell Siri to "turn on the garage door" (using turn on / off because the component is a switch), Siri tells me she can't find any garage doors. I'm thinking this is because garage door is a defined type in HomeKit, and she is looking for a HMServiceTypeGarageDoorOpener
.
I'm really hoping to get this working with Siri, so I've thought of a couple potential workarounds:
- Rename the device something that doesn't involve the word "garage" and continue to use as a switch
- Make a homebridge-homeassistant patch to allow a garage door accessory type
I think the second option seems more like the "right way" to do it, and while I hardly know any Javascript, there are already a few projects that implement HAP-NodeJS's Service.GarageDoorOpener
that I could probably use to help me figure out how to make a new homebridge-homeassistant accessory type.
However, I'm not sure how to best determine whether or not a switch should be a GarageDoorOpener. Toying with the Hass REST API, there doesn't seem to be any additional metadata exposed with a switch where I could put some kind of flag -- really just the entity_type.friendly_name
(e.g. switch.my_first_switch
).
So in terms of ways to get homebridge-homeassistant to recognize that a switch
should be given a special accessory type, I've thought of a few potential solutions:
- Perhaps add a config option -- off by default to avoid breaking any existing functionality -- to parse part of the friendly name as a "flag"
- For example,
entity_id
: switch.garagedoor_garage
- If the config var is set to "look for special accessory types", then look for the
garagedoor_
prefix, strip it out (for the "friendly name"), and set this as a GarageDoorOpener
accessory
- While this solution seems a little sloppy to me, the big advantage would be that it would be very simple for users to implement the very flexible Home Assistant
switch
component as a number of different HomeKit service types
- I could try to write a new Home Assistant garage-door command_line component, then simply have homebridge-homeassistant look for the
garage_door
entity_type
- I could maybe adapt the existing Command Line Rollershutter component and have homebridge-homeassistant recognize a
rollershutter
entity_type
as a GarageDoorOpener
Before I start chugging away at one of these, I thought I'd open up an issue for discussion. @maddox -- do any of these sound like reasonable solutions that you'd consider pulling in so others could also take advantage?
Am I missing an obvious simple alternative to get Siri to find my switch named "garage"?