Netatmo Binding - Could not parse JSON from URL Error

I tried to run the Netatmo Binding, but I receive an error. I’ve already
updated the version (1.8.0-Snapshot). I’ve checked the Netatmo
credentials more then once. Can someone help me?

2015-12-14 16:47:39.660 [WARN ] [] - Method failed: HTTP/1.1 400 Bad Request
2015-12-14 16:47:39.804 [ERROR] [.service.AbstractActiveService] - Error while executing background thread Netatmo Refresh Service
org.openhab.binding.netatmo.internal.NetatmoException: Could not parse JSON from URL ‘’: {“error”:“invalid_grant”}
at org.openhab.binding.netatmo.internal.messages.AbstractRequest.newException( ~[na:na]
at org.openhab.binding.netatmo.internal.messages.RefreshTokenRequest.execute( ~[na:na]
at org.openhab.binding.netatmo.internal.NetatmoBinding$OAuthCredentials.refreshAccessToken( ~[na:na]
at org.openhab.binding.netatmo.internal.NetatmoBinding.execute( ~[na:na]
at org.openhab.core.binding.AbstractActiveBinding$BindingActiveService.execute( ~[na:na]
at org.openhab.core.service.AbstractActiveService$ ~[na:na]
Caused by: Can not instantiate value of type [simple type, class org.openhab.binding.netatmo.internal.messages.NetatmoError] from JSON String; no single-String constructor/factory method (through reference chain: org.openhab.binding.netatmo.internal.messages.RefreshTokenResponse[“error”])
at ~[na:na]
at ~[na:na]
at ~[na:na]
at ~[na:na]
at ~[na:na]
at$FieldProperty.deserializeAndSet( ~[na:na]
at ~[na:na]
at ~[na:na]
at ~[na:na]
at ~[na:na]
at org.openhab.binding.netatmo.internal.messages.RefreshTokenRequest.execute( ~[na:na]
… 4 common frames omitted

Can you turn on debugging by adding the following to logback.xml, and restarting OH?

<appender name="NETATMOFILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> <file>logs/netatmo.log</file> <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> <fileNamePattern>logs/netatmo-%d{yyyy-ww}</fileNamePattern> <maxHistory>30</maxHistory> </rollingPolicy> <encoder> <pattern>%d{yyyy-MM-dd HH:mm:ss} %-5level %logger{30}[:%line]- %msg%n%ex{5}</pattern> </encoder> </appender> <logger name="org.openhab.binding.netatmo" level="DEBUG" additivity="false"> <appender-ref ref="NETATMOFILE" /> </logger>

This should create a log file called netatmo.log in the logs directory. If you look at the log file, you should see something similar to:

2015-12-15 07:35:21 DEBUG o.o.b.n.i.NetatmoBinding[:763]- Request: RefreshTokenRequest[clientId=xxxxx,clientSecret=yyyyy,refreshToken=zzzzz] 2015-12-15 07:35:21 DEBUG o.o.b.n.i.m.RefreshTokenRequest[:86]- HTTP Post url='' content='grant_type=refresh_token&refresh_token=zzzzz&client_id=xxxxx&client_secret=yyyyy&scope=read_station'

Does the client id, client secret and refresh token match what you see in the config file. If so, what happens if you take the contents from the HTTP post message and try it from the command line:

curl -d 'grant_type=refresh_token&refresh_token=zzzzz&client_id=xxxxx&client_secret=yyyyy&scope=read_station'

you should get something similar to:


If not maybe your refresh token has expired or is wrong, then see what happens if you get a new refresh token by following the instructions at

I’ve reset the Netatmo keys and insert the new keys. Now. everything is working fine. I don’t know why it does not worked the first time.

Thank you Rob for the information about debugging!

1 Like