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 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 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.
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.
Thanks Dan! Got this set up a little bit ago, everything is working great so far. Will report back if I see any issues.
Hopefully websockets will be around for awhile...although this post makes me question that I wonder what it would take to get XMPP added to Hubitat's list of capabilities.
The initialize method should be called on hub start assuming the driver defines the initialize capability. If that is the case and its still failing, I will take a look
I learn something new all the time. So I just need to add 'capability "initialize"' and it will call the initialize method on reboot. Going to try that now.
@ogiewon, unfortunately this integration was a real disappointment for me. I configured everything and tried to turn on my TV activity. My TV did not come on, all my lights flashed on and off and my Alexa TTS said "your hubitat hub has surpassed your quota of ogiewon apps and driver. Please remove at least 5 of them as soon as possible." I'm just tired of saying thank you, so I wrote the above instead. Great job..as usual..
I have initialise everywhere (which, of course, is the correct way to spell the word!)
Ok.. so now I have to make spelling mistakes in all my apps/drivers