madd0
September 23, 2021, 12:50pm
1
I’ve had the Netatmo integration for a while, it loads all my sensors, and appears to work fine. My HA instance works perfectly outside of my LAN via a reverse proxy.
Out of curiosity, I wanted to configure webhooks to test some further automation possibilities. So I configured the client_id
and client_secret
of a personal application registered with Netatmo. However, for some reason, the hook registration does not seem to be working properly.
After not receiving any calls to the hook, I set the Netatmo log level to debug and can see the following during loading:
14:29:13 INFO (MainThread) [homeassistant.components.netatmo] Register Netatmo webhook: https://my.domain.com/api/webhook/WEBHOOKID
14:29:42 DEBUG (MainThread) [homeassistant.components.netatmo] Unregister Netatmo webhook (WEBHOOKID)
14:29:42 INFO (MainThread) [homeassistant.components.netatmo.data_handler] Netatmo webhook unregistered
I’m guessing that the “webhook unregistered” a few seconds after “Register Netatmo webhook” would explain why I don’t get any calls.
Any ideas on how to debug/fix this?
Thanks
cgtobi
(Tobi)
September 24, 2021, 6:25am
2
The most common oversight in this context is setting the external url correctly. You can find it here and should set it to your WAN facing url.
You can use the service netatmo.register_webhook
to re-register the webhook without the need for a restart. Also double check that the webhook is not banned by Netatmo via dev.netatmo.com .
You might also have to configure use_x_forwarded_for
and trusted_proxies
in configuration.yaml
.
Example:
http:
use_x_forwarded_for: true
trusted_proxies:
- 192.168.1.42
1 Like
@madd0 were you able to fix your problem? I have the exact same problem occuring.
erwin63
(Guillaume)
January 17, 2022, 5:29pm
4
I have the same problem.
Do you find a fix ?
cgtobi
(Tobi)
January 18, 2022, 6:33am
5
Did you check all the above ?
erwin63
(Guillaume)
January 18, 2022, 11:04am
6
Yes.
I have http config :
http:
use_x_forwarded_for: true
trusted_proxies:
- IP
My home assistant is available in https:XXX without problems.
But I have this log during registered webhook :
2022-01-18 11:57:06 INFO (MainThread) [homeassistant.components.netatmo] Register Netatmo webhook: https://XXX/api/webhook/WEBHOOKID
2022-01-18 11:57:36 DEBUG (MainThread) [homeassistant.components.netatmo] Unregister Netatmo webhook (WEBHOOKID)
2022-01-18 11:57:36 INFO (MainThread) [homeassistant.components.netatmo.data_handler] Netatmo webhook unregistered
cgtobi
(Tobi)
January 18, 2022, 12:05pm
7
Did you also configure the external url correctly?
You can find it here and should set it to your WAN facing url.
erwin63
(Guillaume)
January 18, 2022, 12:09pm
8
yes my external URL is https://XXX.freeboxos.fr and this url is available
cgtobi
(Tobi)
January 18, 2022, 12:12pm
9
If your app/account is not banned for webhook use by Netatmo I’d like to ask you to raise the log level to debug and try to un-register and register the webhook manually via the service netatmo.register_webhook
.
erwin63
(Guillaume)
January 18, 2022, 12:20pm
10
Unregister :
2022-01-18 13:15:47 DEBUG (MainThread) [homeassistant.components.netatmo] Unregister Netatmo webhook (WEBHOOKID)
2022-01-18 13:15:47 INFO (MainThread) [homeassistant.components.netatmo.data_handler] Netatmo webhook unregistered
2022-01-18 13:15:47 DEBUG (MainThread) [homeassistant.components.netatmo] No webhook to be dropped for WEBHOOKID
Registered :
2022-01-18 13:16:07 INFO (MainThread) [homeassistant.components.netatmo] Register Netatmo webhook: https://XXXX.freeboxos.fr/api/webhook/WEBHOOKID
2022-01-18 13:16:37 DEBUG (MainThread) [homeassistant.components.netatmo] Unregister Netatmo webhook (WEBHOOKID)
2022-01-18 13:16:37 INFO (MainThread) [homeassistant.components.netatmo.data_handler] Netatmo webhook unregistered
For log level, I have this in my config :
logger:
logs:
homeassistant.components.netatmo: debug
How know if I banned by Netamo ? On https://dev.netatmo.com/ , my app is available and webhook status is OK.
cgtobi
(Tobi)
January 18, 2022, 12:46pm
11
Yes, that would be the place. I assume you’re on the latest patch release of HA?
erwin63
(Guillaume)
January 18, 2022, 12:59pm
12
Thanks for your different reply.
I uninstalled “netatmo integration” / remove configuration in yaml / restart HA. Then, reput netatmo configuration / restart then reinstall “netatmo integration”. And all work fine, strange
2022-01-18 13:52:28 DEBUG (MainThread) [homeassistant.components.netatmo.webhook] None: {'user_id': 'XXXX', 'user': {'id': 'XXXX', 'email': 'XXXX'}, 'push_type': 'webhook_activation'}
2022-01-18 13:52:28 INFO (MainThread) [homeassistant.components.netatmo.data_handler] Netatmo webhook successfully registered
cgtobi
(Tobi)
January 18, 2022, 1:08pm
13
Ok, strange. Thanks for the patience.
mch1307
(Mch1307)
February 15, 2022, 12:57pm
14
Hello,
I’m having the same issue: webhook systematically unregistered 30 seconds after registration:
2022-02-15 13:36:57 INFO (MainThread) [homeassistant.components.netatmo] Register Netatmo webhook: https://hooks.nabu.casa/savasvas=
2022-02-15 13:37:27 DEBUG (MainThread) [homeassistant.components.netatmo] Unregister Netatmo webhook (2a3cd081e44f5c25448a0bcd4724a6e0327705bc3d2bd77bad478071233c70f8)
2022-02-15 13:37:27 INFO (MainThread) [homeassistant.components.netatmo.data_handler] Netatmo webhook unregistered
Using nabu hosting,I did setup the external URL, the netatmo client and secret IDs and the trusted proxy
http:
use_x_forwarded_for: true
trusted_proxies:
- 172.30.33.0/24
- 10.32.2.0/24
Don’t know where to look at
mch1307
(Mch1307)
February 15, 2022, 6:59pm
15
Problem seems to be fixed after following actions:
remove netatmo integration
restart HA
add netatmo
configure using configuration.yaml file
Webhook succesfully registered and events are received in HA
cristian1
(Cristian)
March 11, 2022, 10:10am
16
This trick works but just the first time. If you restart HA, timeout happen and webhook is unregistered
fisch55
(Fisch55)
June 29, 2022, 7:58pm
17
Any news for the issue….afte restart oh ha, mostly webhooks not registered……
cgtobi
(Tobi)
June 30, 2022, 7:59am
18
I assume you are using the HA Cloud Link. Webhook are not functional with that method due to limitation of the Netatmo API. Please use your own dev account.
fisch55
(Fisch55)
June 30, 2022, 7:33pm
19
No, I‘m useing my own dev account in config.yaml.
But also installed the netatmo Addon.