How add calculations for modbus energy meter (dbus-modbus-client)

Hello all,

I would like to add a higher resolution to the Kostal KSEM energymeter. Unfortunately, not all of the necessary values ​​are made available via Modbus registers: dbus-modbus-client-kostal-smartmeter/Kostal_SmartEnergyMeter.py at main · pmcgn/dbus-modbus-client-kostal-smartmeter · GitHub

Is there a way to perform my own calculations in the device.EnergyMeter class and publish the results to the dbus? Unfortunately, I couldn’t find any examples in the code…

Bests
nemon21

I think that you should be able to do this, however, you will be treading a new path (I expect).
I have managed to generate some code that reads modbus values from a BMS, then feeds those values to the Venus OS running on a BBB, using D-Bus. this work was based on the original DBus serial battery by Lois Van der Walt. As long as you are not limited by the D-Bus signals that Venus will cope with, or their resolution limits, it should be ok.