Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HomeAssistant - base de données remplie à cause d'extra_states_attributes #174

Open
helepeut opened this issue Feb 5, 2023 · 6 comments

Comments

@helepeut
Copy link

helepeut commented Feb 5, 2023

Bonjour,

Je vous écris car j'ai actuellement un soucis en cours de résolution avec bdraco, qui travaille sur la partie MariaDB de HomeAssistant.
Depuis quelques temps, j'ai d'énormes lenteurs dans la purge des données d'historique.

En regardant de plus prêt, il semblerait qu'il y ait un soucis avec la quantité de données remontées par le ZLinky_TIC (possiblement en mode PRODUCTION).

bdraco me demande de contacter le développeur de l'intégration - je ne sais pas si c'est à vous que je dois m'adresser, de ce fait j'ai aussi laissé un message à l'équipe Zigbee2MQTT que j'utilise pour remonter les données du ZLinky_TIC. En espérant que cela puisse faire avancer la science !

Le message de bdraco est le suivant :

_Please send a note to the dev that develops that integration

https://developers.home-assistant.io/docs/core/entity#generic-properties

DANGER
Entities that generate a significant amount of state changes can quickly increase the size of the database when the extra_state_attributes also change frequently. Minimize the number of extra_state_attributes for these entities by removing non-critical attributes or creating additional sensor entities._

Le thread concernant le problème en question : home-assistant/core#87352
La discussion ouverte avec Z2M : Koenkk/zigbee2mqtt#16549

@fairecasoimeme
Copy link
Owner

@vk496 did you see this issue. What do you think ?

@vk496
Copy link

vk496 commented Feb 6, 2023

yes, this is a well-known issue. That's why I created a kind of "filters" to not expose attributes that doesn't make sense with your current tarif. My advice for this issue:

  • Select the proper linky_mode, phase, production in Z2M
  • Select a tarif or which attributes you want with tic_command_whitelist (extra options Z2M)
  • Adjust the minimum time for notifications for zlinky in Z2M
  • Restart Z2M to take effect

The first two points can be replaced with disabling the entities from Home Assistant (I would personally do both, just in case)

@helepeut
Copy link
Author

helepeut commented Feb 6, 2023

Thanks !
This is more or less what I did early January when I saw the quantity of messages and attributes that were surfacing. So I decided to just keep the 2 attributes I wanted for my Production Linky (using the whitelist). But the database was already filled with these data, and I can't purge it in reasonable time.
Bdraco used this database to update the db optimizer (I guess for a next release), and he just pointed me this warning in order to send it back to you.
It might be worth adding this warning in the documentation ?

@BrunoSpy
Copy link

I don't know if I understood everything so forgive me if my question is silly : I think the issue is with the amount of attributes attached to each sensor.
Why do we have this for each sensor :
image

@ellmout
Copy link

ellmout commented Jul 12, 2023

Hello @BrunoSpy,
In Z2M, in Settings, Home Assistant Integration, disable "Home Assistant legacy entity attributes".
When enable :

  # Optional: Home Assistant legacy entity attributes, (default: shown below), when enabled:
  # Zigbee2MQTT will send additional states as attributes with each entity. For example,
  # A temperature & humidity sensor will have 2 entities for the temperature and
  # humidity, with this setting enabled both entities will also have
  # an temperature and humidity attribute.

@BrunoSpy
Copy link

Thank you. That was well hidden :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants