The easy way is to use node-red and one of the relays on the GX device. Here is a flow that will monitor AC in and when it loses the AC input closes relay 2. I did need to write a function to reverse the message.
You can also have it send an alert if you wish.
Flow
[
{
“id”: “e2c454393d1802b7”,
“type”: “victron-input-custom”,
“z”: “1112bdc43019f870”,
“service”: “com.victronenergy.vebus/276”,
“path”: “/Ac/ActiveIn/Connected”,
“serviceObj”: {
“service”: “com.victronenergy.vebus/276”,
“name”: “MultiPlus-II 48/5000/70-50 (276)”
},
“pathObj”: {
“path”: “/Ac/ActiveIn/Connected”,
“name”: “/Ac/ActiveIn/Connected”,
“type”: “number”
},
“name”: “”,
“onlyChanges”: false,
“x”: 1250,
“y”: 1680,
“wires”: [
[
“88098ba273d29162”,
“4a368bdc5f80e1fe”
]
]
},
{
“id”: “d1e11e5115a030a4”,
“type”: “victron-output-relay”,
“z”: “1112bdc43019f870”,
“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”: “”,
“onlyChanges”: false,
“x”: 1860,
“y”: 1680,
“wires”:
},
{
“id”: “2b5e0a44acdbfc82”,
“type”: “victron-input-relay”,
“z”: “1112bdc43019f870”,
“service”: “com.victronenergy.system/0”,
“path”: “/Relay/1/State”,
“serviceObj”: {
“service”: “com.victronenergy.system/0”,
“name”: “Venus system”
},
“pathObj”: {
“path”: “/Relay/1/State”,
“type”: “enum”,
“name”: “Venus relay 2 state”,
“enum”: {
“0”: “Open”,
“1”: “Closed”
}
},
“initial”: “”,
“name”: “”,
“onlyChanges”: false,
“x”: 1860,
“y”: 1740,
“wires”: [
]
},
{
“id”: “88098ba273d29162”,
“type”: “debug”,
“z”: “1112bdc43019f870”,
“name”: “debug 28”,
“active”: false,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“complete”: “false”,
“statusVal”: “”,
“statusType”: “auto”,
“x”: 1600,
“y”: 1740,
“wires”:
},
{
“id”: “4a368bdc5f80e1fe”,
“type”: “function”,
“z”: “1112bdc43019f870”,
“name”: “CHANGE LOGIC”,
“func”: “// Check if the payload is 1 or 0\nif (msg.payload === 1) {\n msg.payload = 0;\n} else if (msg.payload === 0) {\n msg.payload = 1;\n}\n\n// Return the updated message\nreturn msg;\n”,
“outputs”: 1,
“timeout”: 0,
“noerr”: 0,
“initialize”: “”,
“finalize”: “”,
“libs”: ,
“x”: 1590,
“y”: 1680,
“wires”: [
[
“d1e11e5115a030a4”
]
]
}
]