[RELEASE] Homebridge Hubitat v2.0

This is also how Hue bridge integrated buttons work.

1 Like

I have a weird situation and not sure where to post this problem I am having so I'll start here.

I have a Hubitat virtual switch that I have included within Home. A Home automation, "When someone leaves/arrives Home" is supposed to turn on/off this switch (along with none-Hubitat switches). Sure enough, when ever I leave this switch is turned on. The problem is when I return home. Maybe 9 out of 10 times the switch does not turn off while the none-Hubitat switches do.

My first test was to remove all other none-hubitat switches but the results were the same. The Hubitat switch always turned on when I leave but sledom turns off when I get back home.

My next test was to include a Hubitat Hue lamp in this automation. Same results. Both the switch and Hue bulb always turn on but seldom turn off.

Last thing I did was to remove all Hubitat devices from this automation leaving all others. No issues at all. Everything works as it should.

I am lost as to where the problem lies. When I look at the log files it shows the appropriate devices turning on when I leave but when I return only the none-Hubitat devices appear in the log. Is Homebridge not issuing a "Off" command for these devices because it assumes they are already off? (Home, Homebridge and Hubitat show these devices as being on)

What App are you using for HE to Homebridge communications? This one or DanT's MakerAPI version?

What happens if you control the switch from Homebridge itself?

I suggest watching the Hubitat logs while the switch is toggled under Homebridge. If Homebridge app is receiving the command then enable logging on the switch and see if the switch is receiving the command.
I think I’m reading the scenario correctly that you are using HomeKit presence to toggle the switch under hubitat, right?
I can’t think of any reason this can’t work

1 Like

This one.

No problem

Then it appears to be some sort of Homebridge/Apple issue not the HE app right?

As a test last night I added my "Living Room sconces" (Zooz Zen24 V3 dimmer) on my C-7 to Homebridge and was able to control them via Apple Home on my Macbook Pro and iPad. Still able to control this morning.. Also can control my "office lights" (Zigbee bulbs) on my C-5.

edit: I am NOT using any automation. The "off" part seems to be as responsive as the "on"... still messing with though.

That is correct. As stated above, I (most often) see no entry in the HB log when it is supposed to shut off the switch. At the Hubitat end the log shows "on" command but no off command. The switch states trigger a RM which has logging enabled as well. It shows nothing when the switch should be off.

It is very weird because as I stated above, none-hubitat devices switch off when they should. My first reaction was that it was the virtual switch that caused the problem but I have tried other types of Hubitat devices and had the same problems. I know that the Homekit automation is working because the none-hubitat devices behave accordingly.

Ah so you are thinking maybe something in the HE-HB plugin then? - running on HB I mean not the HE app side. I am trying to reproduce but it's working for me. Are all your plugins / HB up to date etc etc?

As can I. The only thing I can think of is that when running the arriving home automation, HB thinks the switch is already off so it doesnt issue the Off command. The question is why? It clearly shows as being "On" within all apps/interfaces

I am grasping at straws. If I go by the HB log I would say there is a problem between Homekit and HB but why only for Hubitat devices.

Ugh... Test 4, Used the "Test Automation" options within the Home App. Leave/Arrive both work like a charm. I was hoping I could use this feature to replicate this problem but it seems not :face_with_raised_eyebrow:

More testing required. In a "real" situation the time between leaving and arriving is more than a few seconds. I'll try using the "Test" feature some more but if that doesnt work I'll have to go for a drive.

ADDENDUM: Could this have anything to do with Cloud vs Local. I just noticed the log for turnin off this switch and the "Cloud = False" caught my eye..

[10/05/2021, 07:17:50] [Hubitat-v2] Sending Device Command: off | Name: (VS_iPhone) | DeviceID: (741) | UsingCloud: (false)
[10/05/2021, 07:17:50] [Hubitat-v2] [Device Event]: (VS_iPhone) [SWITCH] is off

When I really "Arrive Home" it is possible it cant send the Off command because Cloud = false? Again, grasping at straws. In any case, I changed my config to "use_cloud": true,

1 Like

Yeah that is annoying... one thing to try is adding the HB plugin called "Homebridge Virtual Switch" and change your automation to use that. See if that works. Won't help on the HE side but at least tell you if the issue is with HBv2 plugin.

If you were using Node-RED which has a node for reading the state of HB devices (node-red-contrib-homebridge-automation) you could then use that (virtual HB switch + NR) as a workaround.

1 Like

I'm going to try and duplicate this on my end to see if I see the same results.

2 Likes

This is going to be my next test.

UPDATE: Same problem with the Homebridge Virtual Switch. Turns on but not off. So..... I have to assume there is either a problem between Home and HB or the Arrive Home automation has a bug in it. Doesnt explain why my Blink Camera switches turn on/off as they should for both Presence automation.

I think it is pretty safe to assume this problem has nothing to do with your plugin. :blush:

1 Like

You might want try switching the mDNS Advertiser in Homebridge. If that doesn't help you can try enabling Homebridge debug mode to see if it can help you track down the issue.

2 Likes

Try using the a 3rd Party HomeKit app like 'Controller' to create the automation and see if it makes a difference.

Homebridge logs commands with HE, but my HE C7 didn't actually execute (all of them).

Sorry for the long post. Question for this group:

  1. I have a C7 with a Pi4 running v2.5.6 with a homekit scene that shuts down the house at night (turn everything off, close the garage door, lock the doors, etc. -about 45 devices total)

  2. I have problems where intermittently some commands don't seem to ever make it to the device (sometimes it's a bulb or light switch, sometimes it's a lock, etc.)

  3. If I notice (didn't hear the deadbolt motor last night), I can use homekit to re-send the command to that device, or run the scene again and it works

  4. I've enabled more logging to troubleshoot, I can see where Homebridge:

    • Called Process Command (lock)
    • Command Successful for Device | Command [lock{}]
    • Command [lock{}] | Process Time: (818ms)
  5. I noticed that the lock didn't work in a few minutes. Issue a command to homekit to lock the deadbolt and it responded correctly within a second.

  6. My Lock Event Log only shows me executing/locking the door the second time. It's as if the house shutdown scene never anything at 10:24 with the device

Is this a homebridge thing, or a HE C7 issue? Openly I've had issues with my C7. I'm in the troubleshooting stage trying to figure this out as it's been plaguing me for months. Not always the same device. Is the Command Successful line in the long getting feedback from the endpoint device or just that the hub registered the command.

Logs attached and highlighted in green and yellow. 10:24PM is executing the scene. 10:38PM is sending the lock command again because the first time didn't execute.

The C7 log shows no difference between (other than execution times) between successfully locking the door and nothing happening with the door lock. The event log for the lock never saw the homebridge scene lock command.


Any input or help is appreciated. I'm at my witts end and this has me questioning my migration from ST. ST had it's own issues on the cloud side, but my Tonesto HB setup there was bulletproof (which makes me think it's my C7)

Thanks everyone,
Jonathan

I would bet it is the lack of any delay between commands sent. The mesh gets overwhelmed with traffic and commands get dropped. Try putting the devices in a group and using zigbee group messaging or setting a delay of around 70-100ms on the group page and see if it then works as expected.
I see this happen using Apple’s adaptive lighting with CT not changing on all lights unless I adjust the dim level so that the commands are re-sent. I see the commands from HE, just lost in the mesh.

3 Likes

Hi Ken,
Not opposed to trying anything you listed. Just not quite knowledgeable enough to go do. To clarify, you're saying create a group or groups on the hub side and have homebridge call the group instead of addressing each node individually via homebridge. That if the hub does this, it will stagger the commands.

I should also clarify on my side, 99% of my network and all the nodes on it are Z-wave in my house. Not sure if that makes a difference to what you're saying.

-Jonathan

This. Sorry, I’m out of town or I’d oost an example.
When you create the group of devices that you would like to turn off (in the “groups and scenes” app) you will see options at the bottom. If you have all z-wave plus devices, enable “on/off optimization”. This way the “off” commands are only sent to devices that are “on”, reducing a lot of traffic. Also in the group you can enable a delay between commands if needed. Try the group with just optimization enabled first as that may solve your problem.

Hi, no idea where else to ask so, here I go. I've been using this for a while, decided to try home assistant for a while, didn't like it and went back.

I've added all my items, but I can't seem to find a way to get my schlage lock over to the homebridge. Did something change? I could have sworn I had it as an option before.

Thanks!