MaxDischargePower settable from 'outside'?

I have a question for the tinkerers using MQTT. Is the setting below in any way settable from the outside like MQTT? From what I can see I have the ability to set it to eg. ‘0’ but then a few seconds later it goes to ‘-1’ (full taps) again. Strangely, if I do this in dbus-spy it stays on the value I set.

Settings/CGwacs/MaxDischargePower

The reason for my question is that I part of the small-battery-community and we started with the dreaded Eskom TOU tarrif structure a while ago. I can use most of the grid during the Off-Peak period but feeding back during Off-Peak time slots are difficult as the only PV slots are weekends. I would much rather use the ‘Standard’ slot from the grid and save the battery power for Peak and Off-Peak. At least I can feed back Standard usage during the day.

To achieve this my thinking was to have Home Assistant disable the battery discharge as soon as I go from Peak to Standard and then enable discharge when it goes from Standard to Off-Peak at around 10pm. This will limit the grid usage during Off-Peak periods even by a small amount. I am not ready for a bigger battery yet but I know it’s the proper solution to this problem. And No, I am not using the Node-Red image, HA is all I use.

There isn’t anything on the GX device that sets that value.

What I will usually do, to debug that, is on the GX device you run this:

dbus-monitor --system path=/Settings/CGwacs/MaxDischargePower,member=SetValue

Then you do the thing that causes the value to change, and then you will see a line similar to this…

method call time=1769086807.709450 sender=:1.102 -> destination=com.victronenergy.settings serial=115 path=/Settings/CGwacs/MaxDischargePower; interface=com.victronenergy.BusItem; member=SetValue
   variant       double 1000

Now you want to know who is sender=:1.102, so you do:

dbus-send --system --print-reply --dest=org.freedesktop.DBus / org.freedesktop.DBus.GetConnectionUnixProcessID string::1.102

And that is going to give you the process id of whatever made the call, and then you can do:

ps | grep 1234 # or whatever the pid was

And now you know who is called SetValue.

I do this when I need to prove to a customer it is his own modbus stuff doing the setting… :slight_smile:

1 Like

Great! Let me delve into this and see who sets it back.

Thanks. This was very interesting. I found a small syntax error and after fixing it it now works like a charm.

1 Like