question

petajoule avatar image
petajoule asked

making use of programmable relays in ESS

Given medium size(?) installation:


3 x Quattro 5kVA in 3-phase configuration

2 x MPPT 250/85 - evidently DC coupled

1 x Fronius Symo - AC coupled

1 x Venus GX


on last count, the docs mention a total of 13 (2 x 1 of the MPPTs, 2 in the Venus GX and 9 in the Quattros) programmable relays, where the 9 (3 x 3) of the Quattros probably behave like just 3 (yes?) in sync.


I'm missing the relay functions in Venus and Quattros under ESS operation. There is docs for the MPPT relay functionality.


Ideally, I would like the Venus GX relays to indicate various "excess energy" states. I can get a "battery full", but on top of that I would need


* "MPPTs are (about to) being throttled"

* "Fronius is (about to) being throttled"


So this could trigger some consumers to shave off some of the excess energy. HowTo?

ESSRelay
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.

usernamepasswordbs avatar image usernamepasswordbs commented ·
#Petajoule Did you get anywhere with "MPPTs are (about to) being throttled"?

Is it in the code somewhere?

Much appreciated if you can tell me.

0 Likes 0 ·
3 Answers
mihair avatar image
mihair answered ·

As far as I know, you can use either dbus or node-red

Personally I prefer to define a script using dbus and then to run it with crontab.

As an example of controlling relays:

#dbus -y com.victronenergy.system /Relay/1/State SetValue 1

Above command will set Relay1 ON (close contacts)

you can check if it is closed or not by issuing :

#dbus -y com.victronenergy.system /Relay/1/State GetValue

Please use dbus-spy to get all the paths for you script

As another example, here is a small script which I use to interrogate EM111 grid meter for TotalEnergy, L1 AC voltage and current:

#!/bin/bash

RE=`dbus -y com.victronenergy.grid.cgwacs_ttyUSB2_di32_mb1 /Ac/Energy/Reverse GetValue | awk '{printf("%d\n",$3 + 0.5);}'`

FE=`dbus -y com.victronenergy.grid.cgwacs_ttyUSB2_di32_mb1 /Ac/Energy/Forward GetValue | awk '{printf("%d\n",$3 + 0.5);}'`

TE=$(($FE+$RE))

echo Total Energy $TE kWh

ACC=`dbus -y com.victronenergy.grid.cgwacs_ttyUSB2_di32_mb1 /Ac/L1/Current GetValue | awk '{printf("%d\n",$3 + 0.5);}'`

echo Current $ACC A

VCC=`dbus -y com.victronenergy.grid.cgwacs_ttyUSB2_di32_mb1 /Ac/L1/Voltage GetValue | awk '{printf("%d\n",$3 + 0.5);}'`

echo Voltage $VCC V





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.

petajoule avatar image petajoule commented ·

Thx. It looks dbus is offering all the data necessary.

Unfortunately I seem to have trouble reading out any values:

root@ccgx:~# dbus -y com.victronenergy.system/Ac/ConsumptionOnOutput/L1/Power GetValue
root@ccgx:~# dbus -y com.victronenergy.system/Ac/ConsumptionOnOutput/L1/Power         
/
root@ccgx:~# 

And omitting -y is even more adventurous.

root@ccgx:~# dbus com.victronenergy.system/Ac/ConsumptionOnOutput/L1/Power GetValue
Traceback (most recent call last):
  File "/usr/bin/dbus", line 302, in <module>
    bus = dbus.SessionBus()
  File "/usr/lib/python2.7/site-packages/dbus/_dbus.py", line 211, in __new__
    mainloop=mainloop)
  File "/usr/lib/python2.7/site-packages/dbus/_dbus.py", line 100, in __new__
    bus = BusConnection.__new__(subclass, bus_type, mainloop=mainloop)
  File "/usr/lib/python2.7/site-packages/dbus/bus.py", line 122, in __new__
    bus = cls._new_for_bus(address_or_type, mainloop=mainloop)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NotSupported: Using X11 for dbus-daemon autolaunch was disabled at compile time, set your DBUS_SESSION_BUS_ADDRESS instead


Still sitting here on 2.33, but that shouldn't be the problem - should it?

I should mention that dbus-spy seems to work well, so it doesn't look like the system would be broken or something. Just the method getting info via shell doesn't work for me.


0 Likes 0 ·
petajoule avatar image
petajoule answered ·
root@ccgx:~# dbus -y com.victronenergy.system /Ac/ConsumptionOnOutput/L1/Power GetValue
443

A space a day, keeps dbus at bay.

2 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.

mihair avatar image mihair commented ·

If you wanna get something like 433 W, then use GetText instead of GetValue

0 Likes 0 ·
petajoule avatar image petajoule mihair commented ·

GetValue is fine, as we need to make comparisons of the value (arg1 -ge arg2) etc.

Still fighting here to use dbus-send directly instead of dbus -y, as the latter is slow as ... metabolism result.

0 Likes 0 ·
petajoule avatar image
petajoule answered ·

A few more questions remain:

How's the return value after a SetValue to be interpreted?

root@ccgx:~# dbus -y com.victronenergy.system /Relay/0/State SetValue 1
0

Or here:

root@ccgx:~# dbus -y com.victronenergy.system /Buzzer/State SetValue 1
2

And how can one make sure the value set also remains set?

e.g. setting that buzzer, it blips shortly and is then off again. Haven't checked the relay, but I assume that wil lbehave the same?

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

What is ESS training video

ESS Quick Installation Guide

ESS design and installation manual