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

**URL:** <https://community.victronenergy.com/t/how-add-calculations-for-modbus-energy-meter-dbus-modbus-client/2206>\
**Category:** Modifications\
**Created:** [4 September 2024 19:51 UTC](https://community.victronenergy.com/t/how-add-calculations-for-modbus-energy-meter-dbus-modbus-client/2206 "2024-09-04T19:51:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nemon21](https://avatars.discourse-cdn.com/v4/letter/n/2acd7d/32.png) [@nemon21](https://community.victronenergy.com/u/nemon21)\
**Post date:** [4 September 2024 19:51 UTC](https://community.victronenergy.com/t/how-add-calculations-for-modbus-energy-meter-dbus-modbus-client/2206/1 "2024-09-04T19:51:48Z")

</div>

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](https://github.com/pmcgn/dbus-modbus-client-kostal-smartmeter/blob/main/Kostal_SmartEnergyMeter.py)

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

---

<div class="post-metadata">

**Author:** ![MikeD](https://dub1.discourse-cdn.com/victron/user_avatar/community.victronenergy.com/miked/32/1522_2.png) [@MikeD](https://community.victronenergy.com/u/MikeD)\
**Post date:** [6 November 2024 19:12 UTC](https://community.victronenergy.com/t/how-add-calculations-for-modbus-energy-meter-dbus-modbus-client/2206/2 "2024-11-06T19:12:18Z")

</div>

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.
