[Release] Logitech Harmony Hub Driver v0.1.20190723

v0.1.20190723 adds Actuator Capability to allow use in RM's Custom Actions
v0.1.20190715 adds support to the Parent Device for VolumeUp, VolumeDown, Mute, ChannelUp, and ChannelDown custom commands for those Harmony Activities which support Volume and/or Channel control. Thank you @aaron for you insight and motivation to bring these features to fruition!** Simply update your Parent driver and then click REFRESH on the Parent Device. Update: You can now add a Volume Tile to the Dashboard for the Parent Device to bump the volume level up or down (but you cannot set a specific volume level as the Harmony Hub cannot set the level, it can only adjust the volume up and down.)

Note: Logitech changed the webSockets interface slightly in v4.15.250 of the Harmony Hub firmware. @corerootedxb was able to come up with a fix to the driver to make it work with the new 4.15.250 firmware. This issue only affects new instances of the Logitech Harmony Hub virtual device. Existing users are not impacted. v0.1.20190220 of this driver is designed to work specifically with Harmony Hub v4.15.250. Existing user may upgrade as well, as long as their harmony hubs are also at 4.15.250. Thank you @corerootedxb for the quick solution!

I am pleased to announce a Release of my new Logitech Harmony Hub Driver. This driver communicates directly to your Harmony Hub over your LAN. It will create a child switch device for each of your Harmony Activities, and will keep them all up to date with instant status updates from the Harmony Hub. No polling required! :grin:

This integration requires new LAN connectivity features only available in the recent Hubitat Elevation Firmware version 2.0.3. and newer

The instructions for using this driver are available in my GitHub repository within the ReadMe for this driver. This is a very early release. I expect users will want enhancements. I encourage GitHub Pull Requests as I welcome community support of this integration!

29 Likes

Brilliant Dan! This eliminates all of the different work-a-rounds I and others have come up with to get instant status updates!

Just to be clear, this allows for monitoring but not control of the harmony devices correct?

Merry Christmas indeed!

Edit: And to think, all I was expecting was a new pair of socks and maybe an ugly tie or two!

1 Like

@ogiewon getting some warnings in logs?

dev:39882018-12-25 08:25:34.130 am warnUnhandled response from Harmony Hub. json = {"type":"automation.state?notify","data":{"caseta89":{"status":0,"brightness":254,"on":true}}}

dev:39882018-12-25 08:25:32.403 am warnUnhandled response from Harmony Hub. json = {"type":"control.button?pressType","data":{"type":"short"}}

dev:39882018-12-25 08:24:02.635 am warnUnhandled response from Harmony Hub. json = {"type":"automation.state?notify","data":{"caseta89":{"status":0,"brightness":125,"on":false}}}

dev:39882018-12-25 08:23:49.854 am warnUnhandled response from Harmony Hub. json = {"type":"automation.state?notify","data":{"caseta89":{"status":0,"brightness":125,"on":false}}}

Edit: I think I know what it is, I still have my integration with lutron active

It’s a Beta ! :stuck_out_tongue_winking_eye:

The warnings are for things I haven’t figured out what to do with, if anything.

I finished removing my caseta bridge from harmony setup so I'm guessing the warnings will go away. Just giving feedback as I'm sure other configurations will also show these warnings if the driver isn't expecting them.

Thanks again for your work on this! I hope Santa hooks you up with some well deserved goodies since this driver should definitely qualify you for his "nice" list!

1 Like

You can safely ignore warnings for unknown messages. I just left them there so we could understand what other messages come in to see if they might be useful.

I focused on Activity control for now. You can start and stop Activities using this driver.

If someone wants to focus on Harmony Device control, I believe the API would allow it.

I used the work from the Home Assistant folks as a starting point for this integration.

1 Like

This is great. I’m not home so I can’t play with it but I got to dig through the code and see how it all works.

How did you figure all the websocket groovy commands? Is it documented anywhere?

@ogiewon probably not related, but I'm noticing some sluggishness in my lighting automations (hue integration) since adding this driver this morning.

Any reason you can think of that this new "lan communication" option could be causing HE to struggle?

Edit: My logs are clean (since removing the lutron integration from the harmony)

I can’t think of anything, however it is all beta code. :wink:

I am only running this on my development hub.

Its amazing how well the websocket solution works for controlling the activitys. 100% local and no need to fight with any keys for authentication and its really fast. I guess this is a security issue on your local network but this would be the least of my worries on my local network.

I hope they don't take away the websocket implementation.

2 Likes

Thanks for the feedback. Please let us know if you find any issues.

@ogiewon I just set this up and tried it now. Very easy to setup. So far it works 100% and instantly! I removed my Lutron integration before hand.

Thank you very much for making this work! Do you have any idea how many people you are going to make very happy with this!!

2 Likes

Until the day logitech removes websocket support and you will have all those people mad at you for not updating it to work again.

1 Like

Very Nice! I'm excited to see development towards a Harmony solution.

Right now, this isn't quite a solution for me - but I'm hoping it will become one. I was wondering if there were plans to send commands to specific devices? All of my "activities" are handled within HE - they are really more of traditional macros as I no longer use my harmony remote. If an activity requires an IR device, HE sends the command to tasker on a separate android machine and then it is routed to my harmony hub. It's all local, and works well - but I'd love to get the bridging android device out of the equation.

I believe Device commands could be implemented. I’m not planning on actively adding that capability, but I welcome others to do so.

Dan, did the public release of 2.03 break this integration?

edit: disregard, for some reason I had to open the parent device and re-save then it came back to life

1 Like

I saw the same thing going from the first beta to the second beta with this driver. Not sure what is going on. Might be something in the new webSockets API. Or it could be in my code. Pressing REFRESH also seems to bring it back to life.

I'll need to do some more investigation...

1 Like

I think its because it doesn't reconnect the websocket after the reboot.

Clicking refresh will send a websocket command which should fail because its not connected, however should be caught by the websocketstatus and issue the reconnect command which calls initialize and it kicks back in.

One thing you can do is create a smart app that manages the devices and subscribes to the hub reboot event. Then after any reboot it can kick off a reconnect and refresh to update any switches for scene's that may be out of sync.

Its more complicated but I only think you can subscribe to that event in the app. I don't think there is any way to issue a command after a reboot with a driver.

You can also add it to a rule that maybe calls refresh on it every x minutes. This way it will eventually kick back in.

I could be wrong, but this is what I could see by scanning through the code.

I think you're correct as well. Since this issue would plague any device driver that uses webSockets, it probably makes sense to have @chuck.schwer take a look at the new webSockets API to see if there is a race condition or something happening during startup of the hub.

I just updated my DEV hub to 2.0.3.114 and had to click SAVE on the Parent Device as well to restore the webSocket connection. Earlier, during my testing, the driver's Refresh call used to perform the same action as saving the device. I think I changed it in the last release to try to clean up the code a little.

1 Like

This issue actually plagues any driver that does some kind of function that kicked off when its installed. I think it was telnet I was playing with that I also saw this. I get around it by creating parent apps to manage them.

You could also create a schedule to run a connect method every X minutes. If its already connected it will just close the connection and create a new one. But at least after a reboot it will eventually reconnect and continue functioning. I don't know if there is a way to tell if its already connected before trying to reconnect other than sending a random message and getting an error.