home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.8k stars 30.9k forks source link

Neatmo indoor module integration not working #40960

Closed bigboban closed 3 years ago

bigboban commented 4 years ago

Neatmo indoor module integration not working

All indoor sensors unavailable. Netatmo public OK. Indoor module values OK on Netatmo web.

Environment

Problem-relevant configuration.yaml

netatmo:
   client_id: !secret netatmo_api_key
   client_secret: !secret netatmo_secret_key

Traceback/Error logs


2020-10-01 13:24:47 INFO (MainThread) [homeassistant.setup] Setting up netatmo
2020-10-01 13:24:47 INFO (MainThread) [homeassistant.setup] Setup of domain netatmo took 0.0 seconds
2020-10-01 13:24:47 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=netatmo, service=register_webhook>
2020-10-01 13:24:47 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=netatmo, service=unregister_webhook>
...
2020-10-01 13:24:47 INFO (MainThread) [homeassistant.components.camera] Setting up camera.netatmo
2020-10-01 13:24:47 INFO (MainThread) [homeassistant.components.climate] Setting up climate.netatmo
...
2020-10-01 13:24:48 DEBUG (SyncWorker_39) [requests_oauthlib.oauth2_session] Requesting url https://api.netatmo.com/api/gethomedata using method POST.
2020-10-01 13:24:48 DEBUG (SyncWorker_18) [requests_oauthlib.oauth2_session] Requesting url https://api.netatmo.com/api/homesdata using method POST.
...
2020-10-01 13:24:49 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class CameraData added
2020-10-01 13:24:49 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=netatmo, service=set_persons_home>
2020-10-01 13:24:49 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=netatmo, service=set_person_away>
2020-10-01 13:24:49 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=netatmo, service=set_camera_light>
2020-10-01 13:24:50 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class HomeData added
2020-10-01 13:24:50 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=netatmo, service=set_schedule>
2020-10-01 13:24:50 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event system_log_event[L]: name=homeassistant.components.sensor, message=['The netatmo platform for the sensor integration does not support platform setup. Please remove it from your config.'], level=ERROR, source=['helpers/entity_platform.py', 121], timestamp=1601551489.874223, exception=, count=1, first_occurred=1601551489.874223>
2020-10-01 13:24:50 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.netatmo
...
2020-10-01 13:24:52 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class WeatherStationData added
2020-10-01 13:24:52 DEBUG (MainThread) [homeassistant.components.netatmo.sensor] Adding module Indoor xx:xx:xx:xx:xx:xx
2020-10-01 13:24:52 DEBUG (MainThread) [homeassistant.components.netatmo.sensor] Adding module Outdoor xx:xx:xx:xx:xx:xx
2020-10-01 13:24:52 DEBUG (SyncWorker_2) [requests_oauthlib.oauth2_session] Requesting url https://api.netatmo.com/api/gethomecoachsdata using method POST.
...
2020-10-01 13:24:53 DEBUG (MainThread) [homeassistant.components.netatmo.netatmo_entity_base] New client sensor.netatmo_bobo_netatmo_indoor_temperature
...
2020-10-01 13:24:53 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] No weather station available
2020-10-01 13:24:53 DEBUG (MainThread) [homeassistant.components.netatmo.data_handler] Data class HomeCoachData added
2020-10-01 13:24:53 DEBUG (SyncWorker_19) [requests_oauthlib.oauth2_session] Requesting url https://api.netatmo.com/api/getpublicdata using method POST.

Additional information

ondoteam commented 4 years ago

Same problem with indoor and outdoor devices. It stop working at 23:30 GMT+1

There is nothing in my logs other than the following (I have port 443 exposed to internet):

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'

bigboban commented 4 years ago

This message is NOT in my log file.. I think your message is probably not connected to our problem..

probot-home-assistant[bot] commented 4 years ago

netatmo documentation netatmo source (message by IssueLinks)

probot-home-assistant[bot] commented 4 years ago

Hey there @cgtobi, mind taking a look at this issue as its been labeled with an integration (netatmo) you are listed as a codeowner for? Thanks! (message by CodeOwnersMention)

LaStrada commented 4 years ago

Edit: My logs are not related. I'm using the values in multiple min_max sensors, that's probably why I'm getting this error.

My Netatmo devices suddenly stopped this night. I rebooted this morning because of this, but it didn't work. Neither reconfiguring the integration. Running 0.115.6 / OS 5.2.

My Netatmo Health Coach is still working (same integration), but all Netatmo Weather Station sensors aren't working (base station + indoor module + outdoor module).

Logger: homeassistant.helpers.event
Source: components/min_max/sensor.py:164 
First occurred: 9:26:59 AM (12 occurrences) 
Last logged: 1:43:19 PM

Error while processing state changed for sensor.netatmo_bever_temperature
Error while processing state changed for sensor.netatmo_bever_kontoret_temperature
Error while processing state changed for sensor.netatmo_bever_kontoret_humidity
Error while processing state changed for sensor.netatmo_soverommet_temperature
Error while processing state changed for sensor.netatmo_soverommet_humidity
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 228, in _async_state_change_dispatcher
    hass.async_run_job(action, event)
  File "/usr/src/homeassistant/homeassistant/core.py", line 384, in async_run_job
    target(*args)
  File "/usr/src/homeassistant/homeassistant/components/min_max/sensor.py", line 164, in async_min_max_sensor_state_listener
    if new_state.state is None or new_state.state in [
AttributeError: 'NoneType' object has no attribute 'state'
dodg3r commented 4 years ago

My netatmo weatherstation also stoped working. I solved it by removing the integration and removed hassio in partner apps in netatmo app. Then I installed netatmo integration again and now it works.

LaStrada commented 4 years ago

Mine sensors came back online after a few hours. Didn’t do anything, no restarts, no changes in the config. Maybe Netatmo had some issues?

cgtobi commented 4 years ago

This was posted on the forum today: 6IA4mmTr

sany1231 commented 4 years ago

Same issue here (400 bad request), when i saw that my netatmo stats are freezed, then i automaticaly tryed to remove integration and again create new one, but it is still not working... I will try @dodg3r solution to remove hassio from partner app and then starts from zero. I will post results.

sany1231 commented 4 years ago

Same issue here (400 bad request), when i saw that my netatmo stats are freezed, then i automaticaly tryed to remove integration and again create new one, but it is still not working... I will try @dodg3r solution to remove hassio from partner app and then starts from zero. I will post results.

This solution is not working for me, probably i will wait few more days if this issue will be solved by NETATMO.

cgtobi commented 4 years ago

There won't be a solution until Netatmo fixes their web services.

dodg3r commented 4 years ago

What do you mean?

It still works for me after I reauthorized the app....

cgtobi commented 4 years ago

It works for some and for some it doesn't.

oywino commented 4 years ago

After upgrading to 0.116.1 the Netatmo Integration can only see my Camera entity. All other Netatmo entities are gone. I deleted and re-added the Netatmo Integration, but to no avail. Also, restarting HA made no difference. Then I downgraded to 0.115.6 and everything appeared as normal again. I further again upgraded to 0.116.1 and same thing all over; Every other Netatmo Entity except camera is gone.

jazbraz commented 4 years ago

After upgrading to 0.116.1 the Netatmo Integration can only see my Camera entity. All other Netatmo entities are gone. I deleted and re-added the Netatmo Integration, but to no avail. Also, restarting HA made no difference. Then I downgraded to 0.115.6 and everything appeared as normal again. I further again upgraded to 0.116.1 and same thing all over; Every other Netatmo Entity except camera is gone.

Same for me HassOS 4.13 Supervisor: 247 now downgrade to 0.115.6 all works.

MartinHjelmare commented 4 years ago

Please don't use this issue to report all various problems with the netamo integration. There's already an issue opened for the problem in 0.116.1. If you have another problem, please open a new issue.

oywino commented 4 years ago

Sorry, could you provide a link to where I can find the "issue already opened for the problem in 0.116.1" ?

MartinHjelmare commented 4 years ago

They are already closed since the issue has been fixed and it will be released in 0.116.2.

https://github.com/home-assistant/core/issues?q=is%3Aissue+netatmo+0.116.1+is%3Aclosed

sany1231 commented 4 years ago

after upgrade from 0.115.6 to 0.116.2 i have still this issue.

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'

my netatmo configuration is same since hass in 0.112.x after last update to 0.115.6 neatmo stops working.

MartinHjelmare commented 4 years ago

This issue is not fixed, so that's expected.

cgtobi commented 4 years ago

@sany1231 which issue exactly? The webhook has nothing to do with indoor modules (original topic). If this is unrelated to the Netatmo indoor module please open a new issue.

sany1231 commented 4 years ago

@sany1231 which issue exactly? The webhook has nothing to do with indoor modules (original topic). If this is unrelated to the Netatmo indoor module please open a new issue.

i was reacting on @ondoteam post, he has similar issue. But no problem, i will open new issue

bigboban commented 4 years ago

I wrote twice to Netatmo support. Without any reaction. I think it is broken forever.. Look at IFTTT. Netatmo has no income from API but servers and all this stuff is expensive. I think they switched it off and it will never be online again..

cgtobi commented 4 years ago

@bigboban Not quite sure if I follow. Would you mind to explain the issue again? Because I can't see anything relevant in the error log you posted.

bigboban commented 4 years ago

Yes, there is nothing relevant in my log. Strange but nothing. But you sent Netatmo disclaimer here and there is lot of people with broken Netatmo integration from ~ same time. And Netatmo support ignores my questions..

cgtobi commented 4 years ago

Ok, but I still don't understand what isn't working as expected.

bigboban commented 4 years ago

As posted in first post - "All indoor sensors unavailable.".

But now Netatmo public also broken..

cgtobi commented 4 years ago

Please go to the configuration panel and navigate to you netatmo devices. Check all of them there if the individual entities do contain anything or all report unavaiblable for example. A (few) screenshot(s) could help maybe.

bigboban commented 4 years ago

All entities under Netatmo integration has "red circle icon" (Restored). I have indoor, outdoor and public entities here. Indoor values in my Android phone are ok so integration My-indoor-station->Netatmo servers is ok.

cgtobi commented 4 years ago

I'd suggest to run the self test script with those new set of keys to check what's actually returned by the back end. Feel free to contact me on Discord or the forums if the response contains sensible information.

bigboban commented 4 years ago

Output from test script:

Traceback (most recent call last):
  File "gen_test_data.py", line 102, in <module>
    authorization = pyatmo.ClientAuth(
  File "C:\Python38\lib\site-packages\pyatmo\auth.py", line 263, in __init__
    self._oauth.fetch_token(
  File "C:\Python38\lib\site-packages\requests_oauthlib\oauth2_session.py", line 360, in fetch_token
    self._client.parse_request_body_response(r.text, scope=self.scope)
  File "C:\Python38\lib\site-packages\oauthlib\oauth2\rfc6749\clients\base.py", line 421, in parse_request_body_response
    self.token = parse_token_response(body, scope=scope)
  File "C:\Python38\lib\site-packages\oauthlib\oauth2\rfc6749\parameters.py", line 431, in parse_token_response
    validate_token_parameters(params)
  File "C:\Python38\lib\site-packages\oauthlib\oauth2\rfc6749\parameters.py", line 438, in validate_token_parameters
    raise_from_error(params.get('error'), params)
  File "C:\Python38\lib\site-packages\oauthlib\oauth2\rfc6749\errors.py", line 405, in raise_from_error
    raise cls(**kwargs)
oauthlib.oauth2.rfc6749.errors.InvalidGrantError: (invalid_grant)
bigboban commented 4 years ago

WOW. If I open Netatmo dev page here https://dev.netatmo.com/ i receive only blank page.

I think this is broken on Netatmo side and as i write above i think it is intention.

I think it will never be fixed..

cgtobi commented 4 years ago

I just ran all this in a sandboxed environment and it worked fine. This was on linux though. I never ran this on Windows.

dodg3r commented 4 years ago

I think there is still problem with netatmo site.

https://forum.netatmo.com/viewtopic.php?f=5&t=18798

bigboban commented 4 years ago

I run test script on Ubuntu 20 WSL and... it works! Netatmo indoor module values tested OK.

But what to do now? Remove and re-insert integration in HA?

cgtobi commented 4 years ago

That would be a start.

bigboban commented 4 years ago

My netatmo is back. I did some steps:

All works fine now - indoor and public sensors.

Maybe my steps help someone.

oywino commented 4 years ago

That's interesting. I too noticed that the word "indoor" disappeared from all indoor modules when I upgraded to 0.116.2, but I have no idea why?

bigboban commented 4 years ago

I have 116.0 and "indoor" is gone too.

oywino commented 4 years ago

0.116 is known to have severe Netatmo bugs. You should upgrade to 0.116.2 asap.

cgtobi commented 4 years ago

@oywino I really wonder where you gained these insights. A few bugs were fixed in 0.116.1 and .2 but IMO this is far from severe bugs.

cgtobi commented 4 years ago

@bigboban can this be closed? Is this fixed for you?

oywino commented 4 years ago

@oywino I really wonder where you gained these insights. A few bugs were fixed in 0.116.1 and .2 but IMO this is far from severe bugs.

My own experience, Sir. All Netatmo weather related devices broke in 0.116 and 0.116.1 Only my camera worked. When something brakes completely - it's severe (in my book). But it was quickly discovered by the team, and acknowledged by yourself. You did a great job. Please don't get me wrong. https://github.com/home-assistant/core/pull/41517

github-actions[bot] commented 3 years ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.