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

RaspPI4 is slow to display graphs when Local Push is enabled #66

Open
Abruzzi04 opened this issue Oct 12, 2023 · 7 comments
Open

RaspPI4 is slow to display graphs when Local Push is enabled #66

Abruzzi04 opened this issue Oct 12, 2023 · 7 comments
Labels
feedback Feedback about the integration

Comments

@Abruzzi04
Copy link

Good afternoon, I have local push configured to avoid errors in status.xml. Because of this, updates are made every 1 second
This way the database is heavily underloaded. Just to view daily consumption, RaspPI4, takes a long time. On another occasion he told me about the "recorder", but it is not possible to edit the recording time on specific sensors.
Would there be another way, with local push configured, to change the polling interval? Thank you and congratulations for the work

@luuuis
Copy link
Owner

luuuis commented Oct 14, 2023

Hi @Abruzzi04, thanks for raising this.

Would there be another way, with local push configured, to change the polling interval?

Currently when an update is received the entity state is updated. Because Wibeee is sending an update every second then that will be the update frequency in HA and consequently in the recorder, I would have to ignore some updates to get around this.

If your HA is overloaded, one workaround would be to disable some sensors that update frequently (e.g. power, voltage, etc) if you are not using them. Then the integration will not cause as much data to be saved. Do you think this is an option?

What retention period is configured for recorder on your end? Also what version of HA and wibeee integration are you using?

@Abruzzi04
Copy link
Author

Oi@Abruzzi04, obrigado por levantar isso.

Haveria outra maneira, com push local configurado, de alterar o intervalo de polling?

Atualmente, quando uma atualização é recebida, o estado da entidade é atualizado. Como o Wibeee está enviando uma atualização a cada segundo então essa será a frequência de atualização no HA e consequentemente no gravador, eu teria que ignorar algumas atualizações para contornar isso.

Se o seu HA estiver sobrecarregado, uma solução alternativa seria desabilitar alguns sensores que são atualizados com frequência (por exemplo, energia, tensão, etc.) se você não os estiver usando. Então a integração não fará com que tantos dados sejam salvos. Você acha que isso é uma opção?

Qual período de retenção está configurado para o gravador do seu lado? Além disso, qual versão de integração HA e wibeee você está usando?

Hi @Abruzzi04, thanks for raising this.

Would there be another way, with local push configured, to change the polling interval?

Currently when an update is received the entity state is updated. Because Wibeee is sending an update every second then that will be the update frequency in HA and consequently in the recorder, I would have to ignore some updates to get around this.

If your HA is overloaded, one workaround would be to disable some sensors that update frequently (e.g. power, voltage, etc) if you are not using them. Then the integration will not cause as much data to be saved. Do you think this is an option?

What retention period is configured for recorder on your end? Also what version of HA and wibeee integration are you using?

Good morning. I'm currently using version 3.3.0... even if I reduce the number of entities, this won't help in visualizing data from just one entity. If I view an entity's data for one day, there are 86,400 entries. the graph takes time to load. I have the recorder that records all the time, because there are entities that are registered few times, but when they are registered, I need every second. and the recorder cannot specify just one entity. thanks

@luuuis
Copy link
Owner

luuuis commented Oct 16, 2023

Graphs should not really use the entity states for rendering, at least since HA 2022.10. In any case, graph performance is something to take up with HA core directly. For what it's worth, a 24 hour graph renders instantly on my HA and a 1-week graph could take 20 seconds the first time it is loaded (this is with SQLite). Since there have been no other reports. It's possible there is a problem specific to your install. Or perhaps RaspPI4 and/or your storage are not appropriate for serious HA use?

To be honest I have not really understood what you would like. You "need every second", well, you have every second. :) Perhaps if you can explain better and if this slowness becomes a problem for others as well we can do something about it. I will leave this open for now in case others want to add feedback as well.

PS Podes escrever em português.

@luuuis luuuis added the feedback Feedback about the integration label Oct 16, 2023
@luuuis luuuis changed the title Polling interval RaspPI4 is slow to display graphs when Local Push is enabled Oct 16, 2023
@Abruzzi04
Copy link
Author

Graphs should not really use the entity states for rendering, at least since HA 2022.10. In any case, graph performance is something to take up with HA core directly. For what it's worth, a 24 hour graph renders instantly on my HA and a 1-week graph could take 20 seconds the first time it is loaded (this is with SQLite). Since there have been no other reports. It's possible there is a problem specific to your install. Or perhaps RaspPI4 and/or your storage are not appropriate for serious HA use?

To be honest I have not really understood what you would like. You "need every second", well, you have every second. :) Perhaps if you can explain better and if this slowness becomes a problem for others as well we can do something about it. I will leave this open for now in case others want to add feedback as well.

PS Podes escrever em português.

Boa tarde novamente e muito obrigado pela ajuda. Em português vai ser bem mais fácil :)
Tenho um RaspPi4 de 4gb a rodar num SSD. Tenho muitos dispositivos, é facto, mas a lentidão que tenho nos gráficos do wibeee, é exclusiva. Tenho a BD do MariaDB, e está a guardar 3 sensores do wibeee. No browser (pq na app para iOS é muito pior), fui ver o tempo que o gráfico demora a carregar para o período de um mês: potencia exportada- 10s, potencia dos painéis- 30s, tensão e potencia da casas- 70s. Nos gráficos mais pesados nem dá para correr o mouse pelo gráfico pq tem muito delay. De referir que, para o mesmo período, qualquer outro sensor que tenha no HA é instantâneo e que, mesmo nos sensores do wibeee, o processador não passa dos 24% de uso. Já fiz outros testes noutro hardware e é igual. Nos sensor que estão a trabalhar 24 por dia, a guardar valores diferentes a cada segundo, dá 2 592 000 entradas no gráfico de um Mês…. É muita coisa para qualquer hardware processar e também ocupa muito espaço. Mesmo que o tempo de 70s não fosse o problema, os dados não dão para analisar devido ao delay no browser. A solução passaria por conseguir definir, a periodicidade a que aparecem/guardam os dados.

Obrigado

@luuuis
Copy link
Owner

luuuis commented Oct 17, 2023

I understand. This is a limitation of some cards built into Home Assistant and also of the data format used by HA to persist recorder state. It is not optimised for this use case.

For this kind of usage I recommend using a graph card that can leverage the long term statistics do render the graphs in a performant way. As an example, this apexcharts-card graph showing 6 months of data in my HA renders in 1 second. There is only one sample of data per hour that is stored in Long Term Statistics.

Home – Home Assistant 2023-10-17 16-04-00

type: custom:apexcharts-card
series:
  - entity: sensor.wibeee_xxxxxxxxxxxx_phase_voltage_l3
    statistics:
      type: mean
      period: hour
graph_span: 6 month

I will keep this in mind in the future when changing the entity updating code (which needs to happen anyway to fix #52).

@luuuis
Copy link
Owner

luuuis commented Jan 8, 2024

@Abruzzi04 I'm wondering if you've experienced any improvements after installation of 2023.12?

https://www.home-assistant.io/blog/2023/12/06/release-202312/#history-dashboard-showing-long-term-statistics

@Abruzzi04
Copy link
Author

Abruzzi04 commented Jan 10, 2024

@Abruzzi04 I'm wondering if you've experienced any improvements after installation of 2023.12?

https://www.home-assistant.io/blog/2023/12/06/release-202312/#history-dashboard-showing-long-term-statistics

Boas... Continua igual.... Exemplo: No browser, o historico de uma semana de um sensor de temperatura que tem um tempo de atualização de 5 minutos, carrega em 1 segundo. O do wibeee demora 14 segundos. Na app, 2 dias, o sensor de
temperatura demora 1 segundo, e o da wibeee demora 120 segundos... e depois de aparecer, ate bloquea a app. Isto quando está a usar dados guardados.

Com a nova atualização, a carrregar dados que estejam fora dos dados guardados (os dados estatisticos) é 1 segundo... tanto na app como no browser.

Em relação ao carregamento de dados guardados, vai ser dificil arranjar solução em quanto o HA estiver a guardar 86400 valores por dia, dos sensores wibeee. Quando carrega os dados estatisticos, está só a carregar 24 por dia.

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

No branches or pull requests

2 participants