question

mario79 avatar image
mario79 asked

BMV-700 value differences between CCGX and modbus

Welcome! I'm new to this forum.

I'm a happy owner of an off-grid setup: Quattro 48/8000, BMV-700, MPPT 250/85 (15 solars @250W), Sunny Boy 2.5 (10 solars @250W), CCGX, and lead-acid 48V 800Ah. The setup has around 5 years.

Recently I discovered Home Assistant (the main goal being to automate car charging only when batteries are full and there is a surplus of energy). The first tests are very positive :)


Incidentally, I discovered a potential glitch...
I'm using Modbus to integrate CCGX in HA, and the values I used for Wallbox are correct (at least similar to what I see in CCGX), that is:
- com.victronenergy.battery Battery voltage
- com.victronenergy.battery Current
- com.victronenergy.battery State of charge
- com.victronenergy.system AC Consumption L1

But when I started (out of curiosity) to play with Charged Energy and Discharged Energy (from BMV history) the Modbus gave me very strange values...

1669321128140.png

The values I see in HA:
1669321356066.png
the definition of sensors in HA:
1669321214604.png

and the templates to apply scalefactor:
1669321307171.png

The definition in HA is fairly simple (and it works fine for other values), so I wonder if it can be a Modbus or BMV issue?

BMV Battery MonitorModbus TCPlead-acid
1669321128140.png (21.4 KiB)
1669321214604.png (9.8 KiB)
1669321307171.png (19.4 KiB)
1669321356066.png (7.4 KiB)
2 |3000

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

3 Answers
wkirby avatar image
wkirby answered ·

How come you are using a template to scale the values?
Surely it would be easier to scale them directly in your modbus.yaml?
Try something like this and see if that will be any better:

- name: "Battery Voltage"
scan_interval: 5
unit_of_measurement: "V"
slave: 225
address: 259
scale: 0.01
precision: 1

- name: "Battery Current"
scan_interval: 5
unit_of_measurement: "A"
slave: 225
address: 261
scale: 0.1
precision: 1


2 |3000

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

mario79 avatar image
mario79 answered ·

Thanks @WKirby !

I'm new to HA, I felt my config is not optimal :)

scaling in modbus.yaml works indeed :)


Anyway, with the (dis)charged energy numbers, it's simply because the high-order bits are discarded while converting to uint16... and then when converting back to a signed type, if the most left bit is 1, the value becomes negative... No more questions :)

2 |3000

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

mario79 avatar image
mario79 answered ·

ok, I just realized that the range of those 2 values in Modbus is 0 to 6553.5, and the real values I can see in BMV are way out of that range...

Any idea how to make use of out-of-range values?
The negative value wonders me the most ;)

Is resetting the BMV history the only option?

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

Modbus TCP Basics

Victron BMV battery monitors product page

Additional resources still need to be added for this topic