SWW13 / homeassistant-victron-ir-ble

Home Assistant Victron Instant Readout BLE Integration
MIT License
8 stars 2 forks source link

Add Energy Meters for HA Dashboard #5

Open snipah opened 10 months ago

snipah commented 10 months ago

Hi and congrats to the great plugin which works like a charm.

Would it be possible to implement energy meters for the HA Energy Dashboard, just like it the batmon_HA plugin?

https://github.com/fl4p/batmon-ha



Batmon implements energy metering by computing the integral of power values from the BMS with the trapezoidal rule. You can add theses meters to your Home Assistant Energy Dashboard or use them with the HA Helper Utility Meter, see [doc/HA Energy Dashboard.md](https://github.com/fl4p/batmon-ha/blob/master/doc/HA%20Energy%20Dashboard.md).

Total Energy Discharge Meter: total Energy out of the battery (increasing only, use this for the Energy Dashboard)
Total Energy Charge: total Energy into the battery (increasing only, use this for the Energy Dashboard)
Total Energy: The total energy flow into and out of the battery (decreasing and increasing). This equals to (Total Energy Charge) - (Total Energy Discharge). It will increase over time because batteries are not ideal. You can create a derivative helper to compute energy flow within e.g. 24h.
Total Cycles: Total full cycles of the battery. One complete discharge and charge is a full cycle: SoC 100%-0%-100%. This is not a value provided by the BMS, Batmon computes this by differentiating the SoC ( e.g. integrate(abs(diff(SoC% / 100 / 2)))).
The accuracy depends on the accuracy of the voltage and current readings from the BMS. Consider these having an error of 2~5%. Some BMS do not detect small currents (<200mA) and can miss high frequency peaks, leading to even greater error.```
SWW13 commented 10 months ago

Thanks :)

Sounds like a useful feature, I would however prioritize fixing the config flows when I find time work on this integration. I'm also happy to take pull requests, I'm not familiar with HA integrations so I can't give much guidance.