Hi
After a fresh new installation, netatmo returns error. Can someone help me ?
2020-04-14 11:53:25 DEBUG (SyncWorker_15) [homeassistant.components.netatmo.sensor] weather station detected!
2020-04-14 11:53:25 DEBUG (SyncWorker_15) [homeassistant.components.netatmo.sensor] Adding module Indoor 70:ee:xx:xx:xx:xx
2020-04-14 11:53:25 DEBUG (SyncWorker_15) [homeassistant.components.netatmo.sensor] Adding module Abri 02:00:xx:xx:xx:xx
2020-04-14 11:53:25 DEBUG (SyncWorker_31) [homeassistant.components.netatmo.climate] Setting up home 5c8525fed6e33fxxxxxxxxxx ...
2020-04-14 11:53:25 DEBUG (SyncWorker_15) [homeassistant.components.netatmo.sensor] No home coach entities found
2020-04-14 11:53:25 ERROR (SyncWorker_31) [pyatmo.thermostat] Errors in response: {'status': 'ok', 'time_server': 1586865206, 'body': {'home': {'id': '5c8525fed6e33fxxxxxxxxxx'}, 'errors': [{'code': 6, 'id': '70:ee:xx:xx:xx:xx'}]}}
2020-04-14 11:53:25 DEBUG (SyncWorker_31) [homeassistant.components.netatmo.climate] No climate devices for None (5c8525fed6e33fxxxxxxxxxx)
2020-04-14 11:53:34 ERROR (MainThread) [homeassistant.components.netatmo] Error during webhook registration - 400 - Bad request - Allowed ports for webhooks are 443 and 80. (21) when accessing 'https://api.netatmo.com/api/addwebhook'
Thanks
Additional logs :
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/pyatmo/auth.py", line 129, in query
rsp = self._oauth.post(url=url, data=params, timeout=timeout)
File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 578, 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 478, in request
url, http_method=method, body=data, headers=headers
File "/usr/local/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 198, in add_token
raise TokenExpiredError()
oauthlib.oauth2.rfc6749.errors.TokenExpiredError: (token_expired) `Preformatted text`
I added the netatmo informations in the configuration file. Now I have all the information but the error Error during webhook registration - 400 - Bad request - Allowed ports for webhooks are 443 and 80. (21) when accessing 'https://api.netatmo.com/api/addwebhook keep going to show
Error during webhook registration - 400 - Bad request - Allowed ports for webhooks are 443 and 80. (21) when accessing 'https://api.netatmo.com/api/addwebhook
This error means that you’re HA instance is not reachable on ports 443 or 80, therefore you can’t make use of webhook events.
Hello, I get exactly the same last log ERROR message at HA start. Plus I’m not able to turn off/on the Netatmo Welcome camera from HA (but live image is ok).
In my case (Windows 10), a system process is using TCP port 80 (Port 443 looks not used). When I look at the firewall rules, the only allowed AND activated service on TCP local port 80 for incoming traffic is “HTTP World Wide Web Services”, so I’m confused.
Apparently you’re instance is not accessible from the internet hence the webhook registration fails.
I strongly do not advise to expose a machine directly to the internet if you don’t know exactly what you are doing. Windows even more so.
Please consider using a proxy or Nabu Casa.
About turning the camera on/off, it is not supported right now. Please take a look at the pre-release custom component: Testers wanted - Netatmo integration
Actually I do use Nabu Casa for external access so I should be both visible and safe
In my netatmo app config, I did not fill “Redirect URI” and “Webhook URI” fields. Should I put my Nabu casa URL here?
To be more precise:
the error message is a “new” behavior (not 100% sure, but I think it’s from 0.111)
Everything with Netamo works perfectly well (weather station + welcome camera).
BTW, Thanks for the link. I will be happy to test and help with Netatmo integration.
With Nabu Casa for remote access you shouldn’t need to configure anything and webhooks should work just fine. Also in the netatmo (dev) app no URIs need to be configured.
Please double check your external and intern URLs.
the Netatmo integration was working fine since one year then I upgrade from 0.113.3 to 0.114.2 (python env install on a Rpi) and now I got the message : Error during webhook registration - 400 - Bad request - Allowed ports for webhooks are 443 and 80. (21) when accessing ‘https://api.netatmo.com/api/addwebhook’
I try to :
restart HA : no succes
remove the “webhook uri” of my Netatmo app (on dev.netatmo.com) (by the way, for the first time the webhook works for the first time before the upgrade and my HA instance is not accessible on the 80 or 443 port)
remove Netatmo integration & add it again : no success
downgrade to 0.113.3 : no success
(Strange thing (?) I got 2 Presence cameras and no problem with them)
Update: I set the Netatmo log to debug and now I got :
Aug 19 22:10:07 localhost hass[22692]: #033[36m2020-08-19 22:10:07 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class HomeData added#033[0m
Aug 19 22:10:07 localhost hass[22692]: #033[36m2020-08-19 22:10:07 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] 403 - Forbidden - Application does not have the good scope rights (13) when accessing 'https://api.netatmo.com/api/getstationsdata'#033[0m
Aug 19 22:10:07 localhost hass[22692]: #033[36m2020-08-19 22:10:07 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class WeatherStationData added#033[0m
Aug 19 22:10:07 localhost hass[22692]: #033[36m2020-08-19 22:10:07 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] 403 - Forbidden - Application does not have the good scope rights (13) when accessing 'https://api.netatmo.com/api/gethomecoachsdata'#033[0m
Aug 19 22:10:17 localhost hass[22692]: 2020-08-19 22:10:17,762 [22692] ERROR homeassistant.components.netatmo: Error during webhook registration - 400 - Bad request - Allowed ports for webhooks are 443 and 80. (21) when accessing 'https://api.netatmo.com/api/addwebhook'
So, basically this just means that the registration of the webhook failed because you either don’t expose HA via 443 to the web or don’t use Nabu Casa and therefore can’t use webhook events by the Netatmo API.
The integration should work, but you wont get great responsiveness.
In 0.114 a lot has changes under the hood to reduce the backend calls to the Netatmo API to respect there limits and make things more responsive and efficient.
Also without webhook events you wont get the new light platform for your outdoor cameras.
Ok thanks, but I was talking about the Weather station, all the entities are unavalaible since the upgrade: what can I do to get them back ?
(the camera integration stills works fine)
Ok, I didn’t see you mentioning the weather station. Webhooks are not related to those. But the error method suggests some issue about scope rights. I assume you do use your own dev account in configuration.yaml since your cameras are working?
No, I don’t use HA cloud, still configuration.yaml (and I restore the last backop from the 113.3 version) , the log :
ERROR homeassistant.components.netatmo: Error during webhook registration - 400 - Bad request - Allowed ports for webhooks are 443 and 80. (21) when accessing 'https://api.netatmo.com/api/addwebhook'