StephanJoubert / home_assistant_solarman

Home Assistant component for Solarman collectors used with a variety of inverters.
Apache License 2.0
510 stars 190 forks source link

Remove out of scale values (outliers) #409

Open kavejo opened 9 months ago

kavejo commented 9 months ago

Leaving this here in case there is appetite.

I am using the definitions sofar_g3hyd (which I updated) but I believe this problem could be common to other definitions as well.

It happens sometimes that some of the readings are out of scale (i.e. PV production is let's say 4 KW, and it's near that value for a number of reads, then out of a sudden the next reading could be something like 1560 KW, totally out of scale and not a possible value). The same could apply to other sensors (battery charge, battery discharge, consumption, etc.).

This causes the energy dashboard to show incorrect values and incorrect price estimates. So far, this seems rare - to me it happens 2-3 times per month, at random dates/times.

Thought of creating this Issue to see if there are other seeing the same issue, and checking if there is anybody who would consider reviewing whether it's possible to only record a successful read if the value is in an acceptable range.

Thanks!

ChirpyTurnip commented 9 months ago

You could correct this using NodeRed....just let it read in the raw data, filter it (and do whatever else you want) and then write the outputs out to another set of entities in HA....it is the filtered/checked entities that you then use in your displays and energy dashboard.

You could also do this with template sensors, but I just find those really fiddly if you need to apply logic of any type.... :-(