Netatmo binding stops fetching data randomly

Tags: #<Tag:0x00007f18618b01c0>

My netatmo binding seems to loose connection randomly and stops fetching data randomly. Netatmo itself seems to work (iphone app loads data OK). Is anyone else experiencing the same? The binding used to work OK and stopped suddenly a couple of weeks ago without me changing anything. Editing the config file helped for a while (2-3 hours) and it stopped again thereafter. no error message in the logs (other than NULL values). what am I doing wrong?

Here are my recent logfiles:
2019-10-25 05:37:17.601 [vent.ItemStateChangedEvent] - Netatmo_Indoor_Temperature changed from 21.8999996185302734375 °C to UNDEF
2019-10-25 05:37:17.643 [vent.ItemStateChangedEvent] - Netatmo_Indoor_Noise changed from 36 dB to UNDEF
2019-10-25 05:37:17.660 [vent.ItemStateChangedEvent] - Netatmo_Indoor_Pressure changed from 1017.29998779296875 hPa to UNDEF
2019-10-25 05:37:17.667 [vent.ItemStateChangedEvent] - Netatmo_Indoor_AbsolutePressure changed from 964.79998779296875 hPa to UNDEF
2019-10-25 05:37:17.675 [vent.ItemStateChangedEvent] - Netatmo_Indoor_Humidity changed from 57 % to UNDEF
2019-10-25 05:37:17.682 [vent.ItemStateChangedEvent] - Netatmo_Indoor_Humidex changed from 24.65 to UNDEF
2019-10-25 05:37:17.689 [vent.ItemStateChangedEvent] - Netatmo_Indoor_HeatIndex changed from 31.89547486046655677682792884297668933868408203125 °C to UNDEF
2019-10-25 05:37:17.696 [vent.ItemStateChangedEvent] - Netatmo_Indoor_Dewpoint changed from 13.00473307429829361581141711212694644927978515625 °C to UNDEF
2019-10-25 05:37:17.707 [vent.ItemStateChangedEvent] - Netatmo_Indoor_DewpointDepression changed from 8.89526654423197982168858288787305355072021484375 °C to UNDEF
2019-10-25 05:37:17.716 [vent.ItemStateChangedEvent] - Netatmo_Indoor_TimeStamp changed from 2019-10-25T01:36:33.000+0200 to UNDEF
2019-10-25 05:37:17.724 [vent.ItemStateChangedEvent] - Netatmo_Outdoor_Temperature changed from 13.3999996185302734375 °C to UNDEF
2019-10-25 05:37:17.726 [vent.ItemStateChangedEvent] - Netatmo_Outdoor_TempTrend changed from NULL to UNDEF
2019-10-25 05:37:17.734 [vent.ItemStateChangedEvent] - Netatmo_Outdoor_Humidity changed from 85 % to UNDEF
2019-10-25 05:37:17.736 [vent.ItemStateChangedEvent] - Netatmo_Outdoor_Humidex changed from 15.10 to UNDEF
2019-10-25 05:37:17.739 [vent.ItemStateChangedEvent] - Netatmo_Outdoor_HeatIndex changed from 53.15974060046219307196224690414965152740478515625 °C to UNDEF
2019-10-25 05:37:17.741 [vent.ItemStateChangedEvent] - Netatmo_Outdoor_Dewpoint changed from 10.933178325163144251064295531250536441802978515625 °C to UNDEF
2019-10-25 05:37:17.744 [vent.ItemStateChangedEvent] - Netatmo_Outdoor_DewpointDepression changed from 2.466821293367129186435704468749463558197021484375 °C to UNDEF
2019-10-25 05:37:17.746 [vent.ItemStateChangedEvent] - Netatmo_Outdoor_TimeStamp changed from 2019-10-25T01:36:31.000+0200 to UNDEF
2019-10-25 05:37:17.749 [vent.ItemStateChangedEvent] - Netatmo_Sleeping_Co2 changed from 812 ppm to UNDEF
2019-10-25 05:37:17.751 [vent.ItemStateChangedEvent] - Netatmo_Sleeping_Temperature changed from 22.299999237060546875 °C to UNDEF
2019-10-25 05:37:17.753 [vent.ItemStateChangedEvent] - Netatmo_Sleeping_Humidity changed from 56 % to UNDEF
2019-10-25 05:37:17.754 [vent.ItemStateChangedEvent] - Netatmo_Sleeping_Humidex changed from 25.11 to UNDEF
2019-10-25 05:37:17.756 [vent.ItemStateChangedEvent] - Netatmo_Sleeping_HeatIndex changed from 31.3239261868124430066018248908221721649169921875 °C to UNDEF
2019-10-25 05:37:17.758 [vent.ItemStateChangedEvent] - Netatmo_Sleeping_Dewpoint changed from 13.1067340017544413655059543089009821414947509765625 °C to UNDEF
2019-10-25 05:37:17.760 [vent.ItemStateChangedEvent] - Netatmo_Sleeping_DewpointDepression changed from 9.1932652353061055094940456910990178585052490234375 °C to UNDEF
2019-10-25 05:37:17.763 [vent.ItemStateChangedEvent] - Netatmo_Sleeping_TimeStamp changed from 2019-10-25T01:36:31.000+0200 to UNDEF

2019-10-25 15:15:08.365 [hingStatusInfoChangedEvent] - ‘netatmo:NAMain:home:inside’ changed from ONLINE to UNINITIALIZED
2019-10-25 15:15:08.444 [hingStatusInfoChangedEvent] - ‘netatmo:NAMain:home:inside’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2019-10-25 15:15:08.449 [hingStatusInfoChangedEvent] - ‘netatmo:NAModule1:home:outside’ changed from ONLINE to UNINITIALIZED
2019-10-25 15:15:08.495 [hingStatusInfoChangedEvent] - ‘netatmo:NAModule1:home:outside’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2019-10-25 15:15:08.499 [hingStatusInfoChangedEvent] - ‘netatmo:NAModule4:home:sleeping’ changed from ONLINE to UNINITIALIZED
2019-10-25 15:15:08.527 [hingStatusInfoChangedEvent] - ‘netatmo:NAModule4:home:sleeping’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2019-10-25 15:15:08.531 [hingStatusInfoChangedEvent] - ‘netatmo:netatmoapi:home’ changed from ONLINE to UNINITIALIZED
2019-10-25 15:15:08.593 [hingStatusInfoChangedEvent] - ‘netatmo:netatmoapi:home’ changed from UNINITIALIZED to UNINITIALIZED (HANDLER_MISSING_ERROR)
2019-10-25 15:15:08.921 [hingStatusInfoChangedEvent] - ‘netatmo:netatmoapi:home’ changed from UNINITIALIZED to INITIALIZING
2019-10-25 15:15:08.957 [hingStatusInfoChangedEvent] - ‘netatmo:NAMain:home:inside’ changed from UNINITIALIZED to UNINITIALIZED (BRIDGE_UNINITIALIZED)
2019-10-25 15:15:08.969 [hingStatusInfoChangedEvent] - ‘netatmo:NAModule1:home:outside’ changed from UNINITIALIZED to UNINITIALIZED (BRIDGE_UNINITIALIZED)
2019-10-25 15:15:08.981 [hingStatusInfoChangedEvent] - ‘netatmo:NAModule4:home:sleeping’ changed from UNINITIALIZED to UNINITIALIZED (BRIDGE_UNINITIALIZED)
2019-10-25 15:15:35.731 [hingStatusInfoChangedEvent] - ‘netatmo:netatmoapi:home’ changed from INITIALIZING to ONLINE
2019-10-25 15:15:35.752 [hingStatusInfoChangedEvent] - ‘netatmo:NAMain:home:inside’ changed from UNINITIALIZED (BRIDGE_UNINITIALIZED) to INITIALIZING
2019-10-25 15:15:35.754 [hingStatusInfoChangedEvent] - ‘netatmo:NAModule4:home:sleeping’ changed from UNINITIALIZED (BRIDGE_UNINITIALIZED) to INITIALIZING
2019-10-25 15:15:35.762 [hingStatusInfoChangedEvent] - ‘netatmo:NAModule1:home:outside’ changed from UNINITIALIZED (BRIDGE_UNINITIALIZED) to INITIALIZING
2019-10-25 15:15:35.806 [hingStatusInfoChangedEvent] - ‘netatmo:NAModule4:home:sleeping’ changed from INITIALIZING to OFFLINE: Pending parent object initialization
2019-10-25 15:15:35.838 [hingStatusInfoChangedEvent] - ‘netatmo:NAMain:home:inside’ changed from INITIALIZING to OFFLINE: Pending parent object initialization
2019-10-25 15:15:35.854 [hingStatusInfoChangedEvent] - ‘netatmo:NAMain:home:inside’ changed from OFFLINE: Pending parent object initialization to ONLINE
2019-10-25 15:15:35.866 [hingStatusInfoChangedEvent] - ‘netatmo:NAModule1:home:outside’ changed from INITIALIZING to OFFLINE: Pending parent object initialization
2019-10-25 15:15:35.920 [vent.ItemStateChangedEvent] - Netatmo_Sleeping_LowBattery changed from OFF to UNDEF
2019-10-25 15:15:35.942 [vent.ItemStateChangedEvent] - Netatmo_Sleeping_RfStatus changed from 2 to UNDEF
2019-10-25 15:15:36.257 [me.event.ThingUpdatedEvent] - Thing ‘netatmo:NAMain:home:inside’ has been updated.
2019-10-25 15:15:36.265 [home.event.InboxAddedEvent] - Discovery Result with UID ‘netatmo:NAMain:home:’ has been added.
2019-10-25 15:15:36.269 [home.event.InboxAddedEvent] - Discovery Result with UID ‘netatmo:NAModule1:home:’ has been added.
2019-10-25 15:15:36.276 [home.event.InboxAddedEvent] - Discovery Result with UID ‘netatmo:NAModule4:home:’ has been added.
2019-10-25 15:15:36.334 [hingStatusInfoChangedEvent] - ‘netatmo:NAModule1:home:outside’ changed from OFFLINE: Pending parent object initialization to ONLINE
2019-10-25 15:15:36.354 [me.event.ThingUpdatedEvent] - Thing ‘netatmo:NAModule1:home:outside’ has been updated.
2019-10-25 15:15:36.403 [hingStatusInfoChangedEvent] - ‘netatmo:NAModule4:home:sleeping’ changed from OFFLINE: Pending parent object initialization to ONLINE
2019-10-25 15:15:36.448 [me.event.ThingUpdatedEvent] - Thing ‘netatmo:NAModule4:home:sleeping’ has been updated.
2019-10-25 15:15:36.537 [vent.ItemStateChangedEvent] - Netatmo_Sleeping_LowBattery changed from UNDEF to OFF
2019-10-25 15:15:36.569 [vent.ItemStateChangedEvent] - Netatmo_Sleeping_RfStatus changed from UNDEF to 2
2019-10-25 16:23:52.227 [vent.ItemStateChangedEvent] - Netatmo_Indoor_Co2 changed from UNDEF to NULL
2019-10-25 16:23:52.242 [vent.ItemStateChangedEvent] - Netatmo_Indoor_Temperature changed from UNDEF to NULL
2019-10-25 16:23:52.262 [vent.ItemStateChangedEvent] - Netatmo_Indoor_Noise changed from UNDEF to NULL
2019-10-25 16:23:52.267 [vent.ItemStateChangedEvent] - Netatmo_Indoor_Pressure changed from UNDEF to NULL
2019-10-25 16:23:52.269 [vent.ItemStateChangedEvent] - Netatmo_Indoor_AbsolutePressure changed from UNDEF to NULL
2019-10-25 16:23:52.271 [vent.ItemStateChangedEvent] - Netatmo_Indoor_Humidity changed from UNDEF to NULL

The Item’s are NULL which indicates it’s not yet initialized but why? Set the log to DEBUG or TRACE for Netatmo binding and see if you get additional info to whats going on.

What version of both OH and binding are you using? What are you running OH on?

Thanks, I’m running openHAB 2.5.0~M3-1 (Milestone Build) on a Raspberry PI (standard install through openhabian and then an upgrade to M3). will check trace logs and post

Same problem here since update zu Milestone m4 yesterday.
Greetings,
Markus

Update to my own post, now using 2.5.0.M4 (upgrade via openhabian-config) and still experiencing the same issue:
openhab> bundle:list|grep -i netatmo
223 x Active x 80 x 2.5.0.M4 x openHAB Add-ons :: Bundles :: Netatmo Binding

Set the log to DEBUG or TRACE for the binding and see if you get any additional info.

tail -fn200 /var/log/openhab2/openhab.log
2019-11-05 11:11:13.752 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Scheduling update channel thread in 30 s
2019-11-05 11:11:43.755 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Data aged of 183090 s
2019-11-05 11:11:43.758 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Trying to update channels on device 70:ee:50:00:10:26
2019-11-05 11:11:43.886 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Successfully updated device 70:ee:50:00:10:26 readings! Now updating channels
2019-11-05 11:11:43.942 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Updating child modules of 70:ee:50:00:10:26
2019-11-05 11:11:43.944 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Updating child module 02:00:00:00:0c:16
2019-11-05 11:11:43.964 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Updating child module 03:00:00:01:50:d8
2019-11-05 11:11:43.980 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - cancel refresh job
2019-11-05 11:11:43.982 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Scheduling update channel thread in 30 s
2019-11-05 11:12:13.984 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Data aged of 183120 s
2019-11-05 11:12:13.988 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Trying to update channels on device 70:ee:50:00:10:26
2019-11-05 11:12:14.104 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Successfully updated device 70:ee:50:00:10:26 readings! Now updating channels
2019-11-05 11:12:14.169 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Updating child modules of 70:ee:50:00:10:26
2019-11-05 11:12:14.172 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Updating child module 02:00:00:00:0c:16
2019-11-05 11:12:14.194 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Updating child module 03:00:00:01:50:d8
2019-11-05 11:12:14.212 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - cancel refresh job
2019-11-05 11:12:14.214 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Scheduling update channel thread in 30 s
2019-11-05 11:12:44.216 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Data aged of 183151 s
2019-11-05 11:12:44.219 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Trying to update channels on device 70:ee:50:00:10:26
2019-11-05 11:12:44.317 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Successfully updated device 70:ee:50:00:10:26 readings! Now updating channels
2019-11-05 11:12:44.391 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Updating child modules of 70:ee:50:00:10:26
2019-11-05 11:12:44.395 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Updating child module 02:00:00:00:0c:16
2019-11-05 11:12:44.430 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Updating child module 03:00:00:01:50:d8
2019-11-05 11:12:44.457 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - cancel refresh job
2019-11-05 11:12:44.459 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Scheduling update channel thread in 30 s
2019-11-05 11:13:14.462 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Data aged of 183181 s
2019-11-05 11:13:14.465 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Trying to update channels on device 70:ee:50:00:10:26
2019-11-05 11:13:14.581 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Successfully updated device 70:ee:50:00:10:26 readings! Now updating channels
2019-11-05 11:13:14.643 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Updating child modules of 70:ee:50:00:10:26
2019-11-05 11:13:14.646 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Updating child module 02:00:00:00:0c:16
2019-11-05 11:13:14.684 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Updating child module 03:00:00:01:50:d8
2019-11-05 11:13:14.703 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - cancel refresh job
2019-11-05 11:13:14.705 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Scheduling update channel thread in 30 s

finally an error occured
2019-11-05 14:32:54.854 [ERROR] [nternal.handler.NetatmoDeviceHandler] - Unable to connect Netatmo API : 502 Bad Gateway
retrofit.RetrofitError: 502 Bad Gateway
at retrofit.RetrofitError.httpError(RetrofitError.java:40) ~[?:?]
at retrofit.RestAdapter$RestHandler.invokeRequest(RestAdapter.java:388) ~[?:?]
at retrofit.RestAdapter$RestHandler.invoke(RestAdapter.java:240) ~[?:?]
at com.sun.proxy.$Proxy181.getstationsdata(Unknown Source) ~[?:?]
at org.openhab.binding.netatmo.internal.handler.NetatmoBridgeHandler.getStationsDataBody(NetatmoBridgeHandler.java:255) ~[?:?]
at org.openhab.binding.netatmo.internal.station.NAMainHandler.updateReadings(NAMainHandler.java:43) ~[?:?]
at org.openhab.binding.netatmo.internal.station.NAMainHandler.updateReadings(NAMainHandler.java:1) ~[?:?]
at org.openhab.binding.netatmo.internal.handler.NetatmoDeviceHandler.updateChannels(NetatmoDeviceHandler.java:121) ~[?:?]
at org.openhab.binding.netatmo.internal.handler.NetatmoDeviceHandler.lambda$0(NetatmoDeviceHandler.java:86) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
2019-11-05 14:32:54.934 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Failed to update device 70:ee:50:00:10:26 readings! Skip updating channels

==> /var/log/openhab2/events.log <==
2019-11-05 14:32:54.935 [hingStatusInfoChangedEvent] - ‘netatmo:NAMain:home:inside’ changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Unable to connect Netatmo API : 502 Bad Gateway

==> /var/log/openhab2/openhab.log <==
2019-11-05 14:32:54.980 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Updating child modules of 70:ee:50:00:10:26
2019-11-05 14:32:54.982 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - cancel refresh job
2019-11-05 14:32:54.984 [DEBUG] [nternal.handler.NetatmoDeviceHandler] - Scheduling update channel thread in 30 s

Looks like that may be the issue. Now how to fix? Maybe down grade to a previous version of OH or check github for open issues. If no issue then you may want to open one.

My problem is solved by reinstalling a backup.
Downgradeing M4 to M3 to 2.4.0 doesn’t brings it back. After installing the backup it run’ s directly without problems.
Greetings.