That's what I'm thinking. I'm currently doing a port of the ST KuKuHarmony project to read status (and enable individual device control) using the Harmony API project.
However, I LOVE your approach for activities as it doesn't require the nodejs app and all that. I'm thinking that your app code could be enhanced with the XMPP features. That would get around Logitech locking down the WS interface.
As long as the webSockets interface is not blocked by Logitech, you could simply extend the capabilities of my existing code to allow individual device control. The interface supports it. However, my focus was simply on Activities. Please feel free to enhance it with pull requests.
Ok. This looks like it's an issue in the 4.15.250 firmware that Logitech rolled out. I'm seeing grumblings from other platforms (Homebridge, HomeAssistant, OpenHAB, etc) regarding websockets being unavailable. I've been looking around the net trying to figure out exactly what Logitech changed and it looks like something in the headers, but I can't pinpoint what exactly.
So, if you haven't updated your firmware to 4.15.250, don't do it yet as it will kill your websockets interface.
That's what I am thinking. What happens is that the code that fails is looking for the remote id in the initialize() function. initialize() is only called when the app is installed or updated. I'm pretty certain that if @destructure00 removes the app code and then recreates it (or just calls the initialize() function from the device page), it will fail the same way ours is due to whatever Logitech did in the latest update.
I can confirm that my 2 Harmony Hubs, that updated to the latest firmware this week, are still running this driver OK. Looks like I don't want to go anywhere near the initialise button.
Initialize is called every time your hub restarts. Fortunately, the Initialize function does not attempt to rediscover the remoteId if it has already done so successfully. So, for existing users, you're safe as long as you don't remove the device. For new users, we'll need to figure out how to discover the remoteID.
My GitHub repo has been updated, but I cannot test currently. I would also like to make the code work for both versions of Harmony Hub firmware, but that will take a little more time to deal with the error handling. Maybe tonight or later this week.
I'd offer to test, but all three of mine are updated (ugh). However, I think a try/catch around the initialize() httpPost OR catching the response code into a variable should suffice. I was getting a response code of 417 before the fix, so maybe have 4 variables at the beginning of the function and toggle between them depending on the response code?
Yes, this is what I was thinking as well. Just try/catch the new method, if is doesn't work, then try/catch the old method. If one of them works sucessfully, then move on without throwing any errors. If neither works, then log an error to the live logs to help troubleshoot in the future (when Logitech break things again.)