Thanks John! I will definitely look into that 
As for your node red situation. I think I maybe able to help setting up a virtual tank.
Hopefully this demo workflow below gives you the missing pieces on how virtual tanks work.
Since I don’t understand what you get from the ‘input to pulse meter’ the following workflow will need to be tweaked to use that value correctly.
E.g. Does the pulse meter give you one big number of water used, or a running number that you add up in node red?
The key part its easy to get stuck on is you need both
- A ‘Virtual Device Node’ (Top Left) to create the device and set the max value.
- And a ‘Custom Control Node’ (Bottom Right) to set the device current value.
Copy and paste these nodes into a new flow and have a play around until you get it to work.
[
{
"id": "01efa392657a784b",
"type": "tab",
"label": "Virtual Tank Demo",
"disabled": false,
"info": "",
"env": []
},
{
"id": "14dfb6fd0e04d3f0",
"type": "victron-input-pulsemeter",
"z": "01efa392657a784b",
"service": "com.victronenergy.pulsemeter/2",
"path": "",
"serviceObj": {
"service": "com.victronenergy.pulsemeter/2",
"name": "Generic pulse meter"
},
"name": "",
"onlyChanges": false,
"x": 110,
"y": 340,
"wires": [
[
"e61d75ca73cd467a"
]
]
},
{
"id": "516a97188e93a0ca",
"type": "comment",
"z": "01efa392657a784b",
"name": "^ Or digital input",
"info": "",
"x": 120,
"y": 380,
"wires": []
},
{
"id": "e61d75ca73cd467a",
"type": "function",
"z": "01efa392657a784b",
"name": "function (apply K value to get L)",
"func": "\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 340,
"wires": [
[
"00fb06dcbbd12848"
]
]
},
{
"id": "00fb06dcbbd12848",
"type": "function",
"z": "01efa392657a784b",
"name": "function (Global.Capacity - Used)",
"func": "let currentUsed = global.get(\"freshWaterUsed\");\nlet capacity = global.get(\"freshWaterCapacity\");\n\n// FYI can also set gobal values using global.set(\"freshWaterUsed\")\n\nlet currentLevel = capacity - currentUsed // Hopefully a number like 80 or 100. Representing the L remaining \n\nreturn [{payload: currentLevel}];",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 680,
"y": 340,
"wires": [
[
"c4edc95b558aeba1"
]
]
},
{
"id": "c4edc95b558aeba1",
"type": "victron-output-custom",
"z": "01efa392657a784b",
"service": "com.victronenergy.tank/100",
"path": "/Remaining",
"serviceObj": {
"service": "com.victronenergy.tank/100",
"name": "Virtual Fresh water (100)"
},
"pathObj": {
"path": "/Remaining",
"name": "/Remaining",
"type": "number",
"value": 91
},
"name": "",
"onlyChanges": false,
"x": 1050,
"y": 340,
"wires": []
},
{
"id": "e619fbe6cc8b18b2",
"type": "comment",
"z": "01efa392657a784b",
"name": "^ (Empty) Ask John Mosenthal for code",
"info": "",
"x": 370,
"y": 380,
"wires": []
},
{
"id": "f70f14ae17e5c66a",
"type": "change",
"z": "01efa392657a784b",
"name": "",
"rules": [
{
"t": "set",
"p": "freshWaterCapacity",
"pt": "global",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 350,
"y": 140,
"wires": [
[]
]
},
{
"id": "07d5432fa6db38d9",
"type": "inject",
"z": "01efa392657a784b",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "200",
"payloadType": "num",
"x": 90,
"y": 140,
"wires": [
[
"f70f14ae17e5c66a"
]
]
},
{
"id": "7f53ea82537a2202",
"type": "comment",
"z": "01efa392657a784b",
"name": "^ Change this number to your capcity and run once",
"info": "",
"x": 230,
"y": 180,
"wires": []
},
{
"id": "40e6ec56d3604f8f",
"type": "change",
"z": "01efa392657a784b",
"name": "set global.freshWaterUsed to 0",
"rules": [
{
"t": "set",
"p": "freshWaterUsed",
"pt": "global",
"to": "0",
"tot": "num"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 390,
"y": 240,
"wires": [
[]
]
},
{
"id": "3cd449f30281fa32",
"type": "victron-input-digitalinput",
"z": "01efa392657a784b",
"service": "com.victronenergy.digitalinput/4",
"path": "",
"serviceObj": {
"service": "com.victronenergy.digitalinput/4",
"name": "Door alarm"
},
"name": "",
"onlyChanges": false,
"x": 110,
"y": 240,
"wires": [
[
"40e6ec56d3604f8f"
]
]
},
{
"id": "431b3dd90d8967a1",
"type": "comment",
"z": "01efa392657a784b",
"name": "^ Attach a button to relay 4. When clicked it resets used value to 0",
"info": "",
"x": 280,
"y": 280,
"wires": []
},
{
"id": "34f28ec712b4612f",
"type": "victron-virtual",
"z": "01efa392657a784b",
"name": "Virtual Fresh water",
"device": "tank",
"default_values": false,
"battery_capacity": 25,
"include_battery_temperature": false,
"grid_nrofphases": 1,
"include_motor_temp": false,
"include_controller_temp": false,
"include_coolant_temp": false,
"include_motor_rpm": true,
"include_motor_direction": true,
"position": 0,
"pvinverter_nrofphases": 1,
"fluid_type": "1",
"include_tank_battery": false,
"include_tank_temperature": false,
"tank_battery_voltage": 3.3,
"tank_capacity": "110",
"temperature_type": 2,
"include_humidity": false,
"include_pressure": false,
"include_temp_battery": false,
"temp_battery_voltage": 3.3,
"x": 130,
"y": 40,
"wires": []
},
{
"id": "fb0314faeca6374a",
"type": "comment",
"z": "01efa392657a784b",
"name": "^ This is required to create the virtual device on system boot. (Change capacity value in here)",
"info": "",
"x": 360,
"y": 80,
"wires": []
},
{
"id": "f7336237c2eed271",
"type": "comment",
"z": "01efa392657a784b",
"name": "^ This changes the current level of the tank",
"info": "",
"x": 1060,
"y": 380,
"wires": []
},
{
"id": "bb749a96292bd5be",
"type": "comment",
"z": "01efa392657a784b",
"name": "^ WIP. Update with values from pulse meter",
"info": "",
"x": 710,
"y": 380,
"wires": []
}
]
Let me know if you have any questions.