Victron Time to Go
[ { "id": "af04c67bf185a5ec", "type": "tab", "label": "Flow 1", "disabled": false, "info": "", "env": [] }, { "id": "ea3bbcb03159f9f8", "type": "switch", "z": "af04c67bf185a5ec", "name": "compare time up to 86400", "property": "payload", "propertyType": "msg", "rules": [ { "t": "gt", "v": "86400", "vt": "num" }, { "t": "lte", "v": "86400", "vt": "num" } ], "checkall": "true", "repair": false, "outputs": 2, "x": 610, "y": 360, "wires": [ [ "911e6ea90ca1ecaa" ], [ "4a1d21a8339959ba" ] ] }, { "id": "911e6ea90ca1ecaa", "type": "change", "z": "af04c67bf185a5ec", "name": "", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "86399", "tot": "num" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 860, "y": 260, "wires": [ [ "365c15b23516a0d9" ] ] }, { "id": "365c15b23516a0d9", "type": "function", "z": "af04c67bf185a5ec", "name": "[s] to [hh:mm:ss]", "func": "\n// Message from preceeding node is in seconds - should be less than 24 hours (86400 seconds).\nvar time = (new Date(msg.payload * 1000)).toUTCString().match(/(\d\d:\d\d:\d\d)/)[0];\n// Pass on the string to the next node, what ever that may be. (groov Data Store for example).\nmsg.payload = time;\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 980, "y": 340, "wires": [ [ "f00757e8518419e2" ] ] }, { "id": "4a1d21a8339959ba", "type": "function", "z": "af04c67bf185a5ec", "name": "[s] to [hh:mm:ss]", "func": "\n// Message from preceeding node is in seconds - should be less than 24 hours (86400 seconds).\nvar time = (new Date(msg.payload * 1000)).toUTCString().match(/(\d\d:\d\d:\d\d)/)[0];\n// Pass on the string to the next node, what ever that may be. (groov Data Store for example).\nmsg.payload = time;\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 920, "y": 400, "wires": [ [ "f00757e8518419e2" ] ] }, { "id": "07915ea88fac3229", "type": "victron-input-system", "z": "af04c67bf185a5ec", "service": "com.victronenergy.system/0", "path": "/Dc/Battery/TimeToGo", "serviceObj": { "service": "com.victronenergy.system/0", "name": "Venus system" }, "pathObj": { "path": "/Dc/Battery/TimeToGo", "type": "float", "name": "Battery Time to Go (s)" }, "name": "", "onlyChanges": false, "x": 230, "y": 360, "wires": [ [ "ea3bbcb03159f9f8" ] ] }, { "id": "f00757e8518419e2", "type": "ui_text", "z": "af04c67bf185a5ec", "group": "875199f5.0237d", "order": 8, "width": 6, "height": 1, "name": "", "label": "Time To Go :", "format": "{{msg.payload}}", "layout": "row-left", "className": "", "style": true, "font": "Arial Black,Arial Black,Gadget,sans-serif", "fontSize": "18", "color": "#00fffb", "x": 1210, "y": 380, "wires": [] }, { "id": "875199f5.0237d", "type": "ui_group", "name": "Solar", "tab": "fbf17a66.102028", "order": 1, "disp": true, "width": 25, "collapse": true, "className": "" }, { "id": "fbf17a66.102028", "type": "ui_tab", "name": "Venus Off Grid Systems", "icon": "fa-sun-o", "order": 1, "disabled": false, "hidden": false } ]
[{"id":"ea3bbcb03159f9f8","type":"switch","z":"af04c67bf185a5ec","name":"compare time up to 86400","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"86400","vt":"num"},{"t":"lte","v":"86400","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":610,"y":360,"wires":[["911e6ea90ca1ecaa"],["4a1d21a8339959ba"]]},{"id":"911e6ea90ca1ecaa","type":"change","z":"af04c67bf185a5ec","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"86399","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":860,"y":260,"wires":[["365c15b23516a0d9"]]},{"id":"365c15b23516a0d9","type":"function","z":"af04c67bf185a5ec","name":"[s] to [hh:mm:ss]","func":"\n// Message from preceeding node is in seconds - should be less than 24 hours (86400 seconds).\nvar time = (new Date(msg.payload * 1000)).toUTCString().match(/(\\d\\d:\\d\\d:\\d\\d)/)[0];\n// Pass on the string to the next node, what ever that may be. (groov Data Store for example).\nmsg.payload = time;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":980,"y":340,"wires":[["f00757e8518419e2"]]},{"id":"4a1d21a8339959ba","type":"function","z":"af04c67bf185a5ec","name":"[s] to [hh:mm:ss]","func":"\n// Message from preceeding node is in seconds - should be less than 24 hours (86400 seconds).\nvar time = (new Date(msg.payload * 1000)).toUTCString().match(/(\\d\\d:\\d\\d:\\d\\d)/)[0];\n// Pass on the string to the next node, what ever that may be. (groov Data Store for example).\nmsg.payload = time;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":920,"y":400,"wires":[["f00757e8518419e2"]]},{"id":"07915ea88fac3229","type":"victron-input-system","z":"af04c67bf185a5ec","service":"com.victronenergy.system/0","path":"/Dc/Battery/TimeToGo","serviceObj":{"service":"com.victronenergy.system/0","name":"Venus system"},"pathObj":{"path":"/Dc/Battery/TimeToGo","type":"float","name":"Battery Time to Go (s)"},"name":"","onlyChanges":false,"x":230,"y":360,"wires":[["ea3bbcb03159f9f8"]]},{"id":"f00757e8518419e2","type":"ui_text","z":"af04c67bf185a5ec","group":"875199f5.0237d","order":8,"width":6,"height":1,"name":"","label":"Time To Go :","format":"{{msg.payload}}","layout":"row-left","className":"","style":true,"font":"Arial Black,Arial Black,Gadget,sans-serif","fontSize":"18","color":"#00fffb","x":1210,"y":380,"wires":[]},{"id":"875199f5.0237d","type":"ui_group","name":"Solar","tab":"fbf17a66.102028","order":1,"disp":true,"width":25,"collapse":true,"className":""},{"id":"fbf17a66.102028","type":"ui_tab","name":"Venus Off Grid Systems","icon":"fa-sun-o","order":1,"disabled":false,"hidden":false}]