Idea

alexdrean avatar image
alexdrean suggested

How to invert Generator Start/Stop output

I want to run dump loads when my system has an excess of PV power available.

Whether it's a water heater, EV charger, or air conditioner, I pretty much want to run them as a "not generator". If there is no overload, overtemperature, or any other alarm, and SOC is high, I want to turn on my dump load.

A clever way to achieve this is using the Generator start/stop feature of the Cerbo GX and inverting the output. Simply hook up a relay to the NC side of the Generator Relay output and you can run a "not generator". Whenever the Cerbo GX wants to run the generator, it really just turns off the dump load.

Now, the Color Control GX does not have a NC side; only NO. So no inverting the output possible.

I made a small modification to the Generator start/stop code to allow that.

If enough people show support, I may turn this into a real feature you can turn on/off and submit a pull request for it.

To invert the Generator start/stop input on a GX device:

  1. Follow the Venus OS: Root Access guide until you have access to a root shell on the GX
  2. nano /opt/victronenergy/dbus-generator-starter/relay.py
  3. Navigate to the bottom of the file, and replace
    def _get_remote_switch_state(self):
        return self._dbusmonitor.get_value(self._remoteservice, '/Relay/0/State')


    def _set_remote_switch_state(self, value):
        self._dbusmonitor.set_value_async(self._remoteservice, '/Relay/0/State', value)

with

    def _get_remote_switch_state(self):
        res = self._dbusmonitor.get_value(self._remoteservice, '/Relay/0/State')
        if res == 0:
            return 1
        if res == 1:
            return 0
        return res


    def _set_remote_switch_state(self, value):
        final = value
        if value == 0:
            final = 1
        elif value == 1:
            final = 0
        self._dbusmonitor.set_value_async(self._remoteservice, '/Relay/0/State', final)

4. Reboot the GX. The Generator relay output is now inverted. Enjoy!


Moderators, feel free to edit this post for clarity.

Generatoroffgrid
2 |3000

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

1 Comment

Rob Duthie avatar image
Rob Duthie commented

Hi

You can just load a assistant to do this and and contol the relay that way and also invert it in the genset setting assistant.

I have done this a few times with clients with excess PV with hot water heating by using the SOC .

Regards
Rob D

NZ

2 |3000

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

Your Opinion Counts

Share your great idea, or help out by voting for other people's ideas.