suaveolent / ha-hoymiles-wifi

Home Assistant custom component for Hoymiles DTUs and the HMS-XXXXW-2T microinverters
MIT License
96 stars 5 forks source link

Update 0.2.2 causes energy dashboard to break #37

Closed N3rdix closed 1 month ago

N3rdix commented 1 month ago

Describe the bug Although it is mentioned in the code that the new workaround for #32 should handle zero values correctly it seems to break something. I have updated to 0.2.2 yesterday and now the total energy sensors jump to zero at night and jump back to the original value when the DTU starts at morning. This of course leads to incorrect solar production values as in my example.

To Reproduce Steps to reproduce the behavior:

  1. Update to 0.2.2
  2. Add the total energy sensors to the energy dashboard
  3. See error

Expected behavior The total energy sensors should not reset to zero at all.

Screenshots

image image image

Additional context Temporary workaround can be to delete the outlier values every day, so at least nothing will break hard πŸ˜„

suaveolent commented 1 month ago

Thanks, you are right. Will provide a fix later today.

suaveolent commented 1 month ago

One more comment: you should not use total energy for the energy dashboard.

If you restart your home assistant instance and the inverter is not available it might return 0 anyway.

Instead use daily energy. It works just as intented even if the sensor is set to 0.

N3rdix commented 1 month ago

One more comment: you should not use total energy for the energy dashboard.

If you restart your home assistant instance and the inverter is not available it might return 0 anyway.

Instead use daily energy. It works just as intented even if the sensor is set to 0.

Thanks for that hint, will look into this although I did not have any trouble yet (luckily). Historically I've added total (total_increasing) sensors the past years, but according to the HA docs your advice might be the best choice πŸ‘

suaveolent commented 1 month ago

v0.2.3 should fix the problem.

N3rdix commented 1 month ago

Thanks for the quick resolution, awesome work πŸ‘

suaveolent commented 1 month ago

Youβ€˜re welcome. With the fix you should be able to keep using the total sensor.