question

dennis avatar image
dennis asked

How to get consumption via API or Modbus?

Hi,


how to get this values via API or Modbus without calculating by my own?


Thans a lot!

gx device
1603958222287.png (10.8 KiB)
1 comment
2 |3000

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

teemischer avatar image teemischer commented ·

thanks, I have exactly the same question, so I would like to raise this topic again @mvader (Victron Energy).


The VRM site shows us calculated values of energy (kWh) just fine, thanks for adding the widgets, really appreciated!

But those values are nowhere to be found within the GX system. I would to be able to read those via Modbus/MQTT as well.

I know that some of the values have to be somewhere in the GX system:

- dbus spy shows kWh within the PV Inverter instances.

- And the Remote Console shows kWh history within the MPPT instances

I just can't access those through Modbus.


Feature Request:

Could you please add aggregated counters for "total energy" Counters into Venus?

(All those "Today Counters", just like the ones shown in the screenshot above)

0 Likes 0 ·
5 Answers
mvader (Victron Energy) avatar image
mvader (Victron Energy) answered ·

Hi both,

Those aggregrates are not available in Venus OS. They really aren't. Instead there is a whole series of counters, of some of which overflow quite regularly (the ones in the VE.Bus inverter/charger); and then there is code to clean that up and send the increments of all counters to VRM, on a 15 minute interval.

Making those available on Modbus-TCP is no small feat I'm afraid. It would probably mean adding a database, and many other things.

All "normal" ones are available: charged/discharged kWh from the battery monitor, as well as various kWh counters for the solar charger and also for the pv inverter and grid meter I see kWh counters in the modbustcp list.

Matthijs

7 comments
2 |3000

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

peternielsen avatar image peternielsen commented ·

@mvader (Victron Energy) I guess what you are trying to say is that one can calculate those number himself from the raw data in the Venus correct ? I guess that's what the VRM portal does. Maybe you could point to the counters to be used to so we could calculate ourselves the values that VRM does ? I know this doesn't help @dennis since he doesn't want to calculate himself but i would be interested at least.

0 Likes 0 ·
teemischer avatar image teemischer commented ·

Hi, Thanks for the reply.

I do understand what you are saying, but I have not explained the background of my request enough.


I was not in any way suggesting to add VRM functionality or a database into Venus OS. I am simply looking for more consistency in Venus when it comes to the kind of counters which are available. I only want the daily aggregate for Energy Counters, and it would even be fine for those counters to reset/zeroed on a daily basis. (e.g. keep those counters in memory and lose them on reboot.)


Specific examples for inconsistencies in counters:

- Daily kWh Imported from Grid, are already available in dbus and Modbus (so yes, it is possible, in line with your initial reply)

- BUT: Daily kWh Exported to Grid, available only in dbus but NOT as Modbus counter (why not in both places?), at least my EM24 does report this to dbus, but Venus does not proxy it modbus.

- Battery kWh in and out are both available in dbus and Modbus. Great! (which proves my point, you already have energy counters in Venus, but not for all devices yet.)

- PV Energy generated via MPPT, available both in dbus and Modbus. Not just for today, but also for yesterday. Good!

- BUT: PV Energy generated via AC Inverters (all three kinds: AC IN, AC OUT, Genset) are not available anywhere. How come?


So to sum up:

- Everywhere you have Power counters, please provide counters for Daily Energy counters within dbus

- Also please provide both those Power and Energy counters via Modbus

- I am totally fine with all other "fancy" calculations being done in VRM, like it a lot!


thanks and best regards




0 Likes 0 ·
mvader (Victron Energy) avatar image mvader (Victron Energy) ♦♦ teemischer commented ·

I understand what you mean; and we'll look at this; but not in the immediate future.

Meanwhile, if you want to add data to Modbus that is already on D-Bus you can do so quite easily yourself. See attributes.csv, on your GX Device; as well as here:

https://github.com/victronenergy/dbus_modbustcp/blob/master/attributes.csv


And, when logged into your GX Device, use dbus-spy to browse through all data available on D-Bus.


And to see what the inverter/charger makes available, look at the service that has vebus in its name.

0 Likes 0 ·
ekkesa avatar image ekkesa mvader (Victron Energy) ♦♦ commented ·

@mvader (Victron Energy) I'm also trying to replicate these values. Is it possible to assist and point out the registers/dbus paths used in these calculations.


It will be greatly appreciated!

0 Likes 0 ·
Stijn Dhondt avatar image Stijn Dhondt ekkesa commented ·
@mvader (Victron Energy) Please be aware that for integrating with Home assistant allot of major vendors support this out of the box...


It makes quite allot of sense to have this data available and even supported for home assistant especially as both are dutch products and people wil start asking for these numbers without the need of a cloud based datasource...

If you want more info just send me a message!

Regards,

Stijn

0 Likes 0 ·
mvader (Victron Energy) avatar image mvader (Victron Energy) ♦♦ Stijn Dhondt commented ·
Hi, fully understood. And I'd like to have this properly available. Making that is quite a project; so it will only happen once several other projects are finished.
0 Likes 0 ·
ekkesa avatar image ekkesa Stijn Dhondt commented ·

@Stijn Dhondt Hi, How do I contact you for more info? I do not see a message option on the site - Perhaps I'm just overlooking it... Thank you!

0 Likes 0 ·
Ulrich avatar image
Ulrich answered ·

If you use Grafana then you can make it. Like

1612199765977.png


1612199765977.png (46.2 KiB)
1 comment
2 |3000

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

teemischer avatar image teemischer commented ·

Ulrich, I know about Grafana, thanks for the reply, though.

Of course there are many ways to have external tools/platforms calculate the kWhs.


But I was asking to have the daily kWh values to be provided by Venus directly for ALL relevant devices (Inverters, Genset, MPPT, Battery, Consumption etc), and also to be consistent in where they are being displayed (some is in dbus, but only some are proxied to Modbus. )


0 Likes 0 ·
mikhail-petukhov avatar image
mikhail-petukhov answered ·

dbus for com.victronenergy.vebus.ttyO5

Energy/AcIn1ToAcOut                                                      1.51kWh
Energy/AcIn1ToInverter                                                  17.88kWh
Energy/AcIn2ToAcOut                                                      0.00kWh
Energy/AcIn2ToInverter                                                   0.00kWh
Energy/AcOutToAcIn1                                                      0.00kWh
Energy/AcOutToAcIn2                                                      0.00kWh
Energy/InverterToAcIn1                                                   0.00kWh
Energy/InverterToAcIn2                                                   0.00kWh
Energy/InverterToAcOut                                                  63.52kWh
Energy/OutToInverter                                                   127.78kWh

This data form inverter, but this is cumulative data from inverter start up, not a daily basis. Some additional process should create new daily basis entry for each counter.

Probably current Energy data can be added to the Modbus without large development. Daily data can be generated on a remote platform on the fly after each update from Venus, like VRM does.

2 |3000

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

morphy avatar image
morphy answered ·

Hello,

I am also working my way towards Grafana dashboard. Using IOBroker to read the modbus data and push it to Influx and from there Grafana to represent (basic setup, I guess).

Using a MP2, Cerbo, MPPT, Seplos Battery.

AC connected to AC in-1.

I am currently playing with the modbus addresses and device IDs to get the energy values, but failed to get any of them from my MP2.

The MP2 is listed with unit ID 227, I am able to read address 33 for the switch, which I control to shut down the MP2 in case of low SOC. Modbus adapter in IOBroker:

switch-data-point.png

Now I add this next data point for Energy from Solar to Battery:

2datenpunkt-mp2.png

Checking objects in IOBroker, address 33 returns a good value, but address 3136 gives me a
"0x20 - substitute..

objekte-iobroker.png

Any hint for me to get kWh values out of my MP2?


Cheers!

Andy


1 comment
2 |3000

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

mvader (Victron Energy) avatar image mvader (Victron Energy) ♦♦ commented ·

Hi, I can’t help with the modbus issue.


But pls be aware that we have code to load from mqtt to influx. Which I would recommend over the modbus route.

And besides our code, there are many more projects to load data thats coming in over mqtt.

Ours:

https://github.com/victronenergy/venus-influx-loader

(Just now got moved, make sure to look at the recent commit history)

0 Likes 0 ·
Henning Schewe avatar image
Henning Schewe answered ·

I would like to come back to the origin of this thread. I would really appriciate if Victron would implement the "Consumption" information in mqtt.

I do not have a stand-alone solution, but operate the Multiplus II normally as an inverter with feed-in to the grid. My goal is to calculate how much I save in euros through my PV system. To do this, I need to know what my house consumes. From this I can then subtract what I draw from the grid. This difference multiplied by the electricity price gives my savings.

I wouldn't care whether I got the daily or total consumption. I record the values with InfluxDB, evaluate them and visualize them in Grafana. Unfortunately, I have not yet found a useful solution for determining the consumption.

1689084419468.png



1689084419468.png (74.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.

Related Resources

Additional resources still need to be added for this topic