-
Notifications
You must be signed in to change notification settings - Fork 0
/
flows.json
1 lines (1 loc) · 5.05 KB
/
flows.json
1
[{"id":"9fc0f809.f00518","type":"tab","label":"disable-battery-discharging","disabled":false,"info":""},{"id":"e2e8d7d19d009642","type":"debug","z":"9fc0f809.f00518","name":"Keine Ladung geplant","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":980,"y":20,"wires":[]},{"id":"ec8cc1513208cd9e","type":"inject","z":"9fc0f809.f00518","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"10","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":60,"wires":[["215bac21488c88b9"]]},{"id":"4ced90e5fdfcb2c3","type":"json","z":"9fc0f809.f00518","name":"Zeiten","property":"payload","action":"obj","pretty":false,"x":550,"y":60,"wires":[["2d798203f3232fce"]]},{"id":"6338485b3e8f7f92","type":"function","z":"9fc0f809.f00518","name":"topic zu flow variable / Uhrzeit","func":"var payload = msg.payload;\nnode.log(JSON.stringify(payload));\nvar now = new Date();\nvar length = payload.result.plan.length;\n node.log(\"payload length: \" + length);\n\nfor (var i = 0; i < length; i++) {\n node.log(\"info\");\n node.log(\"i: %d\", i);\n var start = new Date(payload.result.plan[i].start);\n var end = new Date(payload.result.plan[i].end);\n if (now >= start && now < end) {\n msg.payload = {\n value: 0,\n };\n node.log(\"Batterieentladung deaktiviert\"); return msg;\n }\n msg.payload = null;\n node.log(\"Aktuell nicht im Zeitfenster\");\n}\n\nmsg.payload = null;\nreturn msg;\n","outputs":1,"noerr":1,"initialize":"","finalize":"","libs":[],"x":1010,"y":100,"wires":[["e03c5addad019278"]]},{"id":"3bec5efe8f0c8dfe","type":"buffer-parser","z":"9fc0f809.f00518","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"uint16be","name":"data","offset":0,"length":2,"offsetbit":0,"scale":"1","mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"value","resultTypeType":"return","multipleResult":true,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":390,"y":280,"wires":[["b0959123c5df24d4"]]},{"id":"d0b1c5eb5361288f","type":"buffer-maker","z":"9fc0f809.f00518","name":"","specification":"spec","specificationType":"ui","items":[{"name":"float","type":"floatle","length":1,"dataType":"msg","data":"payload"}],"swap1":"swap16","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","x":170,"y":280,"wires":[["3bec5efe8f0c8dfe"]]},{"id":"b0959123c5df24d4","type":"modbus-write","z":"9fc0f809.f00518","name":"1034 (Ent-/Ladeleistung)","showStatusActivities":false,"showErrors":true,"showWarnings":true,"unitid":"71","dataType":"MHoldingRegisters","adr":"1034","quantity":"2","server":"a1b432331279e425","emptyMsgOnFail":false,"keepMsgProperties":false,"delayOnStart":false,"startDelayTime":"","x":650,"y":280,"wires":[["fd695f4e5a42488f"],[]]},{"id":"fd695f4e5a42488f","type":"debug","z":"9fc0f809.f00518","name":"debug 40","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":910,"y":260,"wires":[]},{"id":"215bac21488c88b9","type":"http request","z":"9fc0f809.f00518","name":"","method":"GET","ret":"txt","paytoqs":"ignore","url":"192.168.188.15:7070/api/loadpoints/1/target/plan","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":390,"y":60,"wires":[["4ced90e5fdfcb2c3"]]},{"id":"2d798203f3232fce","type":"switch","z":"9fc0f809.f00518","name":"Payload null?","property":"payload.result.plan.length","propertyType":"msg","rules":[{"t":"null"},{"t":"nnull"}],"checkall":"true","repair":false,"outputs":2,"x":720,"y":60,"wires":[["e2e8d7d19d009642"],["6338485b3e8f7f92"]],"info":"if (message.payload === null) {\r\n \r\n}"},{"id":"e03c5addad019278","type":"switch","z":"9fc0f809.f00518","name":"","property":"payload","propertyType":"msg","rules":[{"t":"null"},{"t":"nnull"}],"checkall":"true","repair":false,"outputs":2,"x":490,"y":180,"wires":[["2b7e4a540358e5b7"],["d0b1c5eb5361288f"]]},{"id":"2b7e4a540358e5b7","type":"debug","z":"9fc0f809.f00518","name":"Ladung nicht im Zeitfenster","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":780,"y":180,"wires":[]},{"id":"a1b432331279e425","type":"modbus-client","name":"Kostal Plenticore","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"failureLogEnabled":false,"tcpHost":"192.168.188.109","tcpPort":"1502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","serialAsciiResponseStartDelimiter":"0x3A","unit_id":"71","commandDelay":"5","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":false}]