[
{
"id": "457ecf75d4acfd9e",
"type": "ping",
"z": "simple-internet-check",
"protocol": "IPv4",
"mode": "timed",
"name": "Ping IP 60 sec",
"host": "192.168.7.66",
"timer": "60",
"inputs": 0,
"x": 330,
"y": 460,
"wires": [
[
"c7c3c1e22e00b22e",
"d43da5ecf0124c26"
]
]
},
{
"id": "db59c6082ce7d809",
"type": "debug",
"z": "simple-internet-check",
"name": "debug 1",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 940,
"y": 540,
"wires": []
},
{
"id": "c7c3c1e22e00b22e",
"type": "switch",
"z": "simple-internet-check",
"name": "Up or Down",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "false"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 570,
"y": 460,
"wires": [
[
"f39076e76efb2643"
],
[
"ee64318d3b15c393"
]
]
},
{
"id": "ee64318d3b15c393",
"type": "change",
"z": "simple-internet-check",
"name": "Up - Reset Count Zero",
"rules": [
{
"t": "set",
"p": "counter",
"pt": "flow",
"to": "0",
"tot": "num"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 720,
"y": 540,
"wires": [
[
"db59c6082ce7d809",
"e6cd85e20f46c931"
]
]
},
{
"id": "d43da5ecf0124c26",
"type": "debug",
"z": "simple-internet-check",
"name": "debug 2",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 600,
"y": 280,
"wires": []
},
{
"id": "f39076e76efb2643",
"type": "function",
"z": "simple-internet-check",
"name": "DOWN - Counter + 1",
"func": "var counter = flow.get(\"counter\") || 0\n\ncounter ++\n\nflow.set(\"counter\", counter)\n\nmsg.payload = counter\n\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 760,
"y": 380,
"wires": [
[
"f935a396379d50ca",
"2f7c496451f18f63"
]
]
},
{
"id": "f935a396379d50ca",
"type": "debug",
"z": "simple-internet-check",
"name": "debug 3",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 960,
"y": 280,
"wires": []
},
{
"id": "7cfc9aba330718aa",
"type": "victron-output-relay",
"z": "simple-internet-check",
"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"
},
"mode": "both",
"disabled": false
},
"name": "",
"onlyChanges": false,
"x": 1440,
"y": 320,
"wires": []
},
{
"id": "2cfeccc135823d11",
"type": "delay",
"z": "simple-internet-check",
"name": "",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1180,
"y": 480,
"wires": [
[
"e0d6f3d50bc3443c"
]
]
},
{
"id": "4b9137af51ac86a0",
"type": "victron-output-relay",
"z": "simple-internet-check",
"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"
},
"mode": "both",
"disabled": false
},
"name": "",
"onlyChanges": false,
"x": 1460,
"y": 540,
"wires": []
},
{
"id": "e0d6f3d50bc3443c",
"type": "change",
"z": "simple-internet-check",
"name": "Reset Count Zero + Set Relay OPEN again",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "0",
"tot": "num"
},
{
"t": "set",
"p": "counter",
"pt": "flow",
"to": "0",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1470,
"y": 480,
"wires": [
[
"4b9137af51ac86a0"
]
]
},
{
"id": "2f7c496451f18f63",
"type": "switch",
"z": "simple-internet-check",
"name": "Continue if count over 10 (60 mins)",
"property": "counter",
"propertyType": "flow",
"rules": [
{
"t": "gte",
"v": "10",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 1040,
"y": 400,
"wires": [
[
"383eb37bf73d126d"
]
]
},
{
"id": "383eb37bf73d126d",
"type": "change",
"z": "simple-internet-check",
"name": "Set relay CLOSED",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "1",
"tot": "num"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1290,
"y": 400,
"wires": [
[
"7cfc9aba330718aa",
"2cfeccc135823d11"
]
]
},
{
"id": "e6cd85e20f46c931",
"type": "function",
"z": "simple-internet-check",
"name": "Get Count for Debug",
"func": "var counter = flow.get(\"counter\") || 0\n\nmsg.payload = counter\n\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 840,
"y": 640,
"wires": [
[
"024b33ded2043ac1"
]
]
},
{
"id": "024b33ded2043ac1",
"type": "debug",
"z": "simple-internet-check",
"name": "debug 4",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1040,
"y": 640,
"wires": []
}
]