Sometimes (possibly when the IP address changes when Domoticz is still runing), the cloud rejects any further messages with HTTP code 401 (Unauthorized). Note that this is a different response than the one in the LOGIN sequence. I suppose melcloud locks the key to the IP address and thus invalidates the key if it is used by another IP address. This could be a problem for users with dynamic IP addresses or (as in my case) dual-homed with more than one internet connection.
Note that the key gets invalidated and doesn't work anymore, even if the IP address is returned back to the previous one.
Suggestion:
add elif (Status == 401): and a proper handling of this situation (may be the same as on disconnect)
Sometimes (possibly when the IP address changes when Domoticz is still runing), the cloud rejects any further messages with HTTP code 401 (Unauthorized). Note that this is a different response than the one in the LOGIN sequence. I suppose melcloud locks the key to the IP address and thus invalidates the key if it is used by another IP address. This could be a problem for users with dynamic IP addresses or (as in my case) dual-homed with more than one internet connection.
Note that the key gets invalidated and doesn't work anymore, even if the IP address is returned back to the previous one.
Suggestion:
add elif (Status == 401): and a proper handling of this situation (may be the same as on disconnect)