Node RED flow triggered by Firmware update via VRM

I have an boat installation where the Onan generator is stopped and started based on de SOC of the installation.

As Onan needs a start and stop pulse the default generator start and stop function build into the Cerbo does not work without additional hardware.

I have created a Node Red flow to use both relais in the Cerbo to give the start or stop pulse, see the flow below.

This works perfectly and the generator is started once to SOC goes below 20% and the generator will stop once above 95%.

I noticed that when requesting the firmware versions via VRM (device list → Firmware Update) the generator would start no matter what the SOC was at that time.

This happened with FW 3.47 on the Cerbo, which I now upgraded to version 3.79 and still have the same result.

I can’t imagine that this is expected behavior, now I have to disconnect the remote start cables when I leave the boat as I don’t want the generator to run when I’m not there.

[
  {
    "id": "df3e8dc87680074d",
    "type": "victron-input-system",
    "z": "553fb34cb7d48a4d",
    "service": "com.victronenergy.system/0",
    "path": "/Dc/Battery/Soc",
    "serviceObj": {
      "service": "com.victronenergy.system/0",
      "name": "Venus system"
    },
    "pathObj": {
      "path": "/Dc/Battery/Soc",
      "type": "float",
      "name": "Battery State of Charge (%)"
    },
    "name": "Battery SOC",
    "onlyChanges": true,
    "roundValues": "1",
    "outputs": 1,
    "x": 130,
    "y": 420,
    "wires": [
      [
        "8c9a93ea7d49b75b"
      ]
    ]
  },
  {
    "id": "8c9a93ea7d49b75b",
    "type": "switch",
    "z": "553fb34cb7d48a4d",
    "name": "Generator rules",
    "property": "payload",
    "propertyType": "msg",
    "rules": [
      {
        "t": "gte",
        "v": "95",
        "vt": "num"
      },
      {
        "t": "btwn",
        "v": "21",
        "vt": "num",
        "v2": "94",
        "v2t": "num"
      },
      {
        "t": "lte",
        "v": "20",
        "vt": "num"
      }
    ],
    "checkall": "false",
    "repair": false,
    "outputs": 3,
    "x": 340,
    "y": 420,
    "wires": [
      [
        "cec1ecc9fe09ed66"
      ],
      [
        "1e16d57e6b38119a"
      ],
      [
        "b009b9880c524e02"
      ]
    ]
  },
  {
    "id": "cec1ecc9fe09ed66",
    "type": "change",
    "z": "553fb34cb7d48a4d",
    "name": "Set Gen OFF = 1",
    "rules": [
      {
        "t": "set",
        "p": "payload",
        "pt": "msg",
        "to": "1",
        "tot": "num"
      }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 570,
    "y": 340,
    "wires": [
      [
        "c1b0b3b681112433"
      ]
    ]
  },
  {
    "id": "1e16d57e6b38119a",
    "type": "change",
    "z": "553fb34cb7d48a4d",
    "name": "Set Gen on/off = 0",
    "rules": [
      {
        "t": "set",
        "p": "payload",
        "pt": "msg",
        "to": "0",
        "tot": "num"
      }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 570,
    "y": 420,
    "wires": [
      [
        "c1b0b3b681112433",
        "3abc2fe6617a030c"
      ]
    ]
  },
  {
    "id": "b009b9880c524e02",
    "type": "change",
    "z": "553fb34cb7d48a4d",
    "name": "Set Gen ON = 1",
    "rules": [
      {
        "t": "set",
        "p": "payload",
        "pt": "msg",
        "to": "1",
        "tot": "num"
      }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 560,
    "y": 500,
    "wires": [
      [
        "3abc2fe6617a030c"
      ]
    ]
  },
  {
    "id": "c1b0b3b681112433",
    "type": "rbe",
    "z": "553fb34cb7d48a4d",
    "name": "",
    "func": "rbe",
    "gap": "",
    "start": "",
    "inout": "out",
    "septopics": false,
    "property": "payload",
    "topi": "topic",
    "x": 790,
    "y": 380,
    "wires": [
      [
        "29e65d8f2bca6350"
      ]
    ]
  },
  {
    "id": "3abc2fe6617a030c",
    "type": "rbe",
    "z": "553fb34cb7d48a4d",
    "name": "",
    "func": "rbe",
    "gap": "",
    "start": "",
    "inout": "out",
    "septopics": false,
    "property": "payload",
    "topi": "topic",
    "x": 790,
    "y": 460,
    "wires": [
      [
        "2b5903f7ec9efc71"
      ]
    ]
  },
  {
    "id": "29e65d8f2bca6350",
    "type": "trigger",
    "z": "553fb34cb7d48a4d",
    "name": "Send 3 second OFF pulse",
    "op1": "1",
    "op2": "0",
    "op1type": "num",
    "op2type": "num",
    "duration": "3",
    "extend": false,
    "overrideDelay": false,
    "units": "s",
    "reset": "0",
    "bytopic": "all",
    "topic": "topic",
    "outputs": 1,
    "x": 990,
    "y": 380,
    "wires": [
      [
        "021a928e6bba2cb5"
      ]
    ]
  },
  {
    "id": "2b5903f7ec9efc71",
    "type": "trigger",
    "z": "553fb34cb7d48a4d",
    "name": "Send 15 second ON pulse",
    "op1": "1",
    "op2": "0",
    "op1type": "num",
    "op2type": "num",
    "duration": "15",
    "extend": false,
    "overrideDelay": false,
    "units": "s",
    "reset": "0",
    "bytopic": "all",
    "topic": "topic",
    "outputs": 1,
    "x": 990,
    "y": 460,
    "wires": [
      [
        "50746a3b16e26742"
      ]
    ]
  },
  {
    "id": "021a928e6bba2cb5",
    "type": "victron-output-relay",
    "z": "553fb34cb7d48a4d",
    "service": "com.victronenergy.system/0",
    "path": "/Relay/0/State",
    "serviceObj": {
      "service": "com.victronenergy.system/0",
      "name": "Venus device"
    },
    "pathObj": {
      "path": "/Relay/0/State",
      "type": "enum",
      "name": "Venus relay 1 state",
      "enum": {
        "0": "Open",
        "1": "Closed"
      },
      "writable": true,
      "disabled": false
    },
    "initial": "0",
    "name": "Generator OFF relay",
    "onlyChanges": false,
    "outputs": 0,
    "x": 1260,
    "y": 380,
    "wires": []
  },
  {
    "id": "50746a3b16e26742",
    "type": "victron-output-relay",
    "z": "553fb34cb7d48a4d",
    "service": "com.victronenergy.system/0",
    "path": "/Relay/1/State",
    "serviceObj": {
      "service": "com.victronenergy.system/0",
      "name": "Venus device"
    },
    "pathObj": {
      "path": "/Relay/1/State",
      "type": "enum",
      "name": "Venus relay 2 state",
      "enum": {
        "0": "Open",
        "1": "Closed"
      },
      "writable": true
    },
    "initial": "0",
    "name": "Generator ON relay",
    "onlyChanges": false,
    "outputs": 0,
    "x": 1250,
    "y": 460,
    "wires": []
  },
  {
    "id": "c8e234aabad31015",
    "type": "global-config",
    "env": [],
    "modules": {
      "@victronenergy/node-red-contrib-victron": "1.6.64"
    }
  }
]

Welcome back. You’re welcome to post in your first language, the site will automatically translate it for everyone.
The posted json seems to have errors and escape characters in it, so it’s best to do a full cut and paste from a nodered json export. I will try fix it.

Nodered on a restart will trigger inject nodes if they are set to do so.
A firmware request will also block data being received by the nodes, so if you do not add error handling/checks to your flows you will have issues like you are experiencing.
With some dev work it should be fixable.

Hi Nick, thank you for your quick response.

I have attached the complete flow.json

I do not see how blocking incoming data could trigger the “Set Gen ON” flow when the SOC is above 20%, there are no inject nodes beside the Battery SOC in this flow.

flows .json.txt (7.3 KB)

Without digging into the flow, it may be a case that the logic is misinterpreting a loss of information as the trigger to start the genset.
The result of a firmware scan is to block the comms that the GX, including nodered, would receive. The nodes will still poll but likely to receive null data back.

Ok, had a look.
What I suggest is to add a debug node to the soc output and the various outputs.
Open the debug view on the nodered interface and then run a firmware check.
This should log what states and values the nodes are sending, that should show you what condition you need to catch.

Edit: I checked the output from an SOC mode (managed CAN battery) and it did not change when checking for firmware.
Somewhere something is going wrong, debug nodes are the best way to find what.

The debug node did give me enough information, during the firmware check it receives “null” as you mentioned and the change node would accept that as less than 20% and start the generator. Now I changed the rule for starting the generator that it only happens when the SOC is between 1% and 20%.

Thank you for the help!