question

dmq avatar image
dmq asked

ConsumedAmpHours of Battery thrugh modbus or mqtt

Dear community,

I have got a MP II + Cerbo + Pylontech Bat Stack. I am totally happy with all the data I can read out / set / work with. I am missing one value: I want to read out Wh / Ah which were provided through the battery (not DC solar through the chargers).


In the CCGX-Modbus-TCP-Parameter overview I found the following value:


com.victronenergy.systemBattery Consumed Amphours (System) 845 
/Dc/Battery/ConsumedAmphours


It is also be provided through mqtt.

But in my setup I get no data through it (I do not have an extra Battery Monitor).

Is there another parameter I could use? I could do a calculation:

$INVERTED_POWER_FROM_DC_TO_AC_THROUGH_MPII - $DC_SOLAR_GENERATED_THROUGH_CHARGERS.


Thanks

MQTTbattery capacity
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

4 Answers
mikhail-petukhov avatar image
mikhail-petukhov answered ·

In case of Pilontech really could not provide ConsumedAmphours over the CAN, probably calculation could by done based on known full battery capacity and SOC. ConsumedAmphours = full battery capacity - full battery capacity * SOC / 100. But SOC value from Pilontech has 1% unit step, in case of your battery 400 Ah, ConsumedAmphours will changed with 4 Ah step.

Any way, it will allow to write python script to populate/update value of dbus data com.victronenergy.system ConsumedAmphours and read this data over the Modbus. Or you can read SOC over Modbus and perfom calculation on the your external platform.

Try ssh connection to the venus and run dbus-spy tool. For my system with battery monitor from dbus-spy:

com.victronenergy.system
Dc/Battery/BatteryService                      com.victronenergy.battery.ttyUSB0
Dc/Battery/ConsumedAmphours                                              -0.9 Ah
com.victronenergy.battery.ttyUSB0
ConsumedAmphours                                                          -0.9Ah
Devices/0/ProductName                                                    BMV-700
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

dmq avatar image
dmq answered ·

Thanks @Mikhail Petukhov. I see you have a BMV-700 monitor integrated. With this device the value is filled. But with the Pylontech Battery it is not possible - neither through modbus nor through mqtt (which should address the same data source / dbus - same as dbus-spy).

I will calculate it externally - thanks again.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

dmq avatar image
dmq answered ·

The only other issue is that the Battery SOC can increase through AC and DC Charging and I just want to get the net consumed amp hours - I have to add something ($BATTERY_CHARGED_AH_BY_DC|AC) to the calculation.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

lynckmeister avatar image
lynckmeister answered ·

Hi I still habe trouble with this value ... within dbus-spy I can see the value like c/Battery/ConsumedAmphours filled with the values which come in my case from my BMS ... but in modbus I always get 0 ...

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Related Resources

Victron MQTT readme

Additional resources still need to be added for this topic