Errors with netatmo integration

Hi there,
my HA log is showing some errors concerning the netatmo integration. As far as I can see my camera and weather station are working as expected but the entry worries me a bit. Maybe this is a known issue. I have no idea about coding, maybe experienced users can explain it to me.

2021-06-25 06:21:29 ERROR (MainThread) [homeassistant.components.netatmo] Error during webhook registration - 400 - Bad request - Allowed ports for webhooks are 80, 88, 443 and 9443. (21) when accessing 'https://api.netatmo.com/api/addwebhook'
2021-06-25 06:21:59 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/netatmo/__init__.py", line 134, in unregister_webhook
    await hass.data[DOMAIN][entry.entry_id][AUTH].async_dropwebhook()
  File "/usr/local/lib/python3.8/site-packages/pyatmo/auth.py", line 354, in async_dropwebhook
    resp = await self.async_post_request(
  File "/usr/local/lib/python3.8/site-packages/pyatmo/auth.py", line 320, in async_post_request
    raise ApiError(
pyatmo.exceptions.ApiError: 406 - Not Acceptable - Nothing to drop (7) when accessing 'https://api.netatmo.com/api/dropwebhook'

This already fixed in dev and should be shipped with 2021.7 (in about two weeks).

1 Like

I have issues as well, reporting here my logs in case it can be found useful

Logger: homeassistant.components.camera
Source: components/netatmo/data_handler.py:139 
Integration: Telecamera (documentation, issues) 
First occurred: 16:34:01 (1 occurrences) 
Last logged: 16:34:01

Error while setting up netatmo platform for camera
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 969, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore  # noqa
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 1025, in create_connection
    raise exceptions[0]
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 1010, in create_connection
    sock = await self._connect_sock(
  File "/usr/local/lib/python3.8/asyncio/base_events.py", line 924, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/local/lib/python3.8/asyncio/selector_events.py", line 496, in sock_connect
    return await fut
  File "/usr/local/lib/python3.8/asyncio/selector_events.py", line 528, in _sock_connect_cb
    raise OSError(err, f'Connect call failed {address}')
OSError: [Errno 113] Connect call failed ('169.254.55.84', 80)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 250, in _async_setup_platform
    await asyncio.shield(task)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/camera.py", line 55, in async_setup_entry
    await data_handler.register_data_class(
  File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 181, in register_data_class
    await self.async_fetch_data(data_class_entry)
  File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 139, in async_fetch_data
    await self.data[data_class_entry].async_update()
  File "/usr/local/lib/python3.8/site-packages/pyatmo/camera.py", line 607, in async_update
    await self._async_update_all_camera_urls()
  File "/usr/local/lib/python3.8/site-packages/pyatmo/camera.py", line 614, in _async_update_all_camera_urls
    await self.async_update_camera_urls(camera_id)
  File "/usr/local/lib/python3.8/site-packages/pyatmo/camera.py", line 688, in async_update_camera_urls
    self.cameras[home_id][camera_id]["local_url"] = await async_check_url(
  File "/usr/local/lib/python3.8/site-packages/pyatmo/camera.py", line 676, in async_check_url
    resp = await self.auth.async_post_request(url=f"{url}/command/ping")
  File "/usr/local/lib/python3.8/site-packages/pyatmo/auth.py", line 304, in async_post_request
    async with self.websession.post(
  File "/usr/local/lib/python3.8/site-packages/aiohttp/client.py", line 1117, in __aenter__
    self._resp = await self._coro
  File "/usr/local/lib/python3.8/site-packages/aiohttp/client.py", line 520, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 535, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 892, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 1051, in _create_direct_connection
    raise last_exc
  File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 1020, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "/usr/local/lib/python3.8/site-packages/aiohttp/connector.py", line 975, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host 169.254.55.84:80 ssl:default [Connect call failed ('169.254.55.84', 80)]


So far what you have given ist just an error. What is the actual issue related to it?

Netatmo camera is not available, it was working before, nothing changed on my setup

Have you tried to restart the camera? Sometimes they just hang up. Often the sd card is at fault. Cameras are working for many people I know so it is no general issue.

So the camera is working fine on Netatmo security app so it has no problem itself.

I disable and enabled monitoring and rebooted HA but still unavailable.

Any suggestion? What do you mean by ā€œrestarting the cameraā€? As far as I know there are no ā€œrebootā€ command into the Netatmo app

By restarting I simply mean disconnecting if from power.

Btw. if this started just recently, more precisely on the 28.06, it could have been caused by maintenance on their side:

As part of our ongoing commitment to continuously improve our services and ensure customer satisfaction, there will be two scheduled maintenances:
on 28/06 - from 11pm to 2am (GMT+2). Only the Security application will be impacted

Do you think it worth to wait and see if coming back online? Not easy for me to power cycle

Is there anything else I can check?

BTW thank you very much for your support

1 Like

When did it go offline in HA? Right after the upgrade to 2021.6?

so on the 29th it was still online, I upgraded to 2021.6.6 early than this so it should not be releated to that.

I had an issue with the router then and the camera has been offline (as all other stuff, router was KO) for 2-3 days.
Now everything is back online (as said I can interact with the camera by netatmo security app) but camera is not available in HA.

All other netatmo stuff is working perfectly (thermostat, valves, weather station): it really seems the camera only.

Does it make sense to remove and re-add the integration?

Before you re-add the integration try the reload button first.

It didnā€™t work :frowning:

Should I remove and add again?

You can try, but I donā€™t have high hopes that it makes much of a difference.

You mentioned that your router had issues. Did you replace it? The error log says it canā€™t reach your cameras IP. Is the camera on a different subnet or do you have some firewall that prevents access?

No it is the same router, I donā€™t have different subnets.

Is the integration trying to connect to 169.254.55.84 as camera IP? Because for sure this is not my camera IP

Yes, this is what the error log tells. The IP is returned by the Netatmo API. It usually gives back the external URL and the internal IP. If the log message is still the same but the IP does not match Iā€™d really suggest to power cycle the camera.

1 Like

Power cycling made the trick!
Thanks for this!

It is a pity there isnā€™t any option for rebooting the camera from Netatmo app :face_with_monocle:

1 Like

Yay. Thatā€™s great.

As far as I fan see the update didnā€˜t fix it. The error message persists:

2021-07-08 23:31:42 WARNING (MainThread) [homeassistant.components.light] Platform netatmo not ready yet: None; Retrying in background in 30 seconds
2021-07-08 23:31:47 ERROR (MainThread) [homeassistant.components.netatmo] Error during webhook registration - 400 - Bad request - Allowed ports for webhooks are 80, 88, 443 and 9443. (21) when accessing 'https://api.netatmo.com/api/addwebhook'