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
72.55k stars 30.35k forks source link

Refresh frequency lead to missing values with netatmo sensors #43826

Closed Pirol62 closed 3 years ago

Pirol62 commented 3 years ago

The problem

The update frequency of the interface is to slow so that some values, reportet by the netatmo app never appears in HA

Environment

Problem-relevant configuration.yaml

Traceback/Error logs

Additional information

Some screenshots and photos reporting the issue 20:50 Netatmo App Screenshot_20201201-205055_Netatmo 20:51 HA Display 20201201_205112 20:53 the history graph. It the one "Regen aktuell" Screenshot_20201201-205328_Home Assistant 20:54 20201201_205418 20:56 Screenshot_20201201-205615_Netatmo 20:57 Screenshot_20201201-205704_Netatmo 20:57 20201201_205715 20:59 20201201_205907 21:01 Screenshot_20201201-210108_Netatmo History Graph at 21:16 You can see, that the values above 0.3mm never have been reported to HA image

It seems, that the interface has a pull mechanism and the pull frequency is too slow.

probot-home-assistant[bot] commented 3 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)

cgtobi commented 3 years ago

I understand that missing values are very unfortunate but the polling limit of 10 minutes has been discussed with Netatmo and we wont change this. According to their API documentation the data is sent to the server every 10 minutes. Due to the fact how HA handles that data it is not possible to store historic data in hindsight, which leads to this exact behaviour.

ghost commented 3 years ago

@cgtobi I will piggyback on this a bit. I noticed for some time now, when I send a command to my netatmo valves from HA (either target temperature change or changing preset), they will apply almost immediately on the netatmo side, but HA will refresh the status result of this after a long amount of time. This confuses the heck out of my home users. I'm guessing this also because of the rate limit? Is some optimisation of this case possible?

cgtobi commented 3 years ago

@elfhack this is somewhat related but a different topic though. For valves (and cameras for that matter) this is being dealt with by making use of webhook events sent by Netatmo. If you instance is set up to receive webhook events the feedback would be instantaneous. So, no, I will not raise the polling frequency for energy devices either.

ghost commented 3 years ago

@cgtobi Hmm, but I do have them set up via nabu casa :/ Any protips on how to debug?

cgtobi commented 3 years ago

Turn on debug logging for netatmo and see if you receive webhook events.

ghost commented 3 years ago

@cgtobi I made it work, but ONLY after I used my own client id/secret. It still created the webhook using nabu casa URL, but it works perfectly now. With nabu casa auth it didn't work at all. Is it possible that nabu casas app id is rate limited as well?

cgtobi commented 3 years ago

There are other issues with that method that need to be resolved. You did the right thing.

Pirol62 commented 3 years ago

Ok, I don't like what I read but I understand, that there is no issue on HA side. I don't understand the architects on Netatmo side. When I design an interface in order to provide operative values, then it is common sense, that these values where pushed. The amount of listeners doesn't matter in this case. But ok, we have to accept this so far ;-) Thanks @cgtobi