Nesse tutorial, eu ensino como utilizar o Índice de Calor, onde você vai ter uma temperatura aproximada ao que o seu corpo sente no ambiente. Ele é calculado a partir da Temperatura e Umidade para utilizar com automações no Home Assistant e NodeRed.
- Produtos recomendados:
🔸 Adaptador USB Zigbee para Zigbee2mqtt (Pronto para uso com firmware e case): https://bit.ly/3uf4YLX / https://www.nossacasainteligente.com.br/adaptador-zigbee-usb-para-zigbee2mqtt-homebridge
🔸 Sensor Zigbee Display com Temperatura, Umidade e Luminância: https://s.click.aliexpress.com/e/_AVRNXE
🔸 Sensor Zigbee Display com Temperatura e Umidade ou Versão sem Display: http://s.click.aliexpress.com/e/lmBLH9GM
2. Nó para importação referente a criação do índice de calor:
[{"id":"507937759e7bb707","type":"server-state-changed","z":"5f4c9e8f.dcfd8","name":"Temperatura Aparente","server":"17f902e.f0d18fd","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.sensor_display_temperatura","entityidfiltertype":"exact","outputinitially":true,"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":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":120,"y":180,"wires":[["3e49c4d504f9957c","77920aae9a739f65"]]},{"id":"3e49c4d504f9957c","type":"api-current-state","z":"5f4c9e8f.dcfd8","name":"Umidade","server":"17f902e.f0d18fd","version":2,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.sensor_display_umidade","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":310,"y":220,"wires":[["77920aae9a739f65"]]},{"id":"77920aae9a739f65","type":"join","z":"5f4c9e8f.dcfd8","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":450,"y":180,"wires":[["0939c50e58151a56"]]},{"id":"0939c50e58151a56","type":"function","z":"5f4c9e8f.dcfd8","name":"","func":"function calIndCalor() {\n var id;\n // Referência: http://www.hpc.ncep.noaa.gov/html/heatindex_equation.shtml\n // HI = -42.379 + 2.04901523*T + 10.14333127*RH - .22475541*T*RH - .00683783*T*T - .05481717*RH*RH + .00122874*T*T*RH + .00085282*T*RH*RH - .00000199*T*T*RH*RH\n var tempF = msg.payload[0];\n var umR = msg.payload[1];\n if (tempF !== \"\" && umR !== \"\") {\n tempF = ((tempF * 1.8) + 32);\n var HI;\n if (parseFloat(tempF) <= 32) {\n HI = tempF;\n } else {\n HI = 0.5 * (tempF + 61.0 + ((tempF - 68.0) * 1.2) + (umR * 0.094));\n if (HI > 79) {\n HI = -42.379 + 2.04901523 * tempF + 10.14333127 * umR - 0.22475541 * tempF * umR - 0.00683783 * tempF * tempF - 0.05481717 * umR * umR + 0.00122874 * tempF * tempF * umR + 0.00085282 * tempF * umR * umR - 0.00000199 * tempF * tempF * umR * umR;\n if ((umR <= 13) && ((tempF >= 80) && tempF <= 112)) {\n HI -= ((13 - umR) / 4) * Math.sqrt((17 - Math.abs(tempF - 95)) / 17);\n }\n if ((umR > 85) && ((tempF >= 80) && tempF <= 87)) {\n HI += ((umR - 85) / 10) * ((87 - tempF) / 5);\n }\n }\n }\n id = (HI - 32) / 1.8;\n }\n return id;\n}\nvar indicecalor = parseFloat(calIndCalor().toFixed(2))\nreturn { payload: indicecalor };","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":600,"y":180,"wires":[["62e2c4ce5581e45a"]]},{"id":"62e2c4ce5581e45a","type":"ha-entity","z":"5f4c9e8f.dcfd8","name":"Indice de Calor","server":"17f902e.f0d18fd","version":1,"debugenabled":false,"outputs":1,"entityType":"sensor","config":[{"property":"name","value":"IC_Escritorio"},{"property":"device_class","value":""},{"property":"icon","value":""},{"property":"unit_of_measurement","value":"ºC"}],"state":"payload","stateType":"msg","attributes":[],"resend":true,"outputLocation":"payload","outputLocationType":"msg","inputOverride":"allow","outputOnStateChange":false,"outputPayload":"$entity().state ? \"on\": \"off\"","outputPayloadType":"jsonata","x":790,"y":180,"wires":[[]]},{"id":"17f902e.f0d18fd","type":"server","name":"Home Assistant","version":1,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]
3. Exemplos que eu utilizo em casa (Nó para importação):
[{"id":"aa93b85b.d6a0f8","type":"server-state-changed","z":"35cb9760.bf0558","name":"IC Escritório >= 29","server":"27f1aa3c.860de6","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.icalor_escritorio","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"29","halt_if_type":"num","halt_if_compare":"gte","outputs":2,"output_only_on_state_change":true,"for":"","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":150,"y":2320,"wires":[["205cd78a.48b478"],[]]},{"id":"fb54e450.6d4028","type":"api-current-state","z":"35cb9760.bf0558","name":"Ar Ligado?","server":"27f1aa3c.860de6","version":2,"outputs":2,"halt_if":"cool","halt_if_type":"str","halt_if_compare":"is","entity_id":"climate.ar_escritorio","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"x":550,"y":2320,"wires":[[],["33bff024a31157c6"]]},{"id":"2cd00021.1c9e2","type":"api-call-service","z":"35cb9760.bf0558","name":"Desliga Ar","server":"27f1aa3c.860de6","version":3,"debugenabled":false,"service_domain":"climate","service":"turn_off","entityId":"climate.ar_escritorio","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":570,"y":2420,"wires":[["26f024c8.0af4ec"]]},{"id":"35c119be.2c80e6","type":"api-current-state","z":"35cb9760.bf0558","name":"Ar Ligado?","server":"27f1aa3c.860de6","version":2,"outputs":2,"halt_if":"cool","halt_if_type":"str","halt_if_compare":"is","entity_id":"climate.ar_escritorio","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"x":370,"y":2420,"wires":[["2cd00021.1c9e2"],[]]},{"id":"1e5ba60f.770a7a","type":"api-call-service","z":"35cb9760.bf0558","name":"Liga Ar","server":"27f1aa3c.860de6","version":3,"debugenabled":false,"service_domain":"climate","service":"turn_on","entityId":"climate.ar_escritorio","data":"","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":920,"y":2320,"wires":[["b67464e8.8d1a68"]]},{"id":"5b3352e1.f8bddc","type":"server-state-changed","z":"35cb9760.bf0558","name":"IC Escritório <= 25","server":"27f1aa3c.860de6","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.icalor_escritorio","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","haltifstate":"25","halt_if_type":"num","halt_if_compare":"lte","outputs":2,"output_only_on_state_change":true,"for":"10","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":150,"y":2420,"wires":[["35c119be.2c80e6"],[]]},{"id":"26f024c8.0af4ec","type":"api-call-service","z":"35cb9760.bf0558","name":"Volume","server":"27f1aa3c.860de6","version":3,"debugenabled":false,"service_domain":"media_player","service":"volume_set","entityId":"media_player.googlenestpointb041","data":"{\"volume_level\":0.4}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":740,"y":2420,"wires":[["fe8c26df.01d508"]]},{"id":"fe8c26df.01d508","type":"api-current-state","z":"35cb9760.bf0558","name":"IC","server":"27f1aa3c.860de6","version":2,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"sensor.icalor_escritorio","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"x":890,"y":2420,"wires":[["90d9f5da.a4a028"]]},{"id":"205cd78a.48b478","type":"api-current-state","z":"35cb9760.bf0558","name":"Note Ligado?","server":"27f1aa3c.860de6","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"binary_sensor.note_lenovo","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"x":370,"y":2320,"wires":[["fb54e450.6d4028"],[]]},{"id":"76e3793a81ed5120","type":"api-call-service","z":"35cb9760.bf0558","name":"TTS","server":"27f1aa3c.860de6","version":3,"debugenabled":false,"service_domain":"tts","service":"cloud_say","entityId":"media_player.googlenestpointb041","data":"{\"message\":\"Gostaria de Ligar o Ar Condicionado, mas a porta está aberta.\"}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":910,"y":2240,"wires":[[]],"icon":"node-red-contrib-cast/home.png"},{"id":"33bff024a31157c6","type":"api-current-state","z":"35cb9760.bf0558","name":"Porta Aberta?","server":"27f1aa3c.860de6","version":2,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"binary_sensor.porta_do_escritorio_contact","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"x":740,"y":2320,"wires":[["76e3793a81ed5120"],["1e5ba60f.770a7a"]]},{"id":"c5f92cf8f8002857","type":"server-state-changed","z":"35cb9760.bf0558","name":"Porta Escritório Fecha","server":"27f1aa3c.860de6","version":3,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.porta_do_escritorio_contact","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"off","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":160,"y":2240,"wires":[["6acede2b316b72f2"],[]]},{"id":"6acede2b316b72f2","type":"api-current-state","z":"35cb9760.bf0558","name":"IC Escritorio >= 29","server":"27f1aa3c.860de6","version":2,"outputs":2,"halt_if":"29","halt_if_type":"num","halt_if_compare":"gte","entity_id":"sensor.icalor_escritorio","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"x":390,"y":2240,"wires":[["205cd78a.48b478"],[]]},{"id":"b67464e8.8d1a68","type":"api-call-service","z":"35cb9760.bf0558","name":"Notify Iphone","server":"27f1aa3c.860de6","version":3,"debugenabled":false,"service_domain":"notify","service":"mobile_app_iphone_de_patrick","entityId":"","data":"{\"message\":\"Ar Condicionado do escritório ligado!\"}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1090,"y":2320,"wires":[[]]},{"id":"90d9f5da.a4a028","type":"api-call-service","z":"35cb9760.bf0558","name":"TTS","server":"27f1aa3c.860de6","version":3,"debugenabled":false,"service_domain":"tts","service":"cloud_say","entityId":"media_player.googlenestpointb041","data":"{\"message\":\"Ar condicionado desligado! Índice de Calor em {{payload}} Graus!\"}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1030,"y":2420,"wires":[[]],"icon":"node-red-contrib-cast/home.png"},{"id":"e209151d.3f10a8","type":"comment","z":"35cb9760.bf0558","name":"Temperatura e Ar Condicionado","info":"","x":190,"y":2160,"wires":[]},{"id":"27f1aa3c.860de6","type":"server","name":"HA","version":1,"legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]