Netatmo update interval drifts away

On my openHAB 4.1.1 system the Netatmo weather station update interval is drifting.
It is not in sync with ~10min interval.
I am no sure when this has started. At least it was not with 4.0.x

The logs look like:

2024-02-16 08:00:10.682 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T07:49:50.000+0100 to 2024-02-16T07:59:55.000+0100
2024-02-16 08:10:15.903 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T07:59:55.000+0100 to 2024-02-16T08:10:01.000+0100
2024-02-16 08:20:21.239 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T08:10:01.000+0100 to 2024-02-16T08:20:07.000+0100
2024-02-16 08:30:26.546 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T08:20:07.000+0100 to 2024-02-16T08:30:13.000+0100
2024-02-16 08:40:31.812 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T08:30:13.000+0100 to 2024-02-16T08:40:19.000+0100
2024-02-16 08:50:37.052 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T08:40:19.000+0100 to 2024-02-16T08:50:24.000+0100
2024-02-16 09:00:42.752 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T08:50:24.000+0100 to 2024-02-16T09:00:31.000+0100
2024-02-16 09:10:48.023 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T09:00:31.000+0100 to 2024-02-16T09:10:36.000+0100
2024-02-16 09:20:53.358 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T09:10:36.000+0100 to 2024-02-16T09:20:43.000+0100
2024-02-16 09:30:58.924 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T09:20:43.000+0100 to 2024-02-16T09:30:49.000+0100
2024-02-16 09:41:05.241 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T09:30:49.000+0100 to 2024-02-16T09:40:57.000+0100
2024-02-16 09:51:10.475 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T09:40:57.000+0100 to 2024-02-16T09:51:04.000+0100
2024-02-16 10:01:15.767 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T09:51:04.000+0100 to 2024-02-16T10:01:09.000+0100
2024-02-16 10:11:21.010 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T10:01:09.000+0100 to 2024-02-16T10:11:13.000+0100
2024-02-16 10:21:26.225 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T10:11:13.000+0100 to 2024-02-16T10:21:19.000+0100
2024-02-16 10:31:31.472 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T10:21:19.000+0100 to 2024-02-16T10:31:24.000+0100
2024-02-16 10:41:36.786 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T10:31:24.000+0100 to 2024-02-16T10:41:29.000+0100
2024-02-16 10:51:42.501 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T10:41:29.000+0100 to 2024-02-16T10:51:33.000+0100
2024-02-16 11:01:47.715 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T10:51:33.000+0100 to 2024-02-16T11:01:38.000+0100
2024-02-16 11:11:53.021 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T11:01:38.000+0100 to 2024-02-16T11:11:45.000+0100
2024-02-16 11:21:58.248 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T11:11:45.000+0100 to 2024-02-16T11:21:49.000+0100
2024-02-16 11:42:08.801 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T11:21:49.000+0100 to 2024-02-16T11:42:02.000+0100
2024-02-16 11:52:14.075 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T11:42:02.000+0100 to 2024-02-16T11:52:09.000+0100
2024-02-16 12:12:24.536 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T11:52:09.000+0100 to 2024-02-16T12:12:18.000+0100
2024-02-16 12:32:35.089 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T12:12:18.000+0100 to 2024-02-16T12:22:26.000+0100
2024-02-16 12:42:40.479 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T12:22:26.000+0100 to 2024-02-16T12:32:33.000+0100
2024-02-16 12:52:45.676 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T12:32:33.000+0100 to 2024-02-16T12:42:41.000+0100
2024-02-16 13:02:50.929 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T12:42:41.000+0100 to 2024-02-16T12:52:46.000+0100
2024-02-16 13:12:56.197 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T12:52:46.000+0100 to 2024-02-16T13:02:51.000+0100
2024-02-16 13:23:01.400 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T13:02:51.000+0100 to 2024-02-16T13:12:57.000+0100
2024-02-16 13:33:06.700 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T13:12:57.000+0100 to 2024-02-16T13:23:04.000+0100
2024-02-16 13:43:11.929 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T13:23:04.000+0100 to 2024-02-16T13:33:09.000+0100
2024-02-16 13:53:17.329 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T13:33:09.000+0100 to 2024-02-16T13:43:13.000+0100
2024-02-16 14:03:22.606 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Indoor_TimeStamp' changed from 2024-02-16T13:43:13.000+0100 to 2024-02-16T13:53:19.000+0100

see 2024-02-16 12:32:35.089
Is there something that I can do to fix this?

Probably not. I wouldn’t worry about it. Very often the OH scheduler in a binding will schedule the next task to start a certain time interval after a prior task has COMPLETED, so if the task takes a certain time to run, the subsequent task will will start after the interval plus the task run time.

Of course I do worry. Up to 20 min old co2 data is unusable for me. If you have to manually open a window to get fresh air (no HVAC) instant data is very helpful. Specially if you can’t leave an open window unguarded.

It seems that the new code calculate the time between two updates only once. It never adjust the interval again. In the past this interval was not fixed and calculated every time.

I dont know the Netatmo binding. But you should check if it has a config param where you could set a shorter polling interval.

IMHO the actual polling interval has nothing to do with your OP concerning the drift thereof…

EDIT: perhaps this ‘reconnectInterval’ Netatmo - Bindings | openHAB – but even if you are able to use that to set a shorter interval, it will still drift as I have explained before…

EDIT: perhaps your OP was not really concerning the 8…10 seconds drift between the 10 minute polls? But rather that some of those polls (at 10 minute + ca 8…10 seconds drift) are being ommitted entirely? In which case you should probably have asked a different question than you did…

It seems I cant’ explain it properly
I’ll try again with a drawing.

This is a timeline
D: This is when the API provides new data
R: This is when the binding fetches the data

Expected behavior:

----D------------D------------D------------D---
-----R------------R------------R------------R--

Current behavior after some hours:

----D------------D------------D------------D---
-R------------R------------R------------R------

Most of the time I get old data.

Did you try halving the ‘reconnectInterval’?

Can you please file an issue?

Thanks to @glhopital and @laursen for creating and testing a fix.
It was a pleasure to follow your collaboration on Github.

I have installed the backported jar which was provided here: Netatmo bridge offline 99% of time - #19 by laursen
And it works without any issue.
Thank you.

2 Likes