I had home bridge plug-in for hubitat on a Pi and that seemed to work but then I moved it to a Docker on my Synology once I realized it was available there and have this issue (note that I reinstalled everything on HE when I did that).
My virtual switches show up in Homekit after I add them with the HE app.
For my August lock I have a virtual lock in HE and an automation in Homekit that changes the lock's state when Homekit sees the door locked/unlocked.
First question: Is that the right way to map a lock in HE to a Homekit lock?
Second thing is I'm getting this 'Connection refused' whenever the lock state changes in Homekit:
(app 164=homebridge device 67 is my virtual lock)
So the HE home bridge got the message and change the virtual lock but then failed to communicate that back to Homekit. HE is on *.127, I don't know why it's trying to send the message there. On the phone the virtual switch sits with the spinning communication icon for a long time.
I don't see anywhere to tell the HE plugin where the Homebridge server is running.
I have searched the forums but with no luck.
Thank you!
Scott
It's "a" way to do a lock.
I do virtual presence using Homekit that way, so I don't see a problem with it.
The Config file that's generated by the Homebridge App in HE is what tells Homebridge where to look for HE.
You have to copy that config into Homebridge's config.json file.
This docker image comes with a really nice Homebridge UI that lets you paste the config in:
Also lets you update right through the UI and displays the barcode for you.
Thank you. I did use that Docker instance:) I also have virtual switches for presence detection and that seems to work.
I have that in the config so the Hombridge is communicating with the HE but then the HE is responding "Sending DEVICE event" and that's where I see the Connection refused message.
I can Ping HE from the synology and the HE variables are triggering when a Homekit event occurs.
I didn't now about the Terminal window so I looked at that and looks OK. (pasting that below).
The synology/homebridge machine IS communicating with HE, it's just that the HE is trying to send a response BACK to the synology and failing. For instance the variables and rules ARE getting triggered in HE when a door-lock event occurs. The HE log indicates that failure.
On the Home app on iOS I see the Lock itself changing to locked (for instance) then the HE gets the signal that the HE vir. lock is set, then on the Home app I see the HE vir. lock say 'Locking...' and the network spinning circle shows and never goes away (or only have some long timeout).
Seems like there should be some way for the HE homebridge plugin to know the IP of the Homebridge machine (synology).
How does HE know where to send the homebridge commands?
I just set up a virtual lock and didn't get any errors. I've got version 1.5.2 of the app on the HE and on the Docker container 0.4.46 of Hombebridge and version 1.5.6 of the homebridge-hubitat-tonesto7 plugin
So, I think that probably means there is an issue in either Synology or Docker.
A few things to try:
a) verify the dates and times are set correctly on the Synology NAS.
b) verify the DSM_HOSTNAME is set correctly in the container
c) verify the NAS directory that the container is attempting to write to is not set to read only in Docker
d) try backing up and deleting the "settings" and "persist" directories from the NAS file system. Note that this can cause you to have to delete/repair the bridge from iOS and/or cause room names to be reset.
The IP of the Homebridge server is known by HE when it gets the initial message.
Homebridge Server starts, sends a "I'm awake, what needs registering?" and HE responds with the list you've picked. HE can respond because it's replying to a message, the IP of the Homebridge server is in that message. (Source address)
That makes sense. The HE did register the switches to the homebridge so I know it's communicating (or was). But it's not anymore. I just tried to add a new device using the HE homebridge app and it did not register in Homekit, similar error. I guess something broke along the way. Should I reinstall the HE plug-in or the homebridge plug-in? Suggestions welcome. Here's the log when I tried to add a new device:
Ok I just figured it out, thanks for the help @csteele.
The IP on my 'sending DEVICE' message was my HE not my hubitat, which I knew but didn't know how to fix. I had requested a restart of homebridge when I update the HE plug in (like you just did) and that didn't fix it. But taking a close look I realized that the homebridge server did not restart (the Docker container doesn't respect the restart command). So I restarted it manually and it worked, the IP changed to my docker's IP.
I think the problem goes back to the HE plug in config setting:
"direct_ip": ".....",
which I had set to HE's IP, I don't know why. But when I got this error a few days ago I removed the line. I'm sure I restarted at the time but maybe there was some reason that didn't take.
Thanks again.
Hopefully this thread will help someone in the future!
To THAT you add what's in the Hubitat App's text. That will give you the minimum you need. No need for Direct_IP or Direct_Port because "direct" is now the default. ("now" as in: for the past year or more.)
The data on the Hubitat page is lovely to look at but is one character wrong. The 'base' portion ends with },
The next element should be the Line: "platforms": [
That means the initial { of the Plug-In Configuration Data is wrong/extra.
Use https://jsonlint.com to validate your config. It will find any punctuation that is wrong.
If you copy paste the 'base' I inserted here into jsonlint validator, then paste in your Plug-In Configuration Data and click Validate Json, it will show line 7 is in error.. delete line 8 and then validate again, it passes. it needs that comma on line 7
But remember, my 'base' is bogus.. username and pin need to be your custom values.
Thanks!
My solution was to remove the "Direct" entries as those were wrong, then restart the server. As I said, I tried that earlier but the restart was failing w/o me realizing it.
I use this homebridge console UI that has a restart option but the Docker container was not respecting that.