tylerrmit / homebridge-coviva-hager

Homebridge plugin for Coviva by Hager (unofficial)
MIT License
3 stars 0 forks source link

Request failed with status code 502 #6

Open eRWN opened 1 year ago

eRWN commented 1 year ago

Hello,

It's more than a year that I use homebridge-coviva-hager and frequently my roller shutters does not respond. Every time I just have to restart Hombridge, it is a bit annoying but it works. But today, even if I had restarted Homebridge they did not respond and in my logs I got this message: [CovivaHagerPlatform] Request failed with status code 502

So I have 2 questions:

Thanks :)

tylerrmit commented 1 year ago

Hi,

502 probably means that your Coviva hub needs to be turned off and on again.

Sometimes the Coviva hub might lose its connection back to Coviva's servers and not recover itself without that restart, and I think I've seen that give me 502s.

If you can control your devices with your official Coviva app, but not with Homekit, then restarting Homebridge or its host should hopefully fix things.

If you can't even control your devices with your official Coviva app, then restarting the Coviva hub should help.

If you still can't control your devices with your official Coviva app after restarting the Coviva hub, it'd probably be some sort of outage on Coviva's own servers, and all you can do is wait it out and try restarting the Coviva hub every now and then. I think I've experienced this once over many years.

I do not currently have any further way to debug issues beyond what has been documented in the readme for the plugin. Somethings stop working for me, too, but generally all my Homebridge devices stop working at the same time, and I don't have any particular evidence of what is going on or whether it is specifically a problem with the Coviva plugin -- I have a lot of different plugins. I set up the "Shortcuts" app on my phone to "Run script over SSH" and then connect to the Raspberry Pi that hosts my Homebridge and issue a "sudo shutdown -r now" to reboot it. So, it's annoying but I move on quickly. At some point I might review the plugin to see if it could be emitting any additional debug messages to show what's going on and prove whether it's ever at fault. But I haven't had the time to spend on it, unfortunately.

tylerrmit commented 1 year ago

The plugin does emit some "debug" level messages if you've started homebridge with the "-D" option. Beware that this would enable debug-level logging for every plugin you're running.

If you're using the Homebridge UI to manage your Homebridge, there's three vertical dots in the top right corner -> Homebridge Settings. Under that there's a "Homebridge Debug Mode" in the "Startup" section.

We don't currently have any Coviva devices where I list support as "experimental". But if you enable the "experimental" flag in the plugin's settings, it will dump every message the plugin receives from Coviva to the log. I don't think that would help you with 502 errors, it just gives more information on the conversation that is happening as part of a good/healthy connection.