[ { "id": "906c112511e72bfc", "type": "debug", "z": "12c1f1627da78145", "name": "debug 7", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 700, "y": 1420, "wires": [] }, { "id": "e85db04dba0fdd74", "type": "mqtt in", "z": "12c1f1627da78145", "name": "", "topic": "TASMOTA-HEATPUMP/tele/RESULT", "qos": "0", "datatype": "utf8", "broker": "95a2d9cb.10d398", "nl": false, "rap": true, "rh": 0, "inputs": 0, "x": 240, "y": 1260, "wires": [ [ "2dbf4fef76634de5" ] ] }, { "id": "412fb64fd65b5d89", "type": "inject", "z": "12c1f1627da78145", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "1", "crontab": "", "once": true, "onceDelay": "1", "topic": "", "payload": "", "payloadType": "date", "x": 190, "y": 1480, "wires": [ [ "f5b7982121cf611b" ] ] }, { "id": "f5b7982121cf611b", "type": "function", "z": "12c1f1627da78145", "name": "Send modbus request", "func": "var value = context.get(\"counter\") || 0;\nvalue += 1;\nif (value > 30) value = 1;\nmsg.payload = \"\";\n\nswitch (value) {\n case 1:\n msg.payload = '{ \"deviceaddress\": 1, \"functioncode\": 1, \"startaddress\": 0, \"type\": \"bit\", \"count\": 5 }';\n break;\n case 2:\n msg.payload = '{ \"deviceaddress\": 1, \"functioncode\": 2, \"startaddress\": 0, \"type\": \"bit\", \"count\": 17 }';\n break;\n case 3:\n msg.payload = '{ \"deviceaddress\": 1, \"functioncode\": 3, \"startaddress\": 0, \"type\": \"uint16\", \"count\": 10 }';\n break;\n case 4:\n msg.payload = '{ \"deviceaddress\": 1, \"functioncode\": 4, \"startaddress\": 0, \"type\": \"uint16\", \"count\": 13 }';\n break;\n case 5:\n msg.payload = '{ \"deviceaddress\": 1, \"functioncode\": 4, \"startaddress\": 19, \"type\": \"uint16\", \"count\": 1 }';\n break;\n case 6:\n msg.payload = '{ \"deviceaddress\": 1, \"functioncode\": 4, \"startaddress\": 22, \"type\": \"uint16\", \"count\": 3 }';\n break;\n}\n\ncontext.set(\"counter\", value);\n\nif (msg.payload != \"\") {\n msg.topic = \"0006/TASMOTA-HEATPUMP/cmnd/ModBusSend\";\n return msg;\n}\n", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 400, "y": 1480, "wires": [ [ "7555e552f714d25b" ] ] }, { "id": "a810146fe4a06bda", "type": "mqtt out", "z": "12c1f1627da78145", "name": "", "topic": "", "qos": "", "retain": "", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "95a2d9cb.10d398", "x": 790, "y": 1460, "wires": [] }, { "id": "2dbf4fef76634de5", "type": "function", "z": "12c1f1627da78145", "name": "Filter Modbus Messages", "func": "if (msg.payload.includes(\"Modbus\")) return msg;\n", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 190, "y": 1340, "wires": [ [ "d1779eeba0c521f5" ] ] }, { "id": "7555e552f714d25b", "type": "show-value", "z": "12c1f1627da78145", "name": "", "path": "", "x": 610, "y": 1480, "wires": [ [ "a810146fe4a06bda" ] ] }, { "id": "d1779eeba0c521f5", "type": "json", "z": "12c1f1627da78145", "name": "", "property": "payload", "action": "", "pretty": false, "x": 390, "y": 1340, "wires": [ [ "c89a536c79538ce6" ] ] }, { "id": "c89a536c79538ce6", "type": "function", "z": "12c1f1627da78145", "name": "Split modus messages to labels and values", "func": "var sendmsg = {};\nmsg = msg.payload.ModbusReceived;\nsendmsg.payload = {};\nsendmsg.deviceaddress = msg.DeviceAddress;\nsendmsg.devicefunctioncode = msg.FunctionCode;\nvar value = msg.Values;\n\nif (msg.FunctionCode == 1) {\n sendmsg.payload.enable_disable_heating_cooling = value[0];\n sendmsg.payload.enable_disable_dhw = value[1];\n sendmsg.payload.silent_mode_set = value[2];\n sendmsg.payload.trigger_desinfection_operation = value[3];\n sendmsg.payload.trigger_emergency_operation = value[4];\n node.send(sendmsg);\n}\n\nelse if (msg.FunctionCode == 2) {\n sendmsg.payload.water_flow_status = value[0];\n sendmsg.payload.water_pump_status = value[1];\n sendmsg.payload.ext_water_pump_status = value[2];\n sendmsg.payload.compressor_status = value[3];\n sendmsg.payload.defrosting_status = value[4];\n sendmsg.payload.dhw_heating_status = value[5];\n sendmsg.payload.dhw_tank_disinfection_status = value[6];\n sendmsg.payload.silent_mode_status = value[7];\n sendmsg.payload.cooling_status = value[8];\n sendmsg.payload.solar_pump_status = value[9];\n sendmsg.payload.backup_heater_step1_status = value[10];\n sendmsg.payload.backup_heater_step2_status = value[11];\n sendmsg.payload.dhw_boost_heater_status = value[12];\n sendmsg.payload.error_status = value[13];\n sendmsg.payload.emergency_operation_available_space_heating_cooling = value[14];\n sendmsg.payload.emergency_operation_available_dhw = value[15];\n sendmsg.payload.mix_pump_status = value[16];\n node.send(sendmsg);\n}\n\nelse if (msg.FunctionCode == 3) {\n sendmsg.payload.operation_mode = value[0];\n sendmsg.payload.control_method = value[1];\n sendmsg.payload.target_temp_circuit1 = value[2] / 10;\n sendmsg.payload.room_air_temp_circuit1 = value[3] / 10;\n sendmsg.payload.shift_value_circuit1 = value[4];\n sendmsg.payload.target_temp_circuit2 = value[5] / 10;\n sendmsg.payload.room_air_temp_circuit2 = value[6] / 10;\n sendmsg.payload.shift_value_circuit2 = value[7];\n sendmsg.payload.dhw_target_temp = value[8] / 10;\n sendmsg.payload.energy_state_input = value[9];\n node.send(sendmsg);\n}\n\nelse if ((msg.FunctionCode == 4) && (msg.StartAddress == 0)) {\n sendmsg.payload.error_code = value[0];\n sendmsg.payload.odu_operation_cycle = value[1];\n sendmsg.payload.water_inlet_temp = value[2] / 10;\n sendmsg.payload.water_outlet_temp = value[3] / 10;\n sendmsg.payload.backup_heater_outlet_temp = value[4] / 10;\n sendmsg.payload.dhw_water_temp = value[5] / 10;\n sendmsg.payload.solar_collector_temp = value[6] / 10;\n sendmsg.payload.room_air_temp_circuit1 = value[7] / 10;\n sendmsg.payload.current_flow_rate = value[8] / 10;\n sendmsg.payload.flow_temp_circuit2 = value[9] / 10;\n sendmsg.payload.room_air_temp_circuit2 = value[10] / 10;\n sendmsg.payload.energy_state_input = value[11];\n sendmsg.payload.outdoor_air_temp = value[12] / 10;\n node.send(sendmsg);\n}\n\nelse if ((msg.FunctionCode == 4) && (msg.StartAddress == 22)) {\n sendmsg.payload.high_pressure = value[0];\n sendmsg.payload.low_pressure = value[1];\n sendmsg.payload.compressor_frequency = value[2];\n node.send(sendmsg);\n}\n\nelse if ((msg.FunctionCode == 4) && (msg.StartAddress == 19)) {\n sendmsg.payload.ventilator_speed = value[0];\n node.send(sendmsg);\n}\n", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 290, "y": 1420, "wires": [ [ "906c112511e72bfc", "dde6c21a6eecd0bf" ] ] }, { "id": "179f6d3ab58df073", "type": "show-value", "z": "12c1f1627da78145", "name": "Current Flowrate", "path": "", "x": 970, "y": 1220, "wires": [ [] ] }, { "id": "dde6c21a6eecd0bf", "type": "split", "z": "12c1f1627da78145", "name": "", "splt": "\\n", "spltType": "str", "arraySplt": 1, "arraySpltType": "len", "stream": false, "addname": "measurement", "x": 570, "y": 1360, "wires": [ [ "7b8e1ff189cb2cde", "45bc406e06666107" ] ] }, { "id": "7b8e1ff189cb2cde", "type": "influxdb out", "z": "12c1f1627da78145", "influxdb": "d80918d2.705768", "name": "0006", "measurement": "", "precision": "", "retentionPolicy": "", "database": "database", "precisionV18FluxV20": "s", "retentionPolicyV18Flux": "", "org": "org", "bucket": "nodered", "x": 730, "y": 1360, "wires": [] }, { "id": "45bc406e06666107", "type": "switch", "z": "12c1f1627da78145", "name": "", "property": "measurement", "propertyType": "msg", "rules": [ { "t": "eq", "v": "current_flow_rate", "vt": "str" }, { "t": "eq", "v": "outdoor_air_temp", "vt": "str" }, { "t": "eq", "v": "water_inlet_temp", "vt": "str" }, { "t": "eq", "v": "water_outlet_temp", "vt": "str" }, { "t": "eq", "v": "compressor_frequency", "vt": "str" } ], "checkall": "true", "repair": false, "outputs": 5, "x": 730, "y": 1280, "wires": [ [ "179f6d3ab58df073" ], [ "69f248c6d3c2e4c2" ], [ "5dcb1729108e8df0" ], [ "44391cb632a1262c" ], [ "7c6a58ddee4c4a94" ] ] }, { "id": "69f248c6d3c2e4c2", "type": "show-value", "z": "12c1f1627da78145", "name": "Outdoor Temperature", "path": "", "x": 980, "y": 1280, "wires": [ [] ] }, { "id": "5dcb1729108e8df0", "type": "show-value", "z": "12c1f1627da78145", "name": "Water Outlet Temperature", "path": "", "x": 990, "y": 1340, "wires": [ [] ] }, { "id": "44391cb632a1262c", "type": "show-value", "z": "12c1f1627da78145", "name": "Water Inlet Temp", "path": "", "x": 970, "y": 1400, "wires": [ [] ] }, { "id": "7c6a58ddee4c4a94", "type": "show-value", "z": "12c1f1627da78145", "name": "Compressor Frequency", "path": "", "x": 990, "y": 1460, "wires": [ [] ] }, { "id": "95a2d9cb.10d398", "type": "mqtt-broker", "name": "Server", "broker": "mqttserver.local", "port": "1883", "clientid": "", "usetls": false, "compatmode": false, "protocolVersion": 4, "keepalive": "60", "cleansession": true, "birthTopic": "", "birthQos": "0", "birthPayload": "", "closeTopic": "", "closeQos": "0", "closePayload": "", "willTopic": "", "willQos": "0", "willPayload": "" }, { "id": "d80918d2.705768", "type": "influxdb", "hostname": "172.30.30.1", "port": "8086", "protocol": "http", "database": "nodered", "name": "Influxdb Docker", "usetls": false, "tls": "", "influxdbVersion": "2.0", "url": "http://172.30.30.1:8086", "rejectUnauthorized": false } ]