[Release] Logitech Harmony Hub Driver v0.1.20190220


#1

[UPDATE] - 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.5.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!


I did it! I unplugged it!
Compatible Devices Wiki
Home Control with Google
I did it! I unplugged it!
HE Newbie Questions- No Hub Experience
[Release] Amazon Alexa Text to Speech (TTS) v0.5.1 - Direct Integration (USA, Canada, UK, & Italy)
Hi All!
[Deprecated] Harmony hub instant status updates using node.js app
Websocket Client
GE / Jasco Smart Dimmer: Hubitat AND Harmony Home Hub?
Telnet not getting data to parse
Sense Energy Monitor
Harmony Hub Integration
UK Greenwave Smart Plug
Community Apps
#2

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!


#3

@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


#4

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.


#5

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!


#6

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.


#7

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?


#8

@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)


#9

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

I am only running this on my development hub.


#10

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.


#11

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


#12

@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!!


#13

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


#14

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.


#15

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


#16

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


#17

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...


#18

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.


#19

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.


[Deprecated] Harmony hub instant status updates using node.js app
#20

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.


[RELEASE] Send IP2IR - Control all of your IR devices from your Dashboard