Closed gabrielca closed 2 years ago
Hmmm....just made my harmony remote switch visible to home kit and even flipping it from the home assistant interface leave home kit in an out of sync state until I restart the home app.
There a general problem with switches not updating their status to home kit when home kit doesn't do the toggle? This a known issue?
I'd recommend the following approach for the most robustness:
It's mostly an experiment, so bear with me but I've got an iHome switch that's attached to Christmas tree, and it's a full blown home kit device.
I was thinking that I might be able to create a switch in Home Assistant using the command line switch (just doing echo's on the turn_on/off for the switch) thinking that it might be a way to control a home kit accessory from within home assistant.
Now it mostly works. When the home kit switch turns on theres an automation to turn on the home assistant on, same deal for off.
There's also two automations in home kit that when the home assistant one changes state it sets the home kit switch to match.
If I flip the home kit switch from the Home app it flips the home assistant one, changes are seen in HassIO's web page. If I flip the Home Assistant switch in the Home App it also works.
BUT if I flip the switch in Home Assistant home kit doesn't see the transition and doesn't trigger the automations. If I restart the Home App, it then sees the change (I'm guessing it's doing a query?) and then triggers the automation...weird but ok.
I set log_level to debug and I see things like:
[2017-12-6 21:42:55] [HomeAssistant] Setting power state on the 'Christmas Light' to off [2017-12-6 21:42:55] [HomeAssistant] Successfully set power state on the 'Christmas Light' to off [2017-12-6 21:42:55] [HomeAssistant] Setting power state on the 'Christmas Light' to off [2017-12-6 21:42:55] [HomeAssistant] Successfully set power state on the 'Christmas Light' to off
In the cases that work. In the case where I set the switch from the overview page in Hassio there's crickets....doesn't seem to be any log activity.
I know there will be some edge case synchronizing issues with this approach (like switches change while hassio is offline or crashes or restarts or whatever) but I can live with them if I can get HomeKit to see changes from Home Assistant.