question

Thomas Manthey avatar image
Thomas Manthey asked

How can I access VenusO's system trigger to read consistent data?

I want to include a virtual battery with Agregate Battery in my system.
https://github.com/arrow1800/Victron-VirtualBattery
As far as I have seen, this calculation also only accesses the D-Bus data pool asynchronously in a grid of 1s, in which all processes store their data.
Since data acquisition is not trivial in such a distributed system with various measurement points, signal delays due to bus systems, etc., I would like to be able to provide the ESS assistants running on the multis with as "clean" a value as possible by calculating the totals and mean values whenever a value has been updated by the SmartShuts. This is before the ESS Wizard uses the value.
Are there system triggers in VenusOs that indicate that a measurement has just been updated?

Venus OSSmartShunt
4 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.

matt1309 avatar image matt1309 commented ·

So what you're aiming to do is the same as what VirtualBattery does but reduce the overhead/time of data getting into the system/manipulated by node red and then sent via MQTT into Virtual Battery? Have i understood?

This is above my python/venus os knowledge/experience to give actual code example but I think you can monitor dbus directly for change either on a short loop or there may be built in event based method (I think onChange method does exist) to alert when dbus has been updated. Then as long as you have dummydevice driver setup for battery you could write data directly to the virtualbattery via dbus rather than MQTT.

This might help: velib_python/vedbus.py at master · victronenergy/velib_python · GitHub

You may get better/more detailed responses if you move this to modifications space on here

0 Likes 0 ·
kevgermany avatar image kevgermany ♦♦ matt1309 commented ·
@Thomas Manthey

@matt1309

Moved to modifications as per suggestion

0 Likes 0 ·
Thomas Manthey avatar image Thomas Manthey kevgermany ♦♦ commented ·

Hi matt1309,

I just don't want to do the calculation at some point, but when there is a new value.

The SmartShunts are both connected via a serial to USB adapter and deliver their values independently of each other in a time grid of some kind. Since there are several values (current, voltage, SOC), they should be processed and calculated together.

In the meantime, I'm not even sure if a change is needed. I may be able to achieve what I want with Linux system triggers.

In any case, I have found a block in NodeRed that can "observe" a file and that delivers a trigger when a change is made.

Maybe this trigger is suitable for this purpose.

0 Likes 0 ·
matt1309 avatar image matt1309 Thomas Manthey commented ·
Maybe reading data directly from smart shunt via USB/serial connection but that's above my understanding of the system.

I would have thought monitoring dbus for change would be fast enough for most purposes.

Unless you're really pushing limits of your battery capabilities the slight time lag shouldn't be detrimental.

Sorry I couldnt help further

0 Likes 0 ·
0 Answers