Skip to content

Instantly share code, notes, and snippets.

@dirkjanfaber
Last active November 29, 2023 13:34

Revisions

  1. dirkjanfaber revised this gist Nov 29, 2023. 1 changed file with 0 additions and 0 deletions.
    Binary file added flow.png
    Loading
    Sorry, something went wrong. Reload?
    Sorry, we cannot display this file.
    Sorry, this file is invalid so it cannot be displayed.
  2. dirkjanfaber created this gist Nov 29, 2023.
    214 changes: 214 additions & 0 deletions flow.json
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,214 @@
    [
    {
    "id": "13b8708c2a084ab6",
    "type": "tab",
    "label": "Soc based schedule activation",
    "disabled": false,
    "info": "",
    "env": []
    },
    {
    "id": "7e599749fb7d06d3",
    "type": "inject",
    "z": "13b8708c2a084ab6",
    "name": "Daily at 22.00",
    "props": [
    {
    "p": "payload"
    },
    {
    "p": "topic",
    "vt": "str"
    }
    ],
    "repeat": "",
    "crontab": "00 22 * * *",
    "once": false,
    "onceDelay": 0.1,
    "topic": "",
    "payload": "",
    "payloadType": "date",
    "x": 260,
    "y": 240,
    "wires": [
    [
    "f0e8d8109177b799"
    ]
    ]
    },
    {
    "id": "1c390aa6b96753e2",
    "type": "victron-input-vebus",
    "z": "13b8708c2a084ab6",
    "service": "com.victronenergy.vebus/276",
    "path": "/Soc",
    "serviceObj": {
    "service": "com.victronenergy.vebus/276",
    "name": "MultiPlus-II 48/3000/35-32"
    },
    "pathObj": {
    "path": "/Soc",
    "type": "float",
    "name": "VE.Bus state of charge (%)"
    },
    "name": "",
    "onlyChanges": true,
    "roundValues": "0",
    "x": 360,
    "y": 160,
    "wires": [
    [
    "64035b7a7f5c957a"
    ]
    ]
    },
    {
    "id": "64035b7a7f5c957a",
    "type": "change",
    "z": "13b8708c2a084ab6",
    "name": "Store SOC",
    "rules": [
    {
    "t": "set",
    "p": "SOC",
    "pt": "global",
    "to": "payload",
    "tot": "msg"
    }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 670,
    "y": 160,
    "wires": [
    []
    ]
    },
    {
    "id": "f0e8d8109177b799",
    "type": "switch",
    "z": "13b8708c2a084ab6",
    "name": "Check if SOC <= 20%",
    "property": "SOC",
    "propertyType": "global",
    "rules": [
    {
    "t": "lte",
    "v": "20",
    "vt": "num"
    },
    {
    "t": "else"
    }
    ],
    "checkall": "true",
    "repair": false,
    "outputs": 2,
    "x": 480,
    "y": 240,
    "wires": [
    [
    "85eee29bf1d89914"
    ],
    [
    "224ebe807053c061"
    ]
    ],
    "outputLabels": [
    "SOC too low",
    "SOC alright"
    ]
    },
    {
    "id": "cbc15df37ba916ff",
    "type": "victron-output-ess",
    "z": "13b8708c2a084ab6",
    "service": "com.victronenergy.settings",
    "path": "/Settings/CGwacs/BatteryLife/Schedule/Charge/3/Day",
    "serviceObj": {
    "service": "com.victronenergy.settings",
    "name": "Venus settings"
    },
    "pathObj": {
    "path": "/Settings/CGwacs/BatteryLife/Schedule/Charge/3/Day",
    "type": "enum",
    "name": "Schedule 4: Day",
    "enum": {
    "0": "Sunday",
    "1": "Monday",
    "2": "Tuesday",
    "3": "Wednesday",
    "4": "Thursday",
    "5": "Friday",
    "6": "Saturday",
    "7": "Every day",
    "8": "Weekdays",
    "9": "Weekends"
    },
    "writable": true
    },
    "initial": "",
    "name": "",
    "onlyChanges": false,
    "x": 1040,
    "y": 240,
    "wires": []
    },
    {
    "id": "85eee29bf1d89914",
    "type": "change",
    "z": "13b8708c2a084ab6",
    "name": "Activate schedule 4",
    "rules": [
    {
    "t": "set",
    "p": "payload",
    "pt": "msg",
    "to": "7",
    "tot": "num"
    }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 730,
    "y": 220,
    "wires": [
    [
    "cbc15df37ba916ff"
    ]
    ]
    },
    {
    "id": "224ebe807053c061",
    "type": "change",
    "z": "13b8708c2a084ab6",
    "name": "Deactivate schedule 4",
    "rules": [
    {
    "t": "set",
    "p": "payload",
    "pt": "msg",
    "to": "-7",
    "tot": "num"
    }
    ],
    "action": "",
    "property": "",
    "from": "",
    "to": "",
    "reg": false,
    "x": 740,
    "y": 260,
    "wires": [
    [
    "cbc15df37ba916ff"
    ]
    ]
    }
    ]