[RELEASE] Homebridge Hubitat v2.0

The heat only option does show the fan, Try using just the Thermostat option.

Try using just the Thermostat option.

That worked - No more fan controls shown! Thank you!!! :smiley:

1 Like

Hello all, apologies with the very basic question, but I am new to the Apple ecosystem. I do find that my Neato D7 (vacuum robot) works very well within iOS and can be instructed to clean certain zones vice a whole-home cleaning. I thought it would be a goo idea to integrate this with Hubitat of course.

I've installed Homebridge Hubutat v2 and created a Virtual Switch to be used as a trigger to activate the robot.

Not sure how I integrate Hubiat to Homekit though. I Selected the switch within the Homebridge App, but when I try to add accessory within Homekit on my iPhone, nothing (except for my Sonos speakers and Lutron stuff) seems to show up.

I'm obviously missing a very basic step here, but can't seem to wrap my head around what it is.

Can anyone steer me in the right direction. Here is what I am trying to do.

I want to have a motion sensor controlled within Hubitat trigger the robot vacuum (in this case the motion sensor is near a cat litter.

Basically:

  1. Motion triggered
  2. Short delay
  3. Vacuum is instructed to clean Zone 'Litter'

I figure I want to take the motion trigger form Hubitat and pass that off to Homekit to trigger a shortcut for the vacuum.

You need to set up a homebridge server and connect the Hubitat to it then link the homebridge server to the Apple Hub.

It's very slick.. I am actually using Homebridge right now without any apple products. Using it for Nest and Ring integrations.

2 Likes

LOL. Ok obviously I was missing a major piece here,

Thanks!!

2 Likes

Thanks for releasing this tonesto7, it's a tremendous bit of kit. I have the majority of my Hubitat devices available under Homekit and working well. Everything except fans.

I'm using the Haiku Fan driver to control my fan. This works great using Hubitat. The fan comes with a light and the driver controls both by supporting capabilities "FanControl", "SwitchLevel" and "Switch". Switch and SwitchLevel are for the light while FanControl is for the fan.

I've added the driver twice to Hubitat and associated one with Lights and one with Fans (3 Speeds) in Homebridge Hubitat. They both appear in Apple Home and have the correct button assigned. The behaviour I'm seeing with Homebridge is that regardless of which button is used, only the light can be controlled.

In the logs I see this when the fan is turned on:

dev:272021-01-17 12:06:26.715 debug parse response: (Balcony Fan;LIGHT;LEVEL;ACTUAL;16)
app:592021-01-17 12:06:26.698 info Homebridge (v2.2.2) | | Balcony Fan Homebridge | Command [setLevel()] | Process Time: (30ms)
app:592021-01-17 12:06:26.688 info Homebridge (v2.2.2) | Command Successful for Device Balcony Fan Homebridge | Command [setLevel(100)]
dev:27 2021-01-17 12:06:26.668 debug parse response: (Balcony Fan;LIGHT;PWR;ON)
app:59 2021-01-17 12:06:26.658 info Homebridge (v2.2.2) | Plugin called Process Command | DeviceId: 27 | Command: (setLevel) | Param1: (100)
app:59 2021-01-17 12:06:26.290 info Homebridge (v2.2.2) | | Balcony Fan Homebridge | Command [on()] | Process Time: (213ms)
app:59 2021-01-17 12:06:26.271 info Homebridge (v2.2.2) | Command Successful for Device Balcony Fan Homebridge | Command [on()]
app:59 2021-01-17 12:06:26.194 info Homebridge (v2.2.2) | Plugin called Process Command | DeviceId: 27 | Command: (on)

setLevel() and on() are both commands that only apply to lights. For fans both of these should be translated to setSpeed().

I'm also not sure why Fans (3-Speeds) and Fans (4-Speeds) are required? In Hubitat all drivers that support FanControl capability can handle 5 speeds: low, medium-low, medium, medium-high and high. I believe Homebridge Hubitat should be translating the percentage level into one of these five speeds and letting the driver handle the rest. The device categories Fans and Fans (Multi-speed) should be all that's required.

The Haiku fan driver is the only multi-speed fan I have, so I'm not sure if the existing code works to support other fan drivers? If not, I can make these changes if you'd like and submit a pull request?

Is this normal?

Error: Homebridge (v2.2.2) | sendHttpPost: no plugin server configured src: sendDeviceRefreshCmd path: refreshDevices

Error: Homebridge (v2.2.2) | sendHttpPost: no plugin server configured src: updateServicePrefs path: updateprefs

Anyone been able to get this to work with Sonos? I'd like to have sonos play/pause/volume in homekit, but in the Homebridge App my sonos speakers don't show as Speakers in the 'device selector' - any ideas?

I've made changes to enable support for capability FanControl and to allow Light capability to co-exist with other services. This allows for fan & light drivers to show up in Homebridge. Included in this is a new 5-speed fan category.

Pull request has been sent. Changes are in GitHub - dineshpannu/homebridge-hubitat-tonesto7: Hubitat Homebridge Plugin

Thanks, I will review it and push it up

I will look into merging your changes, the issue is you removed logic that supports other custom fan devices. So I will need to manually merge these changes while preserving original logic

Right, I was afraid I might have been clobbering work that was required for other drivers. Do all Hubitat fan drivers not support FanControl? Do you have examples of ones that don't?

That is a good question.
Now that I’m only worried about supporting Hubitat specifically I need to review the state of current fan drivers and maybe clean up the logic.

Most of your code changes were good except the service type and transforms. The order of detection of capabilities is important which is why lights and switches are are the bottom.

I genuinely appreciate other devs submitting fixes and updates.

3 Likes

Now that I take a closer look at HE_ServiceTest I see some of the issues you are talking about. It looked like the light test was being duplicated so I removed one. Now I see one may be for dimmable lights and the other for a light switch. I'll revert my changes to the bare minimum and ask for another review.

The changes I made to HE_Transform are OK I think. I haven't found any Hubitat fan drivers that operate without FanControl capability and its associated speed attribute. Converting all fan speeds to one of the 5 FanControl speeds is sane. The Hubitat fan driver converts it to it's fans supported speed.

I think my biggest problem is allowing for fan + light while also disallowing dimmable light + light switch, which I think is the purpose of the onlyOnNoGrps parameter in ServiceTest. I've also noticed that Homebridge-Hubitat doesn't work correctly with the Virtual Fan Controller. It forces it into Others category rather than one of the Fans category. I'll take a look at this too.

Really appreciate the feedback.

If you add the fan light component to the lights input it should handle the light without any code modifications

Hi @tonesto7 and group,
Long time user on Smarthings with Homebridge v2, recently migrated over to Hubitat with Homebridge v2.2.2, and still working out kinks on my C7 and version 2.2.2.

I'm finding that with this setup I have frequent occasions where the Apple Home app gets out of sync with the state of a switch or a dimmer. Especially if changes are made directly after each other.

Also, with a Homekit "Scene" activated (say a goodnight scene) where it relays a command to shut off 30-40 lights, close the garage door and lock 2 deadbolts, somewhere in that relay I'm finding that locks can take upwards of a minute before activating and some lights are 30 seconds (some are never on the first try, but work on the second push of the scene button)...

The same sequence on Smartthings with the scene button was almost instantaneous. The lock(s) if triggered manually via Homekit or a dashboard are instantaneous / very responsive...

Just wanted to give that feedback and see if anyone has any troubleshooting tips. The mesh is solid, It's almost like the C7 or the 700 series chip doesn't like a flood of instructions coming at it at once. The Apple Homekit app is my most repeatable instance of this. It's interesting and I'm having a hard time figuring out where the delay or breakdown in the command chain is.

Take care all, thanks @tonesto7 for making this all happen!
Jonathan

I was seeing that even with everything in HE. I have a button that does a similar routine and not all lights go off at the same time (they could be 30 to 45 seconds apart). I moved all the logic to Node-RED and I'm still seeing the same thing. I have a mix of Z-Wave (+ and non-plus) and Zigbee, so I suspect it's something to do with getting responses back to confirm on/off, lock/unlock states (but this is only a guess). Also, I was seeing the same thing when activating it from Apple Home.

I have a group of lights (10 Sengled Color+ bulbs with Zigbee Group enabled) - "Den Lights" that are HubMeshed from a C-5 to a C-4 and then exposed to Homebridge using the App. Turning it on/off in Apple Home is very fast. It's the only shared "device" I've done so far but will report back if I encounter the same issues as y'all.

Note: the reason for the seemingly convoluted setup is I am using the C-4 for Cloud/Networking connectivity,devices&apps. The C-5 is zigbee devices, C-7 is for Z-Wave and a Node-RED server for the rules. Also worth mentioning is the NR server is the only external system that deviates from my design, it's connects to all the hubs - still experimenting with optimal setup tho.

1 Like

Turning on/off individual lights (or even a Zigbee group) is very quick. It's when I have a sequence that turns off all lights and locks the doors (Zigbee bulbs, Z-Wave switches, Z-Wave locks) that I see the delay. I looking at last nights activity, the first button press ("hold") turned off all the Zigbee lights and some of the Z-Wave switches and the rest turned off about 40 seconds later (but required a second "hold" of the button). The doors were already locked so nothing happened there.

1 Like

mmm so if you create a scene in HE and expose that to HomeBridge?

(probably won't work with locks tho).

Or maybe a virtual switch..