I cannot add a bridge (Netatmo Account). I created an app and entered the credentials (ClientID, Client Secret, UserID and pwd), but I get the following in the log:
2022-05-18 19:43:16.766 [DEBUG] [mo.internal.handler.ApiBridgeHandler] - Initializing Netatmo API bridge handler.
2022-05-18 19:43:16.767 [DEBUG] [mo.internal.handler.ApiBridgeHandler] - Connecting to Netatmo API.
2022-05-18 19:43:16.768 [TRACE] [mo.internal.handler.ApiBridgeHandler] - executeUri POST https://api.netatmo.com/oauth2/token
2022-05-18 19:43:17.328 [TRACE] [mo.internal.handler.ApiBridgeHandler] - executeUri returned : code [400 Bad Request] body {"error":"invalid_grant"}
I guess without the webhook, a direct connection from the netatmo server to the OpenHAB server is not required.
Therefore my next question:
Which URL is used for the webhook, because I can add a config to the nginx proxy and allow unauthenticated access on a specific URL to allow the webhook connect to my instance. https://my.public.url:9443/ ???
And yes, I’m sure about the id/secret/username/password.
But I have already one app defined in the “My Apps” section, which I use for the webhook (Netatmo Doorbell) over the “httpListener” Binding:
Then I defined a second app for the Netatmo binding (same username/pwd, different id/secret).
Then I created a new Thing in OH from the Netatmo binding (Netatmo Account) where I use these credentials.
Added:
Just saw the latest version of the docs on Netatmo - Bindings | openHAB I’m guessing the authorization process is about to be changed in M6? No more user/pass. So I guess I’ll wait a bit.
I’ve just installed v3.3.0.M5 of the Netatmo binding and I cannot get it to start. After the command to start in openhab-console the binding is always waiting and an error is logged:
299 x Waiting x 80 x 3.3.0.M5 x org.openhab.binding.netatmo
2022-06-01 18:39:41.229 [WARN ] [ore.thing.internal.ThingRegistryImpl] - bundle org.openhab.core.thing:3.2.0 (212)[org.openhab.core.thing.internal.ThingRegistryImpl(247)] : Could not get service from ref {org.openhab.core.thing.binding.ThingHandlerFactory}={backgroundDiscovery=true, service.id=1994, service.bundleid=299, service.scope=bundle, service.pid=binding.netatmo, component.name=org.openhab.binding.netatmo.internal.NetatmoHandlerFactory, component.id=402}
2022-06-01 18:39:41.230 [WARN ] [ore.thing.internal.ThingRegistryImpl] - bundle org.openhab.core.thing:3.2.0 (212)[org.openhab.core.thing.internal.ThingRegistryImpl(247)] : DependencyManager : invokeBindMethod : Service not available from service registry for ServiceReference {org.openhab.core.thing.binding.ThingHandlerFactory}={backgroundDiscovery=true, service.id=1994, service.bundleid=299, service.scope=bundle, service.pid=binding.netatmo, component.name=org.openhab.binding.netatmo.internal.NetatmoHandlerFactory, component.id=402} for reference ThingHandlerFactory
I used the following command to install the binding:
5. Go to the authorization page of your server. http://<your openHAB address>:8080/netatmo/connect/<_CLIENT_ID_>. Your newly added bridge should be listed there (no need for you to expose your openHAB server outside your local network for this).
When I enter the Client ID and the IP of my OH server, it page doesn’t exist.
Sorry
Requested content not found.
I guess its not an issue that I use a different port - 8192 instead 8080.
I have not tested recently as it works perfectly in my case.
You should see at binding startup a log entry of this kind: Registered Netatmo servlet at xxxxxxx
It should help you to understand what is the path to use to access the special page.
As mentioned, I used 3.3.0M5 for some weeks and everything worked well. I didn’t use username/password but the new format, using the ClientID and ClientSecret.
This worked for me with M5, but suddenly stopped working once I upgraded to 3.3.0M6.
Does this trace helps?
2022-06-06 22:31:37.938 [DEBUG] [mo.internal.handler.ApiBridgeHandler] - Initializing Netatmo API bridge handler.
2022-06-06 22:31:37.939 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'netatmo:account:7814b6f340' changed from INITIALIZING to UNKNOWN
2022-06-06 22:31:37.939 [DEBUG] [mo.internal.handler.ApiBridgeHandler] - Connecting to Netatmo API.
2022-06-06 22:31:38.174 [TRACE] [mo.internal.handler.ApiBridgeHandler] - executeUri POST https://api.netatmo.com/oauth2/token
2022-06-06 22:31:38.264 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'netatmo:account:7814b6f340' changed from UNKNOWN to OFFLINE (COMMUNICATION_ERROR): Unexpected error deserializing '{"error":"invalid_grant"}'
2022-06-06 22:31:41.740 [DEBUG] [mo.internal.handler.ApiBridgeHandler] - Shutting down Netatmo API bridge handler.
2022-06-06 22:31:41.740 [DEBUG] [mo.internal.handler.ApiBridgeHandler] - Initializing Netatmo API bridge handler.
2022-06-06 22:31:41.740 [DEBUG] [mo.internal.handler.ApiBridgeHandler] - Connecting to Netatmo API.