persandstrom / python-verisure

A python module for reading and changing status of verisure devices through verisure app api.
MIT License
138 stars 42 forks source link

XBN Database is not activated #145

Closed niro1987 closed 2 years ago

niro1987 commented 2 years ago

This is related to the m-api branch

During login, two url's are used, https://m-api01.verisure.com and https://m-api02.verisure.com. The url that is successfull is stored for later use as the base_url. Login is succesfull on https://m-api01.verisure.com but get_installations failed with errorMessage XBN Database is not activated.

Swapping the two login urls fixed it for me but that might not be a sustainable solution. I believe that the request functio should try both urls, as the login does.

hnrkp commented 2 years ago

Well, if you get the "XBN Database is not activated" like this:

[281472425272144] Invalid response, status code: 503 - Data: {"errorGroup":"SERVICE_UNAVAILABLE","errorCode":"SYS_00004","errorMessage":"XBN Database is not activated"}

then that's the api server telling you to switch site since the one you are connected to isn't active. So I would check for the SYS_00004 errorCode and try the other url if that happens. That's what the Verisure app is doing..