ATUALIZEI O CÓDIGO
Agora é possível arrastar para controlar a temperatura:
Para ter essa nova função é só adicionar uma entidade auxiliar:
Detalhe importante: o range está de 35 até 46, após o 46 ele pula para 48, 50, 55 e 60 no meu caso não vejo necessidade nessas temperaturas então fiz do 35 ao 46.
Código nodered:
[{"id":"6bccceffbf03f205","type":"tab","label":"-Aquecedor","disabled":false,"info":"","env":[]},{"id":"11377a49ab0dd16c","type":"group","z":"6bccceffbf03f205","style":{"stroke":"#3a3a3a","stroke-opacity":"1","fill":"#1e1e1e","fill-opacity":"0.5","label":true,"label-position":"nw","color":"#cccccc"},"nodes":["b53a0e69c71032f4","9ffc1d89401fc5f4","7f510259700499c1","808aa2331daa5d0c","2ce64cf39002710e","5e58c77d5c4269af","c2f34eac169e2a6d","3b6ba41fad2d9443","fc4c7af6bf0bbf57","9fcf98bec86da9ef","f5d766f9a5f160a6","682b7c3689643889","49ca67f67bc9f469","139716273152f7df","2faf887b2663c0cd","d96714933d6c3005","4508ab72cacf22e9","8570dfa3ec32dc76","5557e704e7f71ef8","9fa20095c74f2e7c","ab203e8712bee4a6"],"x":34,"y":579,"w":892,"h":322},{"id":"ffba20906ec8d1f1","type":"group","z":"6bccceffbf03f205","style":{"stroke":"#3a3a3a","stroke-opacity":"1","fill":"#1e1e1e","fill-opacity":"0.5","label":true,"label-position":"nw","color":"#cccccc"},"nodes":["1081cd28893374c2","53fee50beef568ab","6853591e7cb5204b","99fe0131613b7443","06e65439dff18501","ca430d9a3c59768b","b50036ac01903411","721483cbb3e537fe","fc130b5361929011","600d16fd7238bb13","a74d8fd2b0e72174","9fb566d0656a4c6a","478ed976d1cc6dc8","f2fb03d9bf414499","09992d6cadf015b0","853ec97e34464eed","0120aeb83fd7982c","b2df083e64981204","bb8ab8b613f6393d","f40e4f8b2d871e6a","e683d6b4991e5c0b","eb717f96607c38f2","2527c294daab7639","7fac43b3263a1cdb","d78290de85229c80","17c442e4c6dcffd0","6f6782e9e93a2782","9b7a6a109e0e6272","8f3c0d3a7784b084","e87207bbdb5b96e4","e9253755c8ecc819","cfc8743c5a505a5d","c6a8026615704059","f2ef115206d8a0cc","fac3dc98044ff627","9707718b5e56b995","02cdcb16a0a35296"],"x":34,"y":19,"w":1752,"h":462},{"id":"9b7a6a109e0e6272","type":"junction","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","x":440,"y":320,"wires":[["b2df083e64981204"]]},{"id":"8f3c0d3a7784b084","type":"junction","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","x":1640,"y":140,"wires":[["721483cbb3e537fe"]]},{"id":"1081cd28893374c2","type":"inject","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"Atualiza sensor a cada 10s","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"10","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":200,"y":60,"wires":[["53fee50beef568ab"]]},{"id":"53fee50beef568ab","type":"http request","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"Comando para pegar informações","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://192.168.0.110/bus","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":840,"y":60,"wires":[["06e65439dff18501"]]},{"id":"6853591e7cb5204b","type":"http request","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"Comando para aumentar temp","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://192.168.0.110/inc","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":490,"y":100,"wires":[["600d16fd7238bb13"]]},{"id":"99fe0131613b7443","type":"http request","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"Comando para diminuir temp","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://192.168.0.110/dec","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":480,"y":160,"wires":[["600d16fd7238bb13"]]},{"id":"06e65439dff18501","type":"split","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"","splt":",","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":1050,"y":60,"wires":[["ca430d9a3c59768b"]]},{"id":"ca430d9a3c59768b","type":"join","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1170,"y":60,"wires":[["853ec97e34464eed","09992d6cadf015b0","f2fb03d9bf414499","b50036ac01903411","e87207bbdb5b96e4"]]},{"id":"b50036ac01903411","type":"function","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"Criar sensor geral","func":"\nif (msg.payload[0] == 11){\n msg.payload[0] = \"desligado\"\n}\nif (msg.payload[0] == 41 && msg.payload[2] == 0) {\n msg.payload[0] = \"stand-by\"\n}\nif (msg.payload[0] == 41 && msg.payload[2] == 1) {\n msg.payload[0] = \"em uso\"\n}\nif (msg.payload[0] == 21 && msg.payload[2] == 1) {\n msg.payload[0] = \"em uso\"\n}\nif (msg.payload[0] == 42 && msg.payload[2] == 1) {\n msg.payload[0] = \"em uso\"\n}\nif (msg.payload[0] == 43 && msg.payload[2] == 1) {\n msg.payload[0] = \"em uso\"\n}\nif (msg.payload[0] == 48 && msg.payload[2] == 1) {\n msg.payload[0] = \"em uso\"\n}\n\n// Sensor geral\nmsg.entity_id = 'sensor.aquecedor_gas'\n\nmsg.payload = {\n data: {\n state: msg.payload[0],\n attributes: {\n vazao_minima_para_acionamento: msg.payload[13],\n vazao_minima_para_desligamento: msg.payload[14],\n data_firmware: msg.payload[22],\n horas_de_combustao: msg.payload[4],\n potencia_maxima_kcal_min: msg.payload[9],\n rotacao_da_ventoinha: msg.payload[7],\n corrente: msg.payload[8],\n horas_de_stand_by: msg.payload[5],\n numero_de_serie: msg.payload[19],\n icon: \"mdi:information\",\n friendly_name: \"Aquecedor Rinnai E17 Informações\",\n }\n }\n};\n\n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1470,"y":140,"wires":[["8f3c0d3a7784b084"]]},{"id":"721483cbb3e537fe","type":"ha-api","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"","server":"db1ab0af.caa65","version":1,"debugenabled":false,"protocol":"http","method":"post","path":"/api/states/{{entity_id}}","data":"","dataType":"json","responseType":"json","outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"results"}],"x":1710,"y":140,"wires":[[]]},{"id":"fc130b5361929011","type":"http request","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"Comando para ligar/desligar","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://192.168.0.110/lig","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":480,"y":220,"wires":[["600d16fd7238bb13"]]},{"id":"600d16fd7238bb13","type":"delay","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"","pauseType":"delay","timeout":"3","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":720,"y":100,"wires":[["53fee50beef568ab"]]},{"id":"a74d8fd2b0e72174","type":"server-state-changed","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"Aumentar temperatura","server":"db1ab0af.caa65","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_button.aquecedor_aumentar_temperatura","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":true,"ignorePrevStateUnknown":true,"ignorePrevStateUnavailable":true,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":180,"y":100,"wires":[["6853591e7cb5204b"]]},{"id":"9fb566d0656a4c6a","type":"server-state-changed","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"Diminui temperatura","server":"db1ab0af.caa65","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_button.aquecedor_diminuir_temperatura","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":true,"ignorePrevStateUnknown":true,"ignorePrevStateUnavailable":true,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":170,"y":160,"wires":[["99fe0131613b7443"]]},{"id":"478ed976d1cc6dc8","type":"server-state-changed","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"Liga / Desliga aquecedor","server":"db1ab0af.caa65","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.aquecedor_ligar_desligar","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":true,"ignorePrevStateUnknown":true,"ignorePrevStateUnavailable":true,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":190,"y":220,"wires":[["fc130b5361929011"]]},{"id":"f2fb03d9bf414499","type":"function","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"Criar sensor temparura","func":"\nmsg.payload[15] = msg.payload[15].slice(0, -2);\nmsg.payload[10] = msg.payload[10].slice(0, -2);\nmsg.payload[11] = msg.payload[11].slice(0, -2);\n\nmsg.entity_id = 'sensor.aquecedor_gas_temperatura'\n\nmsg.payload = {\n data: {\n state: msg.payload[15],\n attributes: {\n temperatura_de_entrada: msg.payload[10],\n temperatura_de_saida: msg.payload[11],\n state_class: \"measurement\",\n unit_of_measurement: \"°C\",\n device_class: \"temperature\",\n icon: \"mdi:water-boiler\",\n friendly_name: \"Aquecedor Rinnai E17 Temperatura\",\n }\n }\n};\n\n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1450,"y":100,"wires":[["8f3c0d3a7784b084"]]},{"id":"09992d6cadf015b0","type":"function","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"Criar sensor network","func":"\nmsg.entity_id = 'sensor.aquecedor_gas_network'\n\nmsg.payload = {\n data: {\n state: msg.payload[37],\n attributes: {\n state_class: \"measurement\",\n unit_of_measurement: \"dBm\",\n device_class: \"signal_strength\",\n ip: msg.payload[16],\n mac: msg.payload[25],\n icon: \"mdi:wifi\",\n friendly_name: \"Aquecedor Rinnai E17 Network\",\n }\n }\n};\n\n\n\n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1460,"y":180,"wires":[["8f3c0d3a7784b084"]]},{"id":"853ec97e34464eed","type":"function","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"Criar sensor do fluxo de água","func":"\nmsg.payload[12] = msg.payload[12] / 100;\n\nmsg.entity_id = 'sensor.aquecedor_gas_fluxo_de_agua'\n\nmsg.payload = {\n data: {\n state: msg.payload[12],\n attributes: {\n unit_of_measurement: \"l/m\",\n device_class: \"flow\",\n state_class: \"measurement\",\n icon: \"mdi:water-opacity\",\n friendly_name: \"Aquecedor Rinnai E17 Fluxo de Água\",\n }\n }\n};\n\n\n\n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1430,"y":60,"wires":[["8f3c0d3a7784b084"]]},{"id":"0120aeb83fd7982c","type":"function","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"Criar sensor quantos litros último uso","func":"// Sensor litros de água gastos\n\nmsg.entity_id = 'sensor.aquecedor_gas_litros_ultimo'\n\nmsg.payload = {\n data: {\n state: msg.payload,\n attributes: {\n ultimo_registro: flow.get(\"data\"),\n tempo_aberto: msg.tempo,\n unit_of_measurement: \"L\",\n device_class: \"flow\",\n state_class: \"measurement\",\n icon: \"mdi:water-pump\",\n friendly_name: \"Aquecedor Rinnai E17 Quantidade de Litros Gastos Último Uso\",\n }\n }\n};\n\n\n\n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1410,"y":320,"wires":[["8f3c0d3a7784b084"]]},{"id":"b2df083e64981204","type":"hourglass","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"","persistId":"","humanizeLocale":"pt-br","x":520,"y":320,"wires":[["7fac43b3263a1cdb"]]},{"id":"bb8ab8b613f6393d","type":"change","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"start","rules":[{"t":"set","p":"command","pt":"msg","to":"start","tot":"str"},{"t":"set","p":"status","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":280,"wires":[["9b7a6a109e0e6272","17c442e4c6dcffd0"]]},{"id":"f40e4f8b2d871e6a","type":"change","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"stop","rules":[{"t":"set","p":"command","pt":"msg","to":"stop","tot":"str"},{"t":"set","p":"status","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":320,"wires":[["eb717f96607c38f2","9b7a6a109e0e6272"]]},{"id":"e683d6b4991e5c0b","type":"change","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"reset","rules":[{"t":"set","p":"command","pt":"msg","to":"reset","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":290,"y":360,"wires":[["9b7a6a109e0e6272"]]},{"id":"eb717f96607c38f2","type":"delay","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":195,"y":360,"wires":[["e683d6b4991e5c0b"]],"l":false},{"id":"2527c294daab7639","type":"server-state-changed","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"Fluxo > 0","server":"db1ab0af.caa65","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.aquecedor_gas_fluxo_de_agua","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"0","halt_if_type":"num","halt_if_compare":"gt","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":true,"ignorePrevStateUnknown":true,"ignorePrevStateUnavailable":true,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"outputProperties":[{"property":"payload_state","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":140,"y":280,"wires":[["bb8ab8b613f6393d"],["f40e4f8b2d871e6a"]]},{"id":"7fac43b3263a1cdb","type":"switch","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"= stop","property":"command","propertyType":"msg","rules":[{"t":"eq","v":"stop","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":650,"y":320,"wires":[["d78290de85229c80"]]},{"id":"d78290de85229c80","type":"function","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"Convertendo os dados","func":"/*var fluxo = flow.get(\"fluxo\")\nvar segundos = msg.elapsed.millis / 1000\nvar minutos = segundos / 60\n\nmsg.minutos = minutos.toFixed(1)\nmsg.fluxo = fluxo\n\nlet litrosGastos = (fluxo * msg.minutos)\n\nlitrosGastos = litrosGastos.toFixed(1)\n\n\nmsg.payload = litrosGastos; */\n\n\n\nvar fluxo = flow.get(\"fluxo\")\nvar segundos = msg.elapsed.millis / 1000\nvar minutos = segundos / 60\n\nmsg.minutos = Math.floor(minutos)\nmsg.segundos = Math.floor((minutos - msg.minutos) * 60)\nmsg.fluxo = fluxo\n\nlet litrosGastos = (fluxo * minutos)\n\nlitrosGastos = litrosGastos.toFixed(1)\n\nmsg.payload = litrosGastos;\n\nmsg.tempo = msg.minutos + \"min\" + msg.segundos.toString().padStart(2, '0') + \"s\";\n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":820,"y":320,"wires":[["0120aeb83fd7982c"]]},{"id":"17c442e4c6dcffd0","type":"change","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"","rules":[{"t":"set","p":"fluxo","pt":"flow","to":"payload_state","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":530,"y":280,"wires":[["6f6782e9e93a2782"]]},{"id":"b53a0e69c71032f4","type":"inject","z":"6bccceffbf03f205","g":"11377a49ab0dd16c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":680,"wires":[["7f510259700499c1"]]},{"id":"9ffc1d89401fc5f4","type":"debug","z":"6bccceffbf03f205","g":"11377a49ab0dd16c","name":"bus","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":810,"y":680,"wires":[]},{"id":"7f510259700499c1","type":"http request","z":"6bccceffbf03f205","g":"11377a49ab0dd16c","name":"Comando para pegar informações","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://192.168.0.110/bus","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":360,"y":680,"wires":[["808aa2331daa5d0c"]]},{"id":"808aa2331daa5d0c","type":"split","z":"6bccceffbf03f205","g":"11377a49ab0dd16c","name":"","splt":",","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":570,"y":680,"wires":[["2ce64cf39002710e"]]},{"id":"2ce64cf39002710e","type":"join","z":"6bccceffbf03f205","g":"11377a49ab0dd16c","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":690,"y":680,"wires":[["9ffc1d89401fc5f4"]]},{"id":"5e58c77d5c4269af","type":"comment","z":"6bccceffbf03f205","g":"11377a49ab0dd16c","name":"Dev","info":"# \"Status ligado/desligado/stand-by: $col0\"\n# \"Erros do sistma: $col01\"\n# \"Número de acionamentos: $col03\"\n# \"Temperatura de entrata: $col10\"\n# \"Temperatura de saída: $col11\"\n# \"Vazão mínima p/ acionamento: $col13\"\n# \"Vazão mínima p/ desligamento: $col14\"\n# \"Temperatura setada: $col15\"\n# \"Endereço IP: $col16\"\n# \"Data Firmware: $col22\"\n# \"MAC Address: $col25\"\n# \"Sinal wi-fi: $col37\"\n# \"Horas de combustão: $col04\"\n# \"Horas de stand-by: $col05\"\n# \"Número de série: $col19\"\n# \"Potência máxima (kcal/min): $col09\"\n# \"Fluxo real: $col12\"\n# \"Rotação da ventoinha: $col07\"\n# \"Corrente: $col08\"\n\n# http://192.168.0.110/historico\n# http://192.168.0.110/consumo\n# http://192.168.0.110/tela_\n# http://192.168.0.110/erros","x":110,"y":620,"wires":[]},{"id":"c2f34eac169e2a6d","type":"inject","z":"6bccceffbf03f205","g":"11377a49ab0dd16c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":740,"wires":[["fc4c7af6bf0bbf57"]]},{"id":"3b6ba41fad2d9443","type":"debug","z":"6bccceffbf03f205","g":"11377a49ab0dd16c","name":"historico","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":820,"y":740,"wires":[]},{"id":"fc4c7af6bf0bbf57","type":"http request","z":"6bccceffbf03f205","g":"11377a49ab0dd16c","name":"Comando para pegar historico","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://192.168.0.110/historico","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":350,"y":740,"wires":[["9fcf98bec86da9ef"]]},{"id":"9fcf98bec86da9ef","type":"split","z":"6bccceffbf03f205","g":"11377a49ab0dd16c","name":"","splt":",","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":570,"y":740,"wires":[["f5d766f9a5f160a6"]]},{"id":"f5d766f9a5f160a6","type":"join","z":"6bccceffbf03f205","g":"11377a49ab0dd16c","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":690,"y":740,"wires":[["3b6ba41fad2d9443"]]},{"id":"682b7c3689643889","type":"inject","z":"6bccceffbf03f205","g":"11377a49ab0dd16c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":800,"wires":[["139716273152f7df"]]},{"id":"49ca67f67bc9f469","type":"debug","z":"6bccceffbf03f205","g":"11377a49ab0dd16c","name":"consumo","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":820,"y":800,"wires":[]},{"id":"139716273152f7df","type":"http request","z":"6bccceffbf03f205","g":"11377a49ab0dd16c","name":"Comando para pegar consumo","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://192.168.0.110/consumo","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":350,"y":800,"wires":[["2faf887b2663c0cd"]]},{"id":"2faf887b2663c0cd","type":"split","z":"6bccceffbf03f205","g":"11377a49ab0dd16c","name":"","splt":",","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":570,"y":800,"wires":[["d96714933d6c3005"]]},{"id":"d96714933d6c3005","type":"join","z":"6bccceffbf03f205","g":"11377a49ab0dd16c","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":690,"y":800,"wires":[["49ca67f67bc9f469"]]},{"id":"4508ab72cacf22e9","type":"inject","z":"6bccceffbf03f205","g":"11377a49ab0dd16c","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":140,"y":860,"wires":[["5557e704e7f71ef8"]]},{"id":"8570dfa3ec32dc76","type":"debug","z":"6bccceffbf03f205","g":"11377a49ab0dd16c","name":"erros","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":810,"y":860,"wires":[]},{"id":"5557e704e7f71ef8","type":"http request","z":"6bccceffbf03f205","g":"11377a49ab0dd16c","name":"Comando para pegar erros","method":"GET","ret":"txt","paytoqs":"ignore","url":"http://192.168.0.110/erros","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":340,"y":860,"wires":[["9fa20095c74f2e7c"]]},{"id":"9fa20095c74f2e7c","type":"split","z":"6bccceffbf03f205","g":"11377a49ab0dd16c","name":"","splt":",","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":570,"y":860,"wires":[["ab203e8712bee4a6"]]},{"id":"ab203e8712bee4a6","type":"join","z":"6bccceffbf03f205","g":"11377a49ab0dd16c","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":690,"y":860,"wires":[["8570dfa3ec32dc76"]]},{"id":"6f6782e9e93a2782","type":"moment","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"","topic":"","input":"","inputType":"msg","inTz":"America/Sao_Paulo","adjAmount":0,"adjType":"days","adjDir":"add","format":"DD/MM/YYYY HH:mm","locale":"C","output":"data","outputType":"flow","outTz":"America/Sao_Paulo","x":720,"y":280,"wires":[[]]},{"id":"e87207bbdb5b96e4","type":"function","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"Criar sensor erros","func":"if (msg.payload[1] == 10) {\n msg.erro = \"Código: 10 - Problema na ventoinha ou obstrução no fluxo\"\n}\nif (msg.payload[1] == 11) {\n msg.erro = \"Código: 11 - Ao ligar não acende, falta de gás\"\n}\nif (msg.payload[1] == 12) {\n msg.erro = \"Código: 12 - Falta de gás em uso\"\n}\nif (msg.payload[1] == 14) {\n msg.erro = \"Código: 14 - Fusível ou termostato rompido\"\n}\nif (msg.payload[1] == 32) {\n msg.erro = \"Código: 32 - Termistor com problema\"\n}\nif (msg.payload[1] == 52) {\n msg.erro = \"Código: 52 - Conector solto da válvula moduladora de chama (POV)\"\n}\nif (msg.payload[1] == 61) {\n msg.erro = \"Código: 61 - Conector da ventoinha solto\"\n}\nif (msg.payload[1] == 72) {\n msg.erro = \"Código: 72 - Sensor de chama com problema \"\n}\nif (msg.payload[1] == 0) {\n msg.erro = \"OK\"\n}\n\n\n\n\n// Sensor geral\nmsg.entity_id = 'sensor.aquecedor_gas_erro'\n\nmsg.payload = {\n data: {\n state: msg.erro,\n attributes: {\n icon: \"mdi:information\",\n friendly_name: \"Aquecedor Rinnai E17 Erro\",\n }\n }\n};\n\n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1470,"y":220,"wires":[["8f3c0d3a7784b084"]]},{"id":"c6a8026615704059","type":"server-state-changed","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"Setar temperatura ","server":"db1ab0af.caa65","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.set_temperatura","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":true,"ignorePrevStateUnknown":true,"ignorePrevStateUnavailable":true,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"outputProperties":[{"property":"set_temp","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":170,"y":420,"wires":[["f2ef115206d8a0cc"]]},{"id":"f2ef115206d8a0cc","type":"api-current-state","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"Temperatura atual","server":"db1ab0af.caa65","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.aquecedor_gas_temperatura","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"temp_atual","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":370,"y":420,"wires":[["fac3dc98044ff627"]]},{"id":"fac3dc98044ff627","type":"function","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"set temp","func":"var diferenca = msg.set_temp - msg.temp_atual\n\nmsg.temp_nova = Math.abs(diferenca)\n\n\nif (msg.set_temp > msg.temp_atual){\n for (var i = 0; i < msg.temp_nova; i++) {\n msg.payload = 'aumenta'\n\n node.send([msg, null]);\n //return [msg, null];\n }\n i = i+1\n}\n\nif (msg.set_temp < msg.temp_atual) {\n for (var i = 0; i < msg.temp_nova; i++) {\n msg.payload = 'diminui'\n\n node.send([null, msg]);\n //return [null, msg]; \n }\n i = i + 1\n}\n","outputs":2,"noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":420,"wires":[["02cdcb16a0a35296"],["9707718b5e56b995"]]},{"id":"02cdcb16a0a35296","type":"link out","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"aumentar","mode":"link","links":["e9253755c8ecc819"],"x":645,"y":400,"wires":[]},{"id":"9707718b5e56b995","type":"link out","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"diminuir","mode":"link","links":["cfc8743c5a505a5d"],"x":645,"y":440,"wires":[]},{"id":"e9253755c8ecc819","type":"link in","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"aumentar","links":["02cdcb16a0a35296"],"x":335,"y":100,"wires":[["6853591e7cb5204b"]]},{"id":"cfc8743c5a505a5d","type":"link in","z":"6bccceffbf03f205","g":"ffba20906ec8d1f1","name":"diminuir","links":["9707718b5e56b995"],"x":335,"y":160,"wires":[["99fe0131613b7443"]]},{"id":"db1ab0af.caa65","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]