Netatmo in HA 0.105

Maybe it’s the best thing to do at the moment

Seems that new integration needs to be restarted some times to get the “luck” to have all camera available. As it was used to do some version ago the old integration…maybe it’s just a matter to let the platform wait more time than usual because sometimes cameras have delays.

Below my log, if it helps:

netatmo: Error on device update!
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 421, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 416, in _make_request
    httplib_response = conn.getresponse()
  File "/usr/local/lib/python3.7/http/client.py", line 1344, in getresponse
    response.begin()
  File "/usr/local/lib/python3.7/http/client.py", line 306, in begin
    version, status, reason = self._read_status()
  File "/usr/local/lib/python3.7/http/client.py", line 267, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/usr/local/lib/python3.7/socket.py", line 589, in readinto
    return self._sock.recv_into(b)
  File "/usr/local/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py", line 326, in recv_into
    raise timeout("The read operation timed out")
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 400, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "/usr/local/lib/python3.7/site-packages/urllib3/packages/six.py", line 735, in reraise
    raise value
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
    chunked=chunked,
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 423, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 331, in _raise_timeout
    self, url, "Read timed out. (read timeout=%s)" % timeout_value
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='prodvpn-eu-1.netatmo.net', port=443): Read timed out. (read timeout=30)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 304, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 461, 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/camera.py", line 229, in update
    cid=self._camera_id
  File "/usr/local/lib/python3.7/site-packages/pyatmo/camera.py", line 280, in camera_urls
    temp_local_url = check_url(vpn_url)
  File "/usr/local/lib/python3.7/site-packages/pyatmo/camera.py", line 274, in check_url
    resp = self.authData.post_request(url=f"{url}/command/ping")
  File "/usr/local/lib/python3.7/site-packages/pyatmo/auth.py", line 119, in post_request
    resp = query(url, params, timeout, 3)
  File "/usr/local/lib/python3.7/site-packages/pyatmo/auth.py", line 114, in query
    return self._oauth.post(url=url, data=params, timeout=timeout)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 581, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests_oauthlib/oauth2_session.py", line 516, in request
    method, url, headers=headers, data=data, **kwargs
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 529, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='prodvpn-eu-1.netatmo.net', port=443): Read timed out. (read timeout=30)

Thank you!
Matteo

I am investigating that issue already. To my experience it shouldn’t be necessary to restart HA, a browser refresh should be sufficient, no?

No, I’m sorry but it’s not enough…refreshing the browser keep the status Recording/Unavailable unchanged.

using the configuration.yaml alternative and after I autenticated with netatmo, it failed to report back to HA, because it was trying to send a http request on a https port.

(I run HA without ssl behind nginx ssl proxy)

simply adding https:// in front of the confirmation url fixed the issue and camera and sensord integrated again. Although with new names :frowning:

Also breaking changes is one thing, breaking change makes me think netatmo stop work until I fix it - but no, this one took down HA completely. HA would not start with old config, that’s a bit extreme and deserve more warning imo.

I can also confirm all errors like:

Have 4 Presence and 3 Welcome cameras.

Sensors become unavailable, and as mentioned above, it is up to the “luck” upon restarting HA to get some of them working back. Never been able to get them all working at once.

Does netatmo platform use local camera ips to communicate with them, as provided by netatmo api? Or only the vpn connection via netatmo?

Is it possible to remove/exclude certain Netatmo devices? I’ve authenticated my account but its showing my dad’s weather station (shared via Netatmo) in devices. I don’t want to track those devices/entities.

Yes, you can deactivate individual entities from the config menu.

Hi there, I’ve been following this thread and I have a slightly different issue. I’ve managed to upgrade to 0.105.x and I’ve also been able to get the Netatmo integration working in HA.

The problem I have is that whilst I can see my Weather Station (and accessories) and the Welcome Camera I’ve lost access to my Netatmo Thermostat. I’ve also added the climate parameter back into configuration.yaml but this does not make any difference.

netatmo:
  client_id: !secret netatmoapi_key
  client_secret: !secret netatmosecret_key

climate:
  - platform: netatmo

Any suggestions for what to try next folk?

Please remove the climate section as netatmo devices are autodetected.

Hi @cgtobi, I’ve tried that however there is still no sign of my Netatmo Thermostat within the integration…

Any other suggestions?

Might be a bug that’s fixed in the beta. Did you see anything in the logs?

Sadly, the only error I’m seeing in the logs after everything settles down following a restart relates to an MQTT connection issue…

If you’re adventurous switch to the current beta which hopefully fixes the issue. Otherwise we need to debug this separately.

@cgtobi - I’m running the standard HASSIO image on a RP3b. How do I find out more / understand what is involved if I go the beta route?

Switching to beta to my experience works fine but you should carefully read the changelog for beta to check for breaking changes or known issues. https://rc.home-assistant.io/latest-release-notes/
It can cause you some trouble, it’s called beta for a reason. :wink:

Hi @cgtobi. I’ve taken the plunge and upgraded to the latest Beta version of HA.


Sadly there is no change and I still can’t locate my Netatmo Thermostat within the Netatmo Integration or via the Devices or the Entities views…

FWIW I can see my two thermostats on 0.105.5 and also my Netatmo weather station entities.
If it helps, I’ve my config as per yours in post #88 (so including the climate: entry), but that said would expect Tobi to be correct in his advise rather than me.
Touch wood haven’t had an issue :+1:

Hey,
I have the same setup and I am getting an error about

no attribute 'populate_token_attributes

Where exactly did you changed the confirmation url?
I was also wondering, if entering a “redirekt url” into the netatmo dev app could help.

If the Netatmo authorization page forwards you to a page it can’t open, try to replace parts of the url to point to your actual url.