Netatmo devices discovery problem

Hi,

A few weeks ago after a restart, I noticed that my netatmo device ( 1 healthy home coach for now) was unavailable.

I managed to get it back after reloading but after the next restart it was gone again.

Whatever I try, I end up with the integration showing in the integration page but without any device.

I have tried using this :

netatmo:
client_id: CLIENT_ID
client_secret: CLIENT_SECRET

In my configuration.yaml, but when I set up the integration that way, the webpage return 500 internal server error when I click the “I accept” button to link my account.

So the only way for me to set up the integration is via HA cloud, which I have tried with and without the lines in the configuration.yaml but it’s always the same result.

I am currently running 117.5 and the only reference to Netatmo in my logs are under DNS:

[INFO] :41387 - 16785 “A IN api.netatmo.com. udp 33 false 512” NOERROR qr 64 0.002925019s
[INFO] :41387 - 17711 “AAAA IN api.netatmo.com. udp 33 false 512” NOERROR qr,rd,ra 174 0.160053858s
[INFO] :35432 - 58934 “AAAA IN api.netatmo.com. udp 33 false 512” NOERROR qr,aa,rd,ra 174 0.000451942s
[INFO] :35432 - 57823 “A IN api.netatmo.com. udp 33 false 512” NOERROR qr,aa,rd 64 0.000712348s
[INFO] :49766 - 57867 “A IN api.netatmo.com. udp 33 false 512” NOERROR qr,aa,rd 64 0.000458849s
[INFO] :49766 - 58830 “AAAA IN api.netatmo.com. udp 33 false 512” NOERROR qr,aa,rd,ra 174 0.000383535s
[INFO] :50125 - 50474 “A IN api.netatmo.com. udp 33 false 512” NOERROR qr,aa,rd 64 0.000345553s
[INFO] :50125 - 51437 “AAAA IN api.netatmo.com. udp 33 false 512” NOERROR qr,aa,rd,ra 174 0.000440738s
[INFO] :51147 - 26856 “AAAA IN api.netatmo.com. udp 33 false 512” NOERROR qr,aa,rd,ra 174 0.000360294s
[INFO] :51147 - 25745 “A IN api.netatmo.com. udp 33 false 512” NOERROR qr,aa,rd 64 0.000276702s
[INFO] :41462 - 4367 “A IN api.netatmo.com. udp 33 false 512” NOERROR qr,aa,rd 64 0.000273017s
[INFO] :41462 - 5496 “AAAA IN api.netatmo.com. udp 33 false 512” NOERROR qr,aa,rd,ra 174 0.000260387s

Thanks for your help !

Can you please set the log level for the integration to debug and check your logs after restarting HA?

Sure, here is the output concerning Netatmo:

2020-11-11 12:56:23 INFO (MainThread) [homeassistant.components.netatmo.camera] Cameras are currently not supported with this authentication method

2020-11-11 12:56:26 ERROR (SyncWorker_3) [pyatmo.auth] Too many retries

2020-11-11 12:56:26 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] No weather station data returned by Netatmo server

2020-11-11 12:56:26 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class WeatherStationData added

2020-11-11 12:56:26 ERROR (SyncWorker_24) [pyatmo.auth] Too many retries

2020-11-11 12:56:26 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] No thermostat data returned by Netatmo server

2020-11-11 12:56:26 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class HomeData added

2020-11-11 12:56:29 ERROR (SyncWorker_35) [pyatmo.auth] Too many retries

2020-11-11 12:56:29 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] No weather station data returned by Netatmo server

2020-11-11 12:56:29 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class HomeCoachData added

2020-11-11 12:56:41 ERROR (SyncWorker_1) [pyatmo.auth] Too many retries

2020-11-11 12:56:41 INFO (MainThread) [homeassistant.components.netatmo] Register Netatmo webhook: https://my_HA_external_adress)/api/webhook/(Probably_confidential_key)

2020-11-11 12:56:41 INFO (MainThread) [homeassistant.components.netatmo.light] Cameras are currently not supported with this authentication method

To get some insights into this issue I’d like to ask you to either run a self test script.

Here are the instructions.
You don’t need to run this on the same machine that HA runs on. Any linux or OSX is just fine.

Please be aware that the results might contain sensible data, so I’d suggest to send them via PM instead.

Hi, here is the result of test:

Energy Public Camera WeatherStation HomeCoach Smokedetector

Checking for available weather stations

warning, no weather station available for testing

Checking for available home coach stations

Module_Name (MAC_ADRESS)
Modules [‘Indoor’]
Temperature - 20.1
CO2 - 800
Humidity - 63
Noise - 43
Pressure - 1022.5
AbsolutePressure - 1016
health_idx - 0
min_temp - 19.6
max_temp - 20.1
date_max_temp - 1605174729
date_min_temp - 1605167757
When - 1605174729
reachable - True
wifi_status - 50
HomeCoach [OK]

Checking for available cameras

warning, no camera available for testing

Checking for available smoke detectors

warning, no smoke detectors available for testing

Checking for public data

Traceback (most recent call last):
File “C:\Users\jacqu\gen_test_data.py”, line 245, in
pd = pyatmo.PublicData(
TypeError: init() got an unexpected keyword argument ‘LAT_NE’

Thanks. Sorry about the error at the end. Fixed that already.

Could you please run that again with --mode debug? This time I’d recommend to send me the result via PM.

Unfortunately the debug logs don’t show anything helpful apart from that it looks ok.

Can you please try to add the integration with configuration.yaml? (although that should not be neccessary)

I’ve tried that again, unfortunately, the configuration.yaml setup doesn’t work for me, after I press the “I accept” button on the Netatmo website, it end up with:

500 Internal Server Error

Server got itself in trouble

Please check that your external and internal URLs are set correctly.

I double checked under configuration > general what URLs were set there and they look good to me. They both redirect correctly to HA.

Edit: I’ve also try differents URLs but I still get the error 500 or in some case an error 404. So no luck !

Is your instance behind a reverse proxy or firewall?

I have a firewall on my router, yes. I tried to turn it off but still the same

To my knowledge I’m not using a reverse proxy, my external URL is a redirection from a domain hosted at OVH.

How do you expose HA to the WAN? Which ports do you expose?

My port forwarding is as follow:

external port 443 to internal port 8123
external port 8123 to internal port 8123
external port 80 to internal port 80 (For Lets Encrypt certificates)

My external URL is: https://domain.eu:8123

Ok, please remove the integration if it shows up as installed, restart HA and add it back again. Make sure you choose configuration.yaml. Also please don’t try this on iOS (just in case).

Ok man, no idea what you did, but it worked ! :clap: :clap:

Thanks !

1 Like

Nothing, it’s just that the order of those steps matters. Have fun with it.

You really didn’t do anything ? That’s a coincidence because I’ve been doing this for the last 2 weeks


False alert
 It’s gone again ! The integration became unavailable, I tried to re-link it and now it’s back to the same error