New Netatmo binding (starting OH 3.3 M5)

Yes, that was the reason. It makes probably sense.
With a thing created with UI, the button is there. There is something to improve with translations:


I will prepare a fix.

Thank you for your work on this binding!

I realised that my problems were self-made so I removed the rest of this message. Nevermind :blush:

Still I can’t get it to work: I always receive the error: „Unexpected error deserializing ‘{“error”:“invalid_grant”}’“. Could this be related to the fact that Netatmo no longer supports a scope „write_doorbell“? I just noticed that when manually creating a grant on their website.

Ok let me try to be more precise: the redirect uri that is generated by the authorisation workflow is not correct. The base url is only reachable from the reverse proxy within my virtual docker network. As far as I understand the code by briefly looking over it this is however a core functionality. I will look into that to check whether there is a way to override this url.

So as the workflow is currently not working for me I tried to modify the url leading to Netatmo that was generated by the authorisation servlet. I can authorise my application and get redirected to OH but I still see the grant authorisation button and the bridge does not come up. So apparently manually editing the url does not do the trick alone.

My third attempt was to create a grant myself in the Netatmo web application where I realised that one the requested grants in the servlet generated url is not available in the web application “write_doorbell”. I created a token for all other required scopes and copied the code into the bridge definition (UI based). But it’s still the same error. I’m not 100% sure if the UI generated token should be usable as refresh token at all, that was just a guess.


2022-06-26 13:20:18.503 [INFO ] [io.openhabcloud.internal.CloudClient] - Connected to the openHAB Cloud service (UUID = 3670caf2-8c59-4941-9bb8-8a3462f84925, base URL = http://localhost:8083)
2022-06-26 13:51:21.445 [ERROR] [st.core.internal.thing.ThingResource] - Exception during HTTP PUT request for update config at 'things/netatmo:account:b4fa6e405a/config'
java.lang.IllegalStateException: Thing with UID netatmo:account:b4fa6e405a has no handler attached.
        at org.openhab.core.thing.internal.ThingRegistryImpl.updateConfiguration(ThingRegistryImpl.java:96) ~[?:?]
        at org.openhab.core.io.rest.core.internal.thing.ThingResource.updateConfiguration(ThingResource.java:498) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
        at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
        at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
        at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
        at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:179) ~[bundleFile:3.4.5]
        at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) ~[bundleFile:3.4.5]
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:201) ~[bundleFile:3.4.5]
        at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:104) ~[bundleFile:3.4.5]
        at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:59) ~[bundleFile:3.4.5]
        at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:96) ~[bundleFile:3.4.5]
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) ~[bundleFile:3.4.5]
        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) ~[bundleFile:3.4.5]
        at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:265) ~[bundleFile:3.4.5]
        at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) ~[bundleFile:3.4.5]
        at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) ~[bundleFile:3.4.5]
        at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) ~[bundleFile:3.4.5]
        at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:225) ~[bundleFile:3.4.5]
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:298) ~[bundleFile:3.4.5]
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPut(AbstractHTTPServlet.java:234) ~[bundleFile:3.4.5]
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:710) ~[bundleFile:3.1.0]
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:273) ~[bundleFile:3.4.5]
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) ~[bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550) ~[bundleFile:9.4.46.v20220331]
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceServletHandler.doHandle(HttpServiceServletHandler.java:74) ~[bundleFile:?]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143) ~[bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600) ~[bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235) ~[bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624) ~[bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233) ~[bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440) ~[bundleFile:9.4.46.v20220331]
        at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doHandle(HttpServiceContext.java:294) ~[bundleFile:?]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188) ~[bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501) ~[bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594) ~[bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186) ~[bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355) ~[bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141) ~[bundleFile:9.4.46.v20220331]
        at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:90) ~[bundleFile:?]
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127) ~[bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.server.Server.handle(Server.java:516) ~[bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487) ~[bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732) [bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479) [bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277) [bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311) [bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105) [bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104) [bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338) [bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315) [bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173) [bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131) [bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409) [bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883) [bundleFile:9.4.46.v20220331]
        at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034) [bundleFile:9.4.46.v20220331]
        at java.lang.Thread.run(Thread.java:829) [?:?]

I see the this error in the logs

Ok I finally managed to get it working: clicked the authorise button and authorised with Netatmo and got redirected to the wrong url. Fixed the url keeping the url parameters from Netatmo and reloaded the page and the bridge thing finally came online :slight_smile:

1 Like

Maybe you could write a small doc part in the binding documentation regarding authorization behind a proxy ? Documentation modifications are easy to do directly from the openhab website :

Yes I can do that as soon as I find the time. Shouldn’t be a lot of work so I think I should manage to do this in the next couple of days.

Hi, did somebody find out how to set up .items file for additonal indoor modules? I found out how to add them in .things, but in .items I fail. In old .items the channel was configured like that:
{channel = “netatmo:NAModule4:netatmo_bridge:insidesupp1:Temperature”}

thanks

I tried to configure the new Netatmo binding and have in the account bridge the communication error
“Unexpected error deserializing '{“error”:“invalid_grant”}”

The parameter should all be valid and correct, what can I do?

Kind regards

Is your OH behind a reverse proxy? Then you might face the same problem that I had (see above).

No, it is not.

Kind regards

I get alway a grant error after a restart or I’m modifying the .things file. then I have to do that:
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).

I have an additional question: What has to be filed in “Redirect Url”?

Just fill in the url that the binding presents you on the authorisation page

Problem is solved. I filed a token in the resp. field, this was wrong. I removed it and again made the
http://:8080/netatmo/connect/<CLIENT_ID>.

Hello,
First of all, thank you for the new binding.
I have two questions about it:

  1. how do I bind a camera stream into a sitemap?
    I get the URL via the channel “Live Stream Local URL” and assign it to an item of type String. In the sitemap, however, video requires a specific URL and I cannot specify an item here.
  2. In the Natatmo app you can control the intensity of the Presence camera light. The Netatmo API also provides access to this. I have not found anything on this in the binding.
    Regards

Hello again.
After a reboot, my Netatmo Account Bridge is offline.
I receive:

**COMMUNICATION_ERROR**
Unexpected error deserializing '{"error":"invalid_request","error_description":"Scope is not identical as the one granted by the user"

Maybe it has to do with the fact that I was already using the Netatmo API and also a Netamo callback function before installing the binding.
But the behaviour is the same whether I use the webhook address https://mypublicopenhaburl or
https://mypublicopenhaburl/mynetatmohook. The latter is the one registered with Netatmo.

You will have to revisit the documentation as all channels etc. were renamed. You did not post the thing configuration, but assuming something like:

Bridge netatmo:account:home "Netatmo API" [ clientId="xxx", clientSecret="yyy", refreshToken="zzz" ] {
        Bridge weather-station indoor [ id="00:00:00:00:00:00" ] {
                indoor insidesupp1 [ id="00:00:00:00:00:01" ]
        }
}

it would be something like this for an indoor module:

{ channel = "netatmo:indoor:home:indoor:insidesupp1:temperature#value" }

Can someone give me assistance in the same matter.
My things are:

UID: netatmo:account:
label: Netatmo Account
thingTypeUID: netatmo:account
configuration:
  reconnectInterval: 300
  clientSecret: 
  clientId: 
  refreshToken:

UID: netatmo:weather-station:
label: Weather Station
thingTypeUID: netatmo:weather-station
configuration:
  id: 
bridgeUID: netatmo:account:


UID: netatmo:outdoor:
label: Outdoor Module
thingTypeUID: netatmo:outdoor
configuration:
  id: 
bridgeUID: netatmo:weather-station:

How would the items look like?

Kind regards

There is currently no way to turn off the auto detection feature of the doorbell, right?

It would be great to disable the auto detection when the entrance door was opened so I don’t get notified of myself bringing the garbage outside :sweat_smile:

Is it possible to have the weather station (with indoor and outdoor module) and a presence/welcome indoor camera?
My weather station is ok, but when I add a presence/welcome indoor camera, it is not correctly recognized (status unknown) and the binding tries to get weather data from the camera

Here is my netatmo.things file:

// Things for netatmo binding.

Bridge netatmo:account:home "Netatmo Account" [ clientId="xxxxxxxxxxx", clientSecret="yyyyyyyyyyyyyyy"] {
    Thing welcome camera "Welcome Camera"   [ id="xx:xx:xx:xx:xx:xx"] { }

    Bridge weather-station inside "Inside Weather Station" [id="yy:yy:yy:yy:yy:yy"] {
        outdoor outside   "Outside Module" [id="zz:zz:zz:zz:zz:zz"] {
        }
    }

}

Any ideas?