[{"id":"77d28a94767686f8","type":"function","z":"ac86d42a29852803","name":"Prep for Powersaver nodes","func":"const nordpool = msg.payload;\n\nfunction toIsoString(date) {\n var tzo = -date.getTimezoneOffset(), dif = tzo >= 0 ? \"+\" : \"-\",\n pad = function (num) {\n return (num < 10 ? \"0\" : \"\") + num;\n };\n\n return (\n date.getFullYear() + \"-\" +\n pad(date.getMonth() + 1) + \"-\" +\n pad(date.getDate()) + \"T\" +\n pad(date.getHours()) + \":\" +\n pad(date.getMinutes()) + \":\" +\n pad(date.getSeconds()) + dif +\n pad(Math.floor(Math.abs(tzo) / 60)) + \":\" +\n pad(Math.abs(tzo) % 60)\n );\n}\n\nconst payload = {\n priceData: nordpool.map((h) => {\n const date = new Date(h.timestamp);\n const start = toIsoString(date);\n const value = Math.round(h.price * 10) / 10000;\n\n return {\n start,\n value,\n };\n }),\n};\n\nreturn { payload };","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":740,"y":740,"wires":[["b661b0da22d60992","fb60cc084377388f","071fd378027c2a1c","a0d088fca91b26b4","3646bcc1ef754f5d"]]},{"id":"b661b0da22d60992","type":"ps-strategy-lowest-price","z":"ac86d42a29852803","name":"Lowest Price","fromTime":"00","toTime":"00","hoursOn":"4","maxPrice":"","doNotSplit":true,"sendCurrentValueWhenRescheduling":true,"outputValueForOn":"true","outputValueForOff":"false","outputValueForOntype":"bool","outputValueForOfftype":"bool","outputIfNoSchedule":"false","outputOutsidePeriod":"false","contextStorage":"memoryOnly","x":1050,"y":920,"wires":[[],[],["230cbd34c03550c8","bd045d59f1aad5da"]]},{"id":"230cbd34c03550c8","type":"ps-schedule-merger","z":"ac86d42a29852803","name":"Schedule Merger","outputIfNoSchedule":"false","logicFunction":"AND","schedulingDelay":2000,"sendCurrentValueWhenRescheduling":true,"outputValueForOn":"true","outputValueForOff":"false","outputValueForOntype":"bool","outputValueForOfftype":"bool","x":1290,"y":920,"wires":[["b76995e80c494a07","4ac4a4131a6a8465"],["b76995e80c494a07"],["bd045d59f1aad5da"]]},{"id":"fb60cc084377388f","type":"ps-strategy-fixed-schedule","z":"ac86d42a29852803","name":"Fixed Schedule","periods":[{"start":"00","value":"true"}],"validFrom":"","validTo":"","days":{"Mon":false,"Tue":false,"Wed":false,"Thu":false,"Fri":true,"Sat":false,"Sun":false},"sendCurrentValueWhenRescheduling":true,"outputValueForOn":"true","outputValueForOff":"false","outputValueForOntype":"bool","outputValueForOfftype":"bool","outputIfNoSchedule":"false","contextStorage":"memoryOnly","x":1060,"y":1000,"wires":[[],[],["230cbd34c03550c8","bd045d59f1aad5da"]]},{"id":"bd045d59f1aad5da","type":"debug","z":"ac86d42a29852803","name":"debug 121","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1530,"y":1020,"wires":[]},{"id":"b76995e80c494a07","type":"debug","z":"ac86d42a29852803","name":"debug 122","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1570,"y":960,"wires":[]},{"id":"6cf298fc9c936de6","type":"link out","z":"ac86d42a29852803","name":"link out 39","mode":"link","links":["d0fda364deccc7f0"],"x":1825,"y":900,"wires":[]},{"id":"4ac4a4131a6a8465","type":"change","z":"ac86d42a29852803","name":"Prep for Sterilization planner","rules":[{"t":"set","p":"topic","pt":"msg","to":"Sterilization","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"true","fromt":"bool","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1560,"y":900,"wires":[["6cf298fc9c936de6"]]},{"id":"b27c143c7bfe97c7","type":"nordpool-api-plus","z":"ac86d42a29852803","name":"Nordpool - tomorrow","area":"NL","currency":"EUR","action":"dayAhead","x":420,"y":740,"wires":[["77d28a94767686f8"]]},{"id":"23eb119f465c18a9","type":"inject","z":"ac86d42a29852803","d":true,"name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"23 14 * * *","once":true,"onceDelay":"20","topic":"","payload":"","payloadType":"date","x":210,"y":740,"wires":[["b27c143c7bfe97c7"]]},{"id":"071fd378027c2a1c","type":"ps-strategy-heat-capacitor","z":"ac86d42a29852803","name":"Heat capacitor","timeHeat1C":"240","timeCool1C":"300","maxTempAdjustment":"0.5","boostTempHeat":"0.8","boostTempCool":"0.8","minSavings":"0.03","setpoint":"19.5","x":1060,"y":640,"wires":[["133d06a5e6436cd3","86eaf8ad791419d7"],["133d06a5e6436cd3"],["133d06a5e6436cd3"]]},{"id":"705efb3722538182","type":"function","z":"ac86d42a29852803","name":"set.WoonkamerSP","func":"global.set('WoonkamerSP', msg.payload, \"file\")\n\nvar Temp = msg.payload\nmsg.payload = Temp\n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1490,"y":620,"wires":[["02dbba196f71baa1"]]},{"id":"133d06a5e6436cd3","type":"debug","z":"ac86d42a29852803","name":"debug 123","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1270,"y":680,"wires":[]},{"id":"7e108813b76d59f0","type":"nordpool-api-plus","z":"ac86d42a29852803","name":"Nordpool - today","area":"NL","currency":"EUR","action":"dayAhead","x":410,"y":680,"wires":[["77d28a94767686f8"]]},{"id":"8cf9e190b6100f7f","type":"inject","z":"ac86d42a29852803","d":true,"name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":true,"onceDelay":"10","topic":"","payload":"","payloadType":"date","x":210,"y":680,"wires":[["7e108813b76d59f0"]]},{"id":"02dbba196f71baa1","type":"debug","z":"ac86d42a29852803","name":"debug 124","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1730,"y":620,"wires":[]},{"id":"37541ee4f606ee5d","type":"comment","z":"ac86d42a29852803","name":"APEX - heat","info":"","x":650,"y":580,"wires":[]},{"id":"894b093e7020e766","type":"link out","z":"ac86d42a29852803","name":"Force DHW","mode":"link","links":["ef28d0205d50cb26"],"x":1825,"y":1080,"wires":[]},{"id":"7406ef2f61d0906a","type":"change","z":"ac86d42a29852803","name":"Prep for force DHW ","rules":[{"t":"set","p":"topic","pt":"msg","to":"DHW","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"true","fromt":"bool","to":"1","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1530,"y":1080,"wires":[["894b093e7020e766"]]},{"id":"c5e0cbd18ab76b66","type":"inject","z":"ac86d42a29852803","d":true,"name":"Replan when restarted nodes","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"3600","crontab":"","once":true,"onceDelay":"60","topic":"","payload":"{\"commands\":{\"replan\":true}}","payloadType":"json","x":710,"y":860,"wires":[["a0d088fca91b26b4","3646bcc1ef754f5d","b661b0da22d60992","071fd378027c2a1c","fb60cc084377388f"]]},{"id":"99f13ab51f0cab45","type":"switch","z":"ac86d42a29852803","name":"","property":"payload","propertyType":"msg","rules":[{"t":"lte","v":"38","vt":"num"},{"t":"gt","v":"38","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":470,"y":1000,"wires":[["b9bcd48f69ebac6a"],["e1b6177f8ce6157f"]]},{"id":"b9bcd48f69ebac6a","type":"change","z":"ac86d42a29852803","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"name\":\"Lowest Price\",\"config\":{\"hoursOn\":2,\"override\":\"auto\"}}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":1000,"wires":[["f34ed0c218023b7b"]]},{"id":"f34ed0c218023b7b","type":"light-scheduler-filter","z":"ac86d42a29852803","settings":"967738f2.df1e98","events":"[{\"start\":{\"dow\":1,\"mod\":1080},\"end\":{\"dow\":2,\"mod\":0}},{\"start\":{\"dow\":3,\"mod\":1080},\"end\":{\"dow\":4,\"mod\":0}},{\"start\":{\"dow\":4,\"mod\":1080},\"end\":{\"dow\":5,\"mod\":0}},{\"start\":{\"dow\":6,\"mod\":1080},\"end\":{\"dow\":0,\"mod\":15}},{\"start\":{\"dow\":0,\"mod\":1080},\"end\":{\"dow\":1,\"mod\":5}},{\"start\":{\"dow\":1,\"mod\":0},\"end\":{\"dow\":1,\"mod\":360}},{\"start\":{\"dow\":2,\"mod\":0},\"end\":{\"dow\":2,\"mod\":360}},{\"start\":{\"dow\":4,\"mod\":0},\"end\":{\"dow\":4,\"mod\":360}},{\"start\":{\"dow\":5,\"mod\":5},\"end\":{\"dow\":5,\"mod\":360}},{\"start\":{\"dow\":6,\"mod\":5},\"end\":{\"dow\":6,\"mod\":360}},{\"start\":{\"dow\":0,\"mod\":5},\"end\":{\"dow\":0,\"mod\":360}},{\"start\":{\"dow\":2,\"mod\":1080},\"end\":{\"dow\":2,\"mod\":1435}},{\"start\":{\"dow\":3,\"mod\":0},\"end\":{\"dow\":3,\"mod\":360}},{\"start\":{\"dow\":5,\"mod\":1080},\"end\":{\"dow\":6,\"mod\":0}}]","name":"","onlyWhenDark":true,"scheduleRndMax":0,"sunElevationThreshold":6,"sunShowElevationInStatus":false,"x":780,"y":1080,"wires":[["a0d088fca91b26b4"],["3646bcc1ef754f5d"]]},{"id":"a0d088fca91b26b4","type":"ps-strategy-lowest-price","z":"ac86d42a29852803","name":"Lowest Price","fromTime":"18","toTime":"06","hoursOn":"2","maxPrice":"","doNotSplit":true,"sendCurrentValueWhenRescheduling":false,"outputValueForOn":"true","outputValueForOff":"false","outputValueForOntype":"bool","outputValueForOfftype":"bool","outputIfNoSchedule":"false","outputOutsidePeriod":"false","contextStorage":"memoryOnly","x":1050,"y":1080,"wires":[["7406ef2f61d0906a"],[],["c69a0344f03328e0"]]},{"id":"e1b6177f8ce6157f","type":"change","z":"ac86d42a29852803","name":"Switch schedule off","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"name\":\"Lowest Price\",\"config\":{\"override\":\"off\"}}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":790,"y":1160,"wires":[["a0d088fca91b26b4","3646bcc1ef754f5d"]]},{"id":"c69a0344f03328e0","type":"debug","z":"ac86d42a29852803","name":"debug 121","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1310,"y":1160,"wires":[]},{"id":"3646bcc1ef754f5d","type":"ps-strategy-lowest-price","z":"ac86d42a29852803","name":"Lowest Price","fromTime":"06","toTime":"18","hoursOn":"2","maxPrice":"","doNotSplit":true,"sendCurrentValueWhenRescheduling":false,"outputValueForOn":"true","outputValueForOff":"false","outputValueForOntype":"bool","outputValueForOfftype":"bool","outputIfNoSchedule":"false","outputOutsidePeriod":"false","contextStorage":"memoryOnly","x":1050,"y":1160,"wires":[["7406ef2f61d0906a"],[],["c69a0344f03328e0"]]},{"id":"e68a78e2cc81272b","type":"cronplus","z":"ac86d42a29852803","name":"","outputField":"payload","timeZone":"","persistDynamic":false,"commandResponseMsgOutput":"output1","outputs":1,"options":[{"name":"schedule1","topic":"topic1","payloadType":"global","payload":"DHW_Temp","expressionType":"cron","expression":"0 59 * * * ? *","location":"","offset":"0","solarType":"all","solarEvents":"sunrise,sunset"}],"x":320,"y":1000,"wires":[["99f13ab51f0cab45"]]},{"id":"789a5bafcdb113dd","type":"comment","z":"ac86d42a29852803","name":"APEX - DHW","info":"","x":730,"y":920,"wires":[]},{"id":"86eaf8ad791419d7","type":"switch","z":"ac86d42a29852803","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"10","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1270,"y":620,"wires":[["705efb3722538182"],[]]},{"id":"967738f2.df1e98","type":"light-scheduler-settings","name":"Odijk","latitude":"52.05639","longitude":"5.23968"}]