Netatmo just stops delivering data

The problem with my netatmo binding is, that it stops getting data from the api.netatmo.com after a random amount of time. If I restart the binding, it works for 30min up to 10 hours, but then it stops again. I tried the DEBUG log:level and get some output which is not really clear for me.

Every 10min the binding asks at api.netatmo.com for data. Usually it looks like this (extract from /var/log/daemon.log)

Jan 27 12:09:36 openHABianPi karaf[23580]: ---> HTTP GET https://api.netatmo.net/api/getstationsdata?device_id=70%3Aee%3A50%3A03%3A6e%3A7a
Jan 27 12:09:36 openHABianPi karaf[23580]: ---> END HTTP (no body)
Jan 27 12:09:37 openHABianPi karaf[23580]: <--- HTTP 200 https://api.netatmo.net/api/getstationsdata?device_id=70%3Aee%3A50%3A03%3A6e%3A7a (469ms)
Jan 27 12:09:37 openHABianPi karaf[23580]: Server: nginx
Jan 27 12:09:37 openHABianPi karaf[23580]: Date: Sat, 27 Jan 2018 11:09:37 GMT
Jan 27 12:09:37 openHABianPi karaf[23580]: Content-Type: application/json; charset=utf-8
Jan 27 12:09:37 openHABianPi karaf[23580]: Transfer-Encoding: chunked
Jan 27 12:09:37 openHABianPi karaf[23580]: Connection: keep-alive
Jan 27 12:09:37 openHABianPi karaf[23580]: Cache-Control: no-cache, must-revalidate
Jan 27 12:09:37 openHABianPi karaf[23580]: Expires: 0
Jan 27 12:09:37 openHABianPi karaf[23580]: X-XSS-Protection: 1; mode=block
Jan 27 12:09:37 openHABianPi karaf[23580]: Access-Control-Allow-Origin: *
Jan 27 12:09:37 openHABianPi karaf[23580]: Strict-Transport-Security: max-age=10886400; includeSubDomains
Jan 27 12:09:37 openHABianPi karaf[23580]: X-Powered-By: Netatmo
Jan 27 12:09:37 openHABianPi karaf[23580]: OkHttp-Selected-Protocol: http/1.1
Jan 27 12:09:37 openHABianPi karaf[23580]: OkHttp-Sent-Millis: 1517051377224
Jan 27 12:09:37 openHABianPi karaf[23580]: OkHttp-Received-Millis: 1517051377434
Jan 27 12:09:37 openHABianPi karaf[23580]: {"body":{"devices":[{"_id":"70:ee:50:03:6e:7a","cipher_id":"enc:16:vHjFpXEeYxEu4n8lICd4VVrU7hOLgK1NQ03BNtm7R+sGrfh38os5GboD8bMSlqul","last_status_store":1517051353,"modules":[{"_id":"02:00:00:03:76:34","type":"NAModule1","last_message":1517051349,"last_seen":1517051349,"dashboard_data":{"time_utc":1517051298,"Temperature":5.9,"temp_trend":"up","Humidity":93,"date_max_temp":1517050991,"date_min_temp":1517018490,"min_temp":3.9,"max_temp":5.9},"data_type":["Temperature","Humidity"],"module_name":"Au\u00dfen","last_setup":1404917719,"battery_vp":5296,"battery_percent":71,"rf_status":63,"firmware":44},{"_id":"05:00:00:00:4a:80","type":"NAModule3","last_message":1517051350,"last_seen":1517051350,"dashboard_data":{"time_utc":1517051337,"Rain":0,"sum_rain_24":0,"sum_rain_1":0},"data_type":["Rain"],"module_name":"Regen","last_setup":1405003549,"battery_vp":5836,"battery_percent":93,"rf_status":63,"firmware":8},{"_id":"03:00:00:01:17:80","type":"NAModule4","last_message":1517051350,"last_seen":1517051330,"dashboard_data":{"time_utc":1517051330,"Temperature":21.5,"temp_trend":"stable","Humidity":41,"CO2":658,"date_max_temp":1517011858,"date_min_temp":1517028108,"min_temp":21.1,"max_temp":21.6},"data_type":["Temperature","CO2","Humidity"],"module_name":"Wohnzimmer","last_setup":1406047102,"battery_vp":6218,"battery_percent":100,"rf_status":76,"firmware":44},{"_id":"03:00:00:01:24:44","type":"NAModule4","last_message":1517051350,"last_seen":1517051343,"dashboard_data":{"time_utc":1517051292,"Temperature":20.2,"temp_trend":"stable","Humidity":46,"CO2":655,"date_max_temp":1517014895,"date_min_temp":1517007667,"min_temp":20.2,"max_temp":20.4},"data_type":["Temperature","CO2","Humidity"],"module_name":"Patrick","last_setup":1406047423,"battery_vp":4689,"battery_percent":27,"rf_status":66,"firmware":44},{"_id":"03:00:00:01:6c:bc","type":"NAModule4","last_message":1517051350,"last_seen":1517051343,"dashboard_data":{"time_utc":1517051292,"Temperature":19.9,"temp_trend":"stable","Humidity":47,"CO2":676,"date_max_temp":1517024531,"dat
Jan 27 12:09:37 openHABianPi karaf[23580]: e_min_temp":1517007667,"min_temp":19.5,"max_temp":20.4},"data_type":["Temperature","CO2","Humidity"],"module_name":"Schlafzimmer","last_setup":1419093375,"battery_vp":5270,"battery_percent":59,"rf_status":55,"firmware":44}],"place":{"altitude":36,"city":"Hamburg","country":"DE","timezone":"Europe\/Berlin","location":[10.1343,53.66096]},"station_name":"Lindenpalais","type":"NAMain","dashboard_data":{"AbsolutePressure":1024.5,"time_utc":1517051338,"Noise":33,"Temperature":19.9,"temp_trend":"stable","Humidity":56,"Pressure":1028.8,"pressure_trend":"up","CO2":713,"date_max_temp":1517044416,"date_min_temp":1517007675,"min_temp":19.8,"max_temp":20.2},"data_type":["Temperature","CO2","Humidity","Noise","Pressure"],"co2_calibrating":false,"date_setup":1404917359,"last_setup":1404917359,"module_name":"B\u00fcro","firmware":132,"last_upgrade":1440092625,"wifi_status":69,"friend_users":["53bd8f761977591844d947c6","53d7bb6d197759f13aa1ce34"]}],"user":{"mail":"netatmo@stefandanz.de","administrative":{"country":"DE","reg_locale":"de-DE","lang":"de-DE","unit":0,"windunit":0,"pressureunit":0,"feel_like_algo":0}}},"status":"ok","time_exec":0.078970909118652,"time_server":1517051377}
Jan 27 12:09:37 openHABianPi karaf[23580]: <--- END HTTP (3232-byte body)

but after an unknown amount of tries, it comes up with this:

Jan 27 12:19:42 openHABianPi karaf[23580]: ---> HTTP GET https://api.netatmo.net/api/getstationsdata?device_id=70%3Aee%3A50%3A03%3A6e%3A7a
Jan 27 12:19:42 openHABianPi karaf[23580]: ---> END HTTP (no body)
Jan 27 12:19:42 openHABianPi karaf[23580]: ---- ERROR https://api.netatmo.net/api/getstationsdata?device_id=70%3Aee%3A50%3A03%3A6e%3A7a
Jan 27 12:19:42 openHABianPi karaf[23580]: java.net.UnknownHostException: api.netatmo.net: Temporärer Fehler bei der Namensauflösung
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:928)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1323)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at java.net.InetAddress.getAllByName0(InetAddress.java:1276)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at java.net.InetAddress.getAllByName(InetAddress.java:1192)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at java.net.InetAddress.getAllByName(InetAddress.java:1126)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at com.squareup.okhttp.internal.Network$1.resolveInetAddresses(Network.java:29)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at com.squareup.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:224)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at com.squareup.okhttp.internal.http.RouteSelector.nextProxy(RouteSelector.java:193)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at com.squareup.okhttp.internal.http.RouteSelector.next(RouteSelector.java:113)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at com.squareup.okhttp.internal.http.HttpEngine.createNextConnection(HttpEngine.java:344)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at com.squareup.okhttp.internal.http.HttpEngine.nextConnection(HttpEngine.java:329)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at com.squareup.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:319)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at com.squareup.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:241)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at com.squareup.okhttp.Call.getResponse(Call.java:271)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:228)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at io.swagger.client.auth.OAuth.intercept(OAuth.java:108)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at com.squareup.okhttp.Call$ApplicationInterceptorChain.proceed(Call.java:225)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at com.squareup.okhttp.Call.getResponseWithInterceptorChain(Call.java:199)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at com.squareup.okhttp.Call.execute(Call.java:79)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at retrofit.client.OkClient.execute(OkClient.java:53)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:326)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:240)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at com.sun.proxy.$Proxy171.getstationsdata(Unknown Source)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at org.openhab.binding.netatmo.handler.NetatmoBridgeHandler.getStationsDataBody(NetatmoBridgeHandler.java:233)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at org.openhab.binding.netatmo.internal.station.NAMainHandler.updateReadings(NAMainHandler.java:42)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at org.openhab.binding.netatmo.internal.station.NAMainHandler.updateReadings(NAMainHandler.java:1)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at org.openhab.binding.netatmo.handler.NetatmoDeviceHandler.updateChannels(NetatmoDeviceHandler.java:108)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at org.openhab.binding.netatmo.handler.NetatmoDeviceHandler.lambda$0(NetatmoDeviceHandler.java:82)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at java.util.concurrent.FutureTask.run(FutureTask.java:266)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
Jan 27 12:19:42 openHABianPi karaf[23580]: #011at java.lang.Thread.run(Thread.java:748)
Jan 27 12:19:42 openHABianPi karaf[23580]: ---- END ERROR

almost an hour later:

Jan 27 13:11:10 openHABianPi karaf[23580]: ---> HTTP GET https://api.netatmo.net/api/partnerdevices
Jan 27 13:11:10 openHABianPi karaf[23580]: ---> END HTTP (no body)
Jan 27 13:11:14 openHABianPi karaf[23580]: <--- HTTP 404 https://api.netatmo.net/api/partnerdevices (3827ms)
Jan 27 13:11:14 openHABianPi karaf[23580]: Server: nginx
Jan 27 13:11:14 openHABianPi karaf[23580]: Date: Sat, 27 Jan 2018 12:11:14 GMT
Jan 27 13:11:14 openHABianPi karaf[23580]: Content-Type: application/json; charset=utf-8
Jan 27 13:11:14 openHABianPi karaf[23580]: Transfer-Encoding: chunked
Jan 27 13:11:14 openHABianPi karaf[23580]: Connection: keep-alive
Jan 27 13:11:14 openHABianPi karaf[23580]: Cache-Control: no-cache, must-revalidate
Jan 27 13:11:14 openHABianPi karaf[23580]: Expires: 0
Jan 27 13:11:14 openHABianPi karaf[23580]: X-XSS-Protection: 1; mode=block
Jan 27 13:11:14 openHABianPi karaf[23580]: Access-Control-Allow-Origin: *
Jan 27 13:11:14 openHABianPi karaf[23580]: Strict-Transport-Security: max-age=10886400; includeSubDomains
Jan 27 13:11:14 openHABianPi karaf[23580]: X-Powered-By: Netatmo
Jan 27 13:11:14 openHABianPi karaf[23580]: OkHttp-Selected-Protocol: http/1.1
Jan 27 13:11:14 openHABianPi karaf[23580]: OkHttp-Sent-Millis: 1517055074260
Jan 27 13:11:14 openHABianPi karaf[23580]: OkHttp-Received-Millis: 1517055074433
Jan 27 13:11:14 openHABianPi karaf[23580]: {"error":{"code":31,"message":"No devices."}}
Jan 27 13:11:14 openHABianPi karaf[23580]: <--- END HTTP (45-byte body)

and this is the last output from the binding. it does not try again. So I need to restart the binding to get answers again. But anyway: it will stop again. This is now the case for at least a week, when I switched to openhabian 1.4. So I guess, it is some kind of network/dns issue…entries in /etc/hosts ?
I am using a fritz.box to connect to the internet…

Any help appreciated :slight_smile:

Hi Stefan,

Thanks for reporting this very helpful information. We already have an issue. Your logs are the best shot on what could be the root problem. May I ask you to report this in the issue?

Hi Christoph,

I reported it in the issue. I hope it is all correct…

Best regards
Stefan

Thank you. I hope we can provide a fix for it soon.

1 Like

All,

I added some more logging to the binding and did a litte rework on the scheduler for the refresh job. If you uninstall the binding you can unzip the jar from the link and put the jar (which is inside the zip) in your addons folder, it will then automatically be installed. If you enable debug logging I hope that we have enough now to resolve the problems.

Hi Christoph,

Did you manage to find the issues causing the data to stop refreshing? Is there any data I can provide to assist you?

Hi Tim,

Thanks for offering your help. The bug is fixed. You can test with the current snapshot version.

Hi Christoph,

I am on the current snapshot version. However the data is freezing. I noticed as soon as I upgraded from the Netatmo 1 binding to this binding.

As soon as I reboot openhab then the data is refreshed but only for a short random period.

Pitty. Can you tell me your OH2/binding version? May I ask you to activate DEBUG logging for the Netatmo binding? I added some log messages to track down that problem in detail. What does it show before it stops delivering data?

Hi Christoph,
as a thermostat owner I’m a long time user of this binding. Unfortunately in the latest version the setting for refresh time for thermostat is fixed to one hour. Can you please introduce again the possibility to change this setting, please?

I too have been having these problems since upgrading to 2.2. Just updated to 2.3 and the problems still persist. After a while the binding just stops receiving data. Bundle:restart clears it for a while. My Pi is on WiFi.

Mikael

This was fixed few months ago and it never happened for me after this fix for weather data.
What data are not refreshed in your case ?

I’m seeing it for outdoor temperature and outdoor humidity. Pretty much the only values I’m grabbing…

First check your values are displayed on the netatmo app, that is your module is in the RF range of your main module. Sometimes mine lost connection.

The device is fine, data is delivered consistently. I did a reinstall of the binding the other day and full system reboot. It has been up since, hopefully it stays.

I have the same issue. I tried reinstalling a few days ago… unfortunately no effect… netatmo stops updating data after some hours… I’m on 2.3… I’m observing this issue at least since christmas 17.
do I have to keep a special uninstall and install sequence to get rid all of the faulty elements?
Thanks for advice.

Jan

For whatever reason the reinstall of the binding and/or restart of the system did the trick for me, it’s been rock solid ever since.

Would reinstalling the binding require to reinstall all items as well? (from PaperUI that is)

I didn’t. I just uninstalled the binding and reinstalled it from PaperUI. No touching items or things.

Okay, will give it a try then, cause netamo seems to be doing the same missing updates here as well.