Open Fitzbert-Fitz opened 1 month ago
The 400 bad request is a good lead, but i wonder if the API outputs a content body with a lead to why it is a bad request. If you change the log level to trace, i hope to see some response content. If you provide the log file i might try to fix it.
@lsiepel It seems we have to rewrite the authentication to use OAuth.
When you create an account here and create a thing with the matching credentials, you will see a few times error 429 in the logs (starting from the first request). For a 429 the retry period is certainly too short, but anyways, you will get the 429 already for the first request. After a while your IP seems to get banned, resulting in error 400.
There have been discussions in other threads where some devs from Wolf commented on this: https://github.com/home-assistant/core/issues/104595#issuecomment-1997922669
Introducing OAuth has been done in other libraries as well, see https://github.com/janrothkegel/wolf-comm/commit/9bce287248103671a163655a26463e923f97a1de
Bottomline seems to be: Binding is broken until this is done.
WolfSmartSet Account is failing to authenticate against wolf api. I found following discussions not having any solution: community HomeAssist; they maybe had a related issue?
@BoBiene -> Codeowner
Expected Behavior
Configuring User and Password in Thing Wolf Smartset Account should send the thing online connecting to wolf.
Current Behavior
Authorization failed -> thing offline seeing 400 Bad Request responses from Wolf in the logs (check collapsible below).
debug logs
```2024-10-11 10:21:22.186 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'wolfsmartset:account:c0ea21fc56' changed from OFFLINE (COMMUNICATION_ERROR): Authorization failed to UNINITIALIZED 2024-10-11 10:21:22.192 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'wolfsmartset:account:c0ea21fc56' changed from UNINITIALIZED to UNINITIALIZED (DISABLED) ==> /var/log/openhab/openhab.log <== 2024-10-11 10:29:29.960 [DEBUG] [.WolfSmartsetAccountDiscoveryService] - bundle org.openhab.binding.wolfsmartset:4.2.2 (279)[org.openhab.binding.wolfsmartset.internal.discovery.WolfSmartsetAccountDiscoveryService(402)] : ServiceFactory.getService() 2024-10-11 10:29:29.961 [DEBUG] [.WolfSmartsetAccountDiscoveryService] - bundle org.openhab.binding.wolfsmartset:4.2.2 (279)[org.openhab.binding.wolfsmartset.internal.discovery.WolfSmartsetAccountDiscoveryService(402)] : This thread collected dependencies 2024-10-11 10:29:29.961 [DEBUG] [.WolfSmartsetAccountDiscoveryService] - bundle org.openhab.binding.wolfsmartset:4.2.2 (279)[org.openhab.binding.wolfsmartset.internal.discovery.WolfSmartsetAccountDiscoveryService(402)] : getService (ServiceFactory) dependencies collected. 2024-10-11 10:29:29.962 [DEBUG] [.WolfSmartsetAccountDiscoveryService] - bundle org.openhab.binding.wolfsmartset:4.2.2 (279)[org.openhab.binding.wolfsmartset.internal.discovery.WolfSmartsetAccountDiscoveryService(402)] : Querying state satisfied 2024-10-11 10:29:29.962 [DEBUG] [.WolfSmartsetAccountDiscoveryService] - bundle org.openhab.binding.wolfsmartset:4.2.2 (279)[org.openhab.binding.wolfsmartset.internal.discovery.WolfSmartsetAccountDiscoveryService(402)] : For dependency osgi.ds.satisfying.condition, optional: false; to bind: [[RefPair: ref: [{org.osgi.service.condition.Condition}={service.id=6, service.bundleid=0, service.scope=singleton, service.pid=0.org.osgi.service.condition.ConditionImpl, osgi.condition.id=true}] service: [null]]] 2024-10-11 10:29:29.963 [DEBUG] [.WolfSmartsetAccountDiscoveryService] - bundle org.openhab.binding.wolfsmartset:4.2.2 (279)[org.openhab.binding.wolfsmartset.internal.discovery.WolfSmartsetAccountDiscoveryService(402)] : invoking activate: activate: parameters [org.apache.felix.scr.impl.helper.ReadOnlyDictionary] 2024-10-11 10:29:29.963 [DEBUG] [.WolfSmartsetAccountDiscoveryService] - bundle org.openhab.binding.wolfsmartset:4.2.2 (279)[org.openhab.binding.wolfsmartset.internal.discovery.WolfSmartsetAccountDiscoveryService(402)] : invoked activate: activate 2024-10-11 10:29:29.964 [DEBUG] [.WolfSmartsetAccountDiscoveryService] - bundle org.openhab.binding.wolfsmartset:4.2.2 (279)[org.openhab.binding.wolfsmartset.internal.discovery.WolfSmartsetAccountDiscoveryService(402)] : Changed state from satisfied to active 2024-10-11 10:29:29.965 [DEBUG] [.WolfSmartsetAccountDiscoveryService] - WolfSmartsetDiscovery: Starting background discovery job 2024-10-11 10:29:29.969 [DEBUG] [ler.WolfSmartsetAccountBridgeHandler] - AccountBridge: Initializing 2024-10-11 10:29:29.970 [DEBUG] [ler.WolfSmartsetAccountBridgeHandler] - AccountBridge: System and unit discovery is enabled 2024-10-11 10:29:29.971 [DEBUG] [ler.WolfSmartsetAccountBridgeHandler] - AccountBridge: Scheduling system refresh job ==> /var/log/openhab/events.log <== 2024-10-11 10:29:29.967 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'wolfsmartset:account:c0ea21fc56' changed from UNINITIALIZED (DISABLED) to INITIALIZING 2024-10-11 10:29:29.972 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'wolfsmartset:account:c0ea21fc56' changed from INITIALIZING to OFFLINE (CONFIGURATION_PENDING): Checking authorization ==> /var/log/openhab/openhab.log <== 2024-10-11 10:29:32.972 [DEBUG] [martset.internal.api.WolfSmartsetApi] - Wolf Smartset login with username fitzbert 2024-10-11 10:29:33.041 [DEBUG] [martset.internal.api.WolfSmartsetApi] - Error logging on to Wolf Smartset (0): 400Bad Request 2024-10-11 10:29:33.042 [DEBUG] [martset.internal.api.WolfSmartsetApi] - Wolf Smartset login with username fitzbert 2024-10-11 10:29:33.061 [DEBUG] [martset.internal.api.WolfSmartsetApi] - Error logging on to Wolf Smartset (1): 400Bad Request ==> /var/log/openhab/events.log <== 2024-10-11 10:29:33.043 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'wolfsmartset:account:c0ea21fc56' changed from OFFLINE (CONFIGURATION_PENDING): Checking authorization to OFFLINE (COMMUNICATION_ERROR): Authorization failed ==> /var/log/openhab/openhab.log <== 2024-10-11 10:29:39.966 [DEBUG] [.WolfSmartsetAccountDiscoveryService] - WolfSmartsetDiscovery: Skipping discovery because Account Bridge thing is not ONLINE 2024-10-11 10:29:49.063 [DEBUG] [martset.internal.api.WolfSmartsetApi] - Wolf Smartset login with username fitzbert 2024-10-11 10:29:49.114 [DEBUG] [martset.internal.api.WolfSmartsetApi] - Error logging on to Wolf Smartset (2): 400Bad Request ```Possible Solution
Steps to Reproduce (for Bugs)
create a wolf smartset account create binding WolfSmartSet account with previously created credentials
Context
I can not integrate Wolf devices in OpenHab
Your Environment
Freshly setup openHAB 4.2.2 on RaspberryPi5