Netatmo sensor hangs

Hi there !

I’m having a bunch of issues with Netatmo lately as well, it looks like Netatmo might have updated their API and the HASS component is not up to date…

+1 on the authentication @cloom outlined, it’d be nice to support oAuth…

Alright, making progress here… I’ve opened an issue with my findings, for those impacted, please have a look and chime in if you have the same symptoms :slight_smile:

Cheers !

It was an issue from my side and not from NetAtmo :slight_smile:

Hi,
I would like to raise it again:
The errors appears, because at that time, no max. min or sum exists.
Isn’t it possible to ignore these errors at that time?
image

I’ll take a look. I’ll change the log level to info for that one.

1 Like

Hi, I tried to build a 7 days rain total.
The statistics sensor is totally ueseless, because all state entries are simply summarized regardless of the circumstance, that the states are either 24 hour totals or 60 minutes totals.
So I tried it with SQL. And now it becomes confusing.
Assuming, that the last state of the 24 Hours sensor should provide the daily total of rain, I was wondering, that a simple sql didn’t deliver accurate results. Looking into the states, the following picture gives some questions:


I checked it by storing the 24-hour sensor state into a variable at 23:59:45. The state for yesterday was 0.2. The entry in the states table delivers at 23:04 ‘unknown’ and 23:09 ‘0’.
Comparing this with the errors mentioned above, taking place around 00:10 it is a little confusing.
The unknown entry is everyday at 23:04 and then there is one more entry with value 0.

In order to get my total I added my variable to the recorder and pointed my sql on this with group by data and order asc. That works. But how can I interprete these state changes?

As far as I understand their API have no accumulated values in the first set of values after midnight. The second accumulated value of the day is 0 except when it rains as they reset the counter. At leasts I don’t know how else to interpret the behaviour.

Agree. But what I do not understand is, that I could store the right state 1.2 on 18th at 23:59.
If it were 0, the last reported state, ok. But I copied 1.2 into my variable.

:crazy_face: :thinking:

My problem is, that it seem to work but I don’t know why. I hate that :slight_smile:
(Like an annoying child)

Hi, I’m getting this error twice a day since two or 3 days:
Error when accessing ‘https://api.netatmo.com/api/getstationsdata
It appears for every entity.
Version 106.5
The complete messaga:

Protokolldetails ( ERROR )
Logger: homeassistant.helpers.entity
First occured: 14:36:06 (4 occurences)
Last logged: 14:37:39

Update for sensor.netatmo_imeerbus121_wind_garten_battery fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 476, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/sensor.py", line 207, in update
    self.netatmo_data.update()
  File "/usr/src/homeassistant/homeassistant/util/__init__.py", line 240, in wrapper
    result = method(*args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/sensor.py", line 530, in update
    self.station_data = self.station_data.__class__(self.auth)
  File "/usr/local/lib/python3.7/site-packages/pyatmo/weather_station.py", line 24, in __init__
    resp = self.authData.post_request(url=self.urlReq)
  File "/usr/local/lib/python3.7/site-packages/pyatmo/auth.py", line 122, in post_request
    raise ApiError(f"Error when accessing '{url}'")
pyatmo.exceptions.ApiError: Error when accessing 'https://api.netatmo.com/api/getstationsdata'

Hi, I already received the message, that oauth will be implemented for the login:


Do you have this under construction?

Don’t worry, we’ve already got you covered.

1 Like

Hi, what do you mean? I am worried because it says that the token will have an expiriation time of 3 hours. It will be make our development account useless :frowning:

No, it won’t. The token will be refreshed automatically. This system is already in place for quite some time.

1 Like