question

murphy-r avatar image
murphy-r asked

Cerbo GX Controlling Relay with Node Red

Making progress with Node Red and Cerbo. I have Node Red working where I can read the status of the Cerbo programmable relay 1 and 2. Toggle the relay using the Cerbo control panel and I see that state change.

My issue is that I configure the flow for controlling the relay and pass it a msg.payload of either numeric value of 0 or 1 and neither will trigger a change in the relay status. I even went back and referenced a thread from Mark at Victron and looked at his example flow. Nothing special or obvious. Is the Cerbo programmable relay supported?

Here is a copy of my very basic flow to initiated a relay state change on my Cerbo GX


[{"id":"6530ae7bcb0aea51","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"ef6cb60cd85169e5","type":"victron-output-relay","z":"6530ae7bcb0aea51","service":"com.victronenergy.system","path":"/Relay/0/State","serviceObj":{"service":"com.victronenergy.system","name":"Venus device","paths":[{"path":"/Relay/0/State","type":"enum","name":"Venus relay 1 state","enum":{"0":"Open","1":"Closed"},"writable":true,"disabled":true},{"path":"/Relay/1/State","type":"enum","name":"Venus relay 2 state","enum":{"0":"Open","1":"Closed"},"writable":true}]},"pathObj":{"path":"/Relay/0/State","type":"enum","name":"Venus relay 1 state","enum":{"0":"Open","1":"Closed"},"writable":true,"disabled":true},"initial":"0","name":"Cerbo - Relay 1","x":500,"y":200,"wires":[]},{"id":"246cbe11b7341a16","type":"inject","z":"6530ae7bcb0aea51","name":"Close Relay","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":210,"y":200,"wires":[["ef6cb60cd85169e5"]]}]

cerbo gxNode-RED
2 |3000

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

3 Answers
Stefanie (Victron Energy Staff) avatar image
Stefanie (Victron Energy Staff) answered ·

@murphy_r

Moved to the modification space as that's where questions like this belong.

The relay control node is for status control only, not for switching states.

The workaround is to use the Generator GX Control node (requires relay1 for generator start/stop in GX relay settings enabled and Generator start/stop autostart functionality disabled).

Example flow:

[{"id":"c611ec7f9bbe81dd","type":"victron-input-relay","z":"6530ae7bcb0aea51","service":"com.victronenergy.system","path":"/Relay/0/State","serviceObj":{"service":"com.victronenergy.system","name":"com.victronenergy.system","paths":[{"path":"/Relay/0/State","type":"enum","name":"Venus relay 1 state","enum":{"0":"Open","1":"Closed"}},{"path":"/Relay/1/State","type":"enum","name":"Venus relay 2 state","enum":{"0":"Open","1":"Closed"}}]},"pathObj":{"path":"/Relay/0/State","type":"enum","name":"Venus relay 1 state","enum":{"0":"Open","1":"Closed"}},"initial":"","name":"","x":340,"y":260,"wires":[["63ee05797f7e9d29"]]},{"id":"63ee05797f7e9d29","type":"debug","z":"6530ae7bcb0aea51","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":640,"y":260,"wires":[]}]
2 |3000

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

Mark avatar image
Mark answered ·

You should be able to change the CerboGX relay state directly via NodeRED providing the relay function is set to Manual. I will take a quick look tomorrow to confirm this is still functioning properly and if so, at your flow.

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.

patrick-genx avatar image patrick-genx commented ·
Hi, do you have more info about Cerbo GX Relay activation throught Node Red ?
0 Likes 0 ·
murphy-r avatar image
murphy-r answered ·

Stefanie. I changed the setting for relay 1 from manual -> generator. For some reason that change does not populate to node-red. When I go to add the gx generator control it does not see the relay setting at all. I get the below message. Tried restarting the Cerbo and Signalk both.

"There are no gx generator services available. Please check that a gx generator is connected or try a different node"


Mark what I found this morning when I did more testing is that for the Cerbo GX I had to set the relay in manual mode and then reload the Cerbo and then SignalK. Until reload it is as if the changes do not get propagated into the services config. I have it working but, either that might be a bug OR we could add it to the Git readme.

FYI Cerbus is at firmware v2.84

2 |3000

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