Light netatmo presence

hello how do you do a webhook for the netatmo presence outdoor light to turn it on and off from the home assistant? can anyone teach me thanks

Once you have the system set up according to the documentation a light switch should appear in your UI.

when its setup you got this
image

Yes, the switch is there but I cannot control anything, it tells me not available

Then the webhook is not registered successfully. This can have various reasons. Please set the log level for Netatmo to INFO and check your logs. You have to expose your instance to the WAN via 443 and make sure the webhook is not banned on the Netatmo dev portal.

Hi,

I have exactly the same issue on my side since this summer… I have tryed a lot of troubleshoots things, but unfortunately, i’m blocked right now :frowning:

All my Netatmo products are ok, but i can’t have this light button available on my Home Assistant. In the netatmo dev portail all seems good. App status is “Activated” and Webhooks status is with a green V.

I turned on the debug logs for netatmo in HA but i can’t see THE detail.
In logs, it seems the light is not link to an entity…

Logger: homeassistant.components.select
Source: components/netatmo/select.py:126
Integration: SĂ©lectionner (documentation, issues)
First occurred: 15:27:21 (1 occurrences)
Last logged: 15:27:21

Error while setting up netatmo platform for select

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform await asyncio.shield(task) File "/usr/src/homeassistant/homeassistant/components/netatmo/select.py", line 69, in async_setup_entry entities = [ File "/usr/src/homeassistant/homeassistant/components/netatmo/select.py", line 70, in <listcomp> NetatmoScheduleSelect( File "/usr/src/homeassistant/homeassistant/components/netatmo/select.py", line 126, in __init__ self._attr_current_option = getattr(self._home.get_selected_schedule(), "name") AttributeError: 'NoneType' object has no attribute 'name'

And, it seems it trying to contact a false IP address :frowning:

 Logger: homeassistant.components.light
Source: components/netatmo/data_handler.py:154
Integration: Lumière ([documentation](retired/light), [issues](retired))
First occurred: 15:27:15 (1 occurrences)
Last logged: 15:27:15

Error while setting up netatmo platform for light

Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/aiohtp/connector.py", line 986, in _wrap_create_connection return await self._loop.create_connection(*args, **kwargs) # type: ignore[return-value] # noqa File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1056, in create_connection raise exceptions[0] File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1041, in create_connection sock = await self._connect_sock( File "/usr/local/lib/python3.9/asyncio/base_events.py", line 955, in _connect_sock await self.sock_connect(sock, address) File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 502, in sock_connect return await fut File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 537, in _sock_connect_cb raise OSError(err, f'Connect call failed {address}') OSError: [Errno 113] Connect call failed ('169.254.21.139', 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 249, in _async_setup_platform await asyncio.shield(task) File "/usr/src/homeassistant/homeassistant/components/netatmo/light.py", line 38, in async_setup_entry await data_handler.register_data_class( File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 198, in register_data_class await self.async_fetch_data(data_class_entry) File "/usr/src/homeassistant/homeassistant/components/netatmo/data_handler.py", line 154, in async_fetch_data await self.data[data_class_entry].async_update() File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 649, in async_update await self._async_update_all_camera_urls() File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 659, in _async_update_all_camera_urls await self.async_update_camera_urls(camera_id) File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 724, in async_update_camera_urls ] = await self._async_check_url( File "/usr/local/lib/python3.9/site-packages/pyatmo/camera.py", line 731, in _async_check_url resp = await self.auth.async_post_request(url=f"{url}/command/ping") File "/usr/local/lib/python3.9/site-packages/pyatmo/auth.py", line 339, in async_post_request async with self.websession.post( File "/usr/local/lib/python3.9/site-packages/aiottp/client.py", line 1138, in __aenter__ self._resp = await self._coro File "/usr/local/lib/python3.9/site-packages/aiottp/client.py", line 535, in _request conn = await self._connector.connect( File "/usr/local/lib/python3.9/site-packages/aiohtp/connector.py", line 542, in connect proto = await self._create_connection(req, traces, timeout) File "/usr/local/lib/python3.9/site-packages/aiohtp/connector.py", line 907, in _create_connection _, proto = await self._create_direct_connection(req, traces, timeout) File "/usr/local/lib/python3.9/site-packages/aiohtp/connector.py", line 1206, in _create_direct_connection raise last_exc File "/usr/local/lib/python3.9/site-packages/aiohtp/connector.py", line 1175, in _create_direct_connection transp, proto = await self._wrap_create_connection( File "/usr/local/lib/python3.9/site-packages/aiohtp/connector.py", line 992, in _wrap_create_connection raise client_error(req.connection_key, exc) from exc aiohtp.client_exceptions.ClientConnectorError: Cannot connect to host 169.254.21.139:80 ssl:default [Connect call failed ('169.254.21.139', 80)]

Like if there is a problem with the network configuration…

My HA configuration is up to date. RPi3

If you have an idea, i’m very interest …

Please let me know your exact version of HA that you have running.

The select issue might be related to this issue and should be fixed soon.

If your camera is an outdoor one please reboot the camera and try again. Sometimes they stop reporting the correct IP back to the API.

If the webhook is blocked you have to unblock it manually and re-register the webhook from within HA.

Hi,

After a reboot, indeed, i have no more Bad IP.
But for the light and select it’s always the same thing.

How Can i see if i’m banned from netatmo ?
The V green ils not a positive sign ?
I have read on the documentation there are commands to register and unregister. But i’m not sure how it’s working…

Right now (update this night) my HA version : Home Assistant 2021.12.6

Please set the log level for Netatmo to INFO and check whether the webhook registers correctly. You will see a message about the webhook registration.

Ok i have set level in INFO.

I’ve used the dev tool integrated in HA to register and unregister webhook.
My logs at this moment :
2021-12-28 10:29:09 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Running websocket_api script

2021-12-28 10:29:09 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Executing step call service

2021-12-28 10:29:09 INFO (MainThread) [homeassistant.components.netatmo] Register Netatmo webhook: https://censored.duckdns.org/api/webhook/censored

2021-12-28 10:29:30 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Running websocket_api script

2021-12-28 10:29:30 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Executing step call service

2021-12-28 10:29:30 INFO (MainThread) [homeassistant.components.netatmo.data_handler] Netatmo webhook unregistered

2021-12-28 10:29:39 INFO (MainThread) [homeassistant.components.netatmo.data_handler] Netatmo webhook unregistered

===============

Thank you for your help… Very appreciated !

As you can see from the last message the webhook is not registered. Either because the webhook is blocked (check the status on dev.netatmo.com) or because your don’t have your instance exposed properly to the WAN.

Do you use your own dev account from dev.netatmo.com? How do you expose your HA instance?

Hum, in fact i have run the register webhook from the dev module on HA.
And after the unregister.

If i just launch the register i have this logs without any error

2021-12-29 09:58:06 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Running websocket_api script

2021-12-29 09:58:06 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Executing step call service

2021-12-29 09:58:06 INFO (MainThread) [homeassistant.components.netatmo] Register Netatmo webhook: https://*censored*.duckdns.org/api/webhook/*censoredkey*

I have my own account indeed.
I can see a V green when i’m in my APP on the dev portal Netatmo
image

How to verify if i’m banned ?

I think my instance is properly exposed to the wan (i’m using the application on my smartphone when i’m not at home).

Arf…

30 seconds after, i received this message:

2021-12-29 09:58:36 INFO (MainThread) [homeassistant.components.netatmo.data_handler] Netatmo webhook unregistered

So there is a problem ?
I don’t know what to do…

I’m reading again your post and i see i haven’t clearly answerd to your question.
My HA is behind an Internet BOX with only port 443 exposed. I haven’t check this point. I will check this point this evening. I don’t know very well how webhook works, maybe there are specials parameters (UDP maybe ?) to activate.

Just, if you could confirm me this is ok with the green V on my dev portal ?

If you have a green check mark and you’re using those credentials in your configuration.yaml you should be good to go.

Can you verify that your integration entry looks similar to this?

It’s like you :
image

It’s not like you… Like if it’s not my configuration.yaml in fact…
I’m searching to reintegrate properly…

Oh my god… It’s working.
I’ve understand…

In my account on netatmo portal. I had an autorisation for HA cloud “Casa”. I have deleted this and redo the integration.
Now it’s seems working.
I’m reconfiguring and testing…

Is your external URL set correctly? Do you use a reverse proxy?

So it’s working since i’ve removed autorisation for Home assistant cloud in my account on netatmo security website.
I let only my own HA and it seems working.

Now i have this message in logs when i register webhook :

2021-12-29 17:30:50 INFO (MainThread) [homeassistant.components.netatmo.data_handler] Netatmo webhook successfully registered

Now my integration is based on my configuration.yaml file. Thanks for your capture from your integration. This picture helped me a lot.

A Big thank you for your help, i was searching from August without success with random effect with the light (sometimes ok after a reboot during some minutes or hours…).

Have a good day !

1 Like