[{"id":"86eb49a0b0f702bc","type":"group","z":"1460ade6f3a27cb9","style":{"stroke":"#999999","stroke-opacity":"1","fill":"none","fill-opacity":"1","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["5590b17ce8432ba1","879b071f7e013653","676beb3babed5817","17f55cbc1fe21549","62ecfb10d045c9aa","5c671bda81284e37","06040dc0608cce67","7cfc6efafc98cdcb","1233562c8a35cf20","2da7ef0460d42c19"],"x":1214,"y":419,"w":1112,"h":242},{"id":"5590b17ce8432ba1","type":"mqtt in","z":"1460ade6f3a27cb9","g":"86eb49a0b0f702bc","name":"TOP8 - panasonic_heat_pump/main/Compressor_Freq","topic":"panasonic_heat_pump/main/Compressor_Freq","qos":"0","datatype":"auto","broker":"92e5b2c.00a8b5","nl":false,"rap":true,"rh":0,"inputs":0,"x":1440,"y":540,"wires":[["879b071f7e013653"]]},{"id":"879b071f7e013653","type":"function","z":"1460ade6f3a27cb9","g":"86eb49a0b0f702bc","name":"Reduce pump speed","func":"var Freq=msg.payload;//incoming msg payload is compressor Hz\nlet msg1={}; // Pin 1 - Pumpspeed to set\nlet msg99 = {}; // pin 2 - To log\nvar PumpSpeed = global.get(\"PumpMaxFlowSetting\",\"file\"); //default pumpspeed\nif (PumpSpeed === undefined) {return null;} //exit;\n\nvar SavedPumpspeed = global.get(\"SavedPumpspeed\", \"file\"); \nif (SavedPumpspeed === undefined) \n { \n SavedPumpspeed = PumpSpeed; //Store default pumpspeed\n global.set(\"SavedPumpspeed\", PumpSpeed, \"file\"); \n }\n\nvar LowSpeed = global.get(\"LowSpeed\", \"file\");\nif (LowSpeed === undefined) {\n LowSpeed = 70; //Store Low pumpspeed\n global.set(\"LowSpeed\", LowSpeed, \"file\");\n}\n\n\nmsg.topic = \"Waterpump\"\nif (Freq > 0) \n { //if compressor is running:\n if (PumpSpeed < SavedPumpspeed) \n {\n PumpSpeed = SavedPumpspeed; //restore old speed\n global.set(\"PumpMaxFlowSetting\", PumpSpeed, \"file\"); //store current setting\n msg1.payload = PumpSpeed;\n msg99.topic = \"Function Pumpspeed\";\n msg99.payload = \"Pumpspeed restored to: \" + PumpSpeed;\n return [msg1,msg99];\n }\n\n } \n else \n { //if compressor is off:\n if (PumpSpeed > LowSpeed)\n {\n PumpSpeed = LowSpeed; //save new pumpspeed \n global.set(\"PumpMaxFlowSetting\", PumpSpeed, \"file\"); //store current setting\n msg1.payload = PumpSpeed;\n msg99.topic = \"Function Pumpspeed\";\n msg99.payload = \"Reduced pumpspeed to \" + PumpSpeed;\n return [msg1, msg99];\n }\n\n } \n \n\n","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1780,"y":540,"wires":[["676beb3babed5817","7cfc6efafc98cdcb"],["17f55cbc1fe21549","06040dc0608cce67"]]},{"id":"676beb3babed5817","type":"rbe","z":"1460ade6f3a27cb9","g":"86eb49a0b0f702bc","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","topi":"topic","x":1990,"y":520,"wires":[["62ecfb10d045c9aa"]]},{"id":"17f55cbc1fe21549","type":"rbe","z":"1460ade6f3a27cb9","g":"86eb49a0b0f702bc","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","topi":"topic","x":1990,"y":560,"wires":[["5c671bda81284e37"]]},{"id":"62ecfb10d045c9aa","type":"mqtt out","z":"1460ade6f3a27cb9","g":"86eb49a0b0f702bc","name":"SET15 SetMaxPumpDuty","topic":"panasonic_heat_pump/commands/SetMaxPumpDuty","qos":"0","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"92e5b2c.00a8b5","x":2190,"y":520,"wires":[]},{"id":"5c671bda81284e37","type":"link out","z":"1460ade6f3a27cb9","g":"86eb49a0b0f702bc","name":"link out Log","mode":"link","links":["031e62b0bf3df7d7","47e2a8d99d332229"],"x":2105,"y":560,"wires":[]},{"id":"06040dc0608cce67","type":"debug","z":"1460ade6f3a27cb9","g":"86eb49a0b0f702bc","name":"msg99","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1990,"y":620,"wires":[]},{"id":"7cfc6efafc98cdcb","type":"debug","z":"1460ade6f3a27cb9","g":"86eb49a0b0f702bc","name":"msg1","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1990,"y":460,"wires":[]},{"id":"1233562c8a35cf20","type":"inject","z":"1460ade6f3a27cb9","g":"86eb49a0b0f702bc","name":"inject 30 Hz","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"30","payloadType":"num","x":1570,"y":480,"wires":[["879b071f7e013653"]]},{"id":"2da7ef0460d42c19","type":"inject","z":"1460ade6f3a27cb9","g":"86eb49a0b0f702bc","name":"inject 0Hz","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"0","payloadType":"num","x":1560,"y":600,"wires":[["879b071f7e013653"]]},{"id":"92e5b2c.00a8b5","type":"mqtt-broker","name":"MQTT (x.x.x.x)","broker":"core-mosquitto","port":"1883","clientid":"","autoConnect":true,"usetls":false,"compatmode":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""}]