Boa tarde Malta da “casa assistida” !
Derivado a variados pensamentos e raciocinios cheguei a esta conclusão! Decidi alterar o projecto, pois não faz sentido (para mim/ minha utilidade) activar por Modo de crescimento (germinação, vegetação, Floração), pois no temporizador eu vou gerir o horário que pretento.
Ficando assim o Dashboard:
E aqui o NR:
Flow:
[{"id":"333b236c.784a0c","type":"tab","label":"Terrario1","disabled":false,"info":""},{"id":"cfe78da9.cd351","type":"poll-state","z":"333b236c.784a0c","name":"Hora Ligar","server":"cfe1d51.9440928","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"1","updateIntervalUnits":"minutes","outputinitially":false,"outputonchanged":false,"entity_id":"input_datetime.ligar_luz1","state_type":"str","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":80,"y":280,"wires":[["9f013612.1daa58"]]},{"id":"9f013612.1daa58","type":"template","z":"333b236c.784a0c","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"ontime {{payload}}","output":"str","x":260,"y":260,"wires":[["805845ce.bec568"]]},{"id":"9c34559a.095888","type":"poll-state","z":"333b236c.784a0c","name":"Hora Desligar","server":"cfe1d51.9440928","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"1","updateIntervalUnits":"minutes","outputinitially":false,"outputonchanged":false,"entity_id":"input_datetime.desligar_luz1","state_type":"str","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":90,"y":360,"wires":[["29dbf656.b34cca"]]},{"id":"29dbf656.b34cca","type":"template","z":"333b236c.784a0c","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"offtime {{payload}}","output":"str","x":260,"y":380,"wires":[["805845ce.bec568"]]},{"id":"805845ce.bec568","type":"schedex","z":"333b236c.784a0c","name":"Timer","passthroughunhandled":false,"suspended":false,"lat":"","lon":"","ontime":"07:28","ontopic":"","onpayload":"1","onoffset":0,"onrandomoffset":0,"offtime":"goldenHour","offtopic":"","offpayload":"0","offoffset":0,"offrandomoffset":0,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"x":250,"y":320,"wires":[["6594bebd.3b182"]]},{"id":"3f8c643f.52b9ec","type":"switch","z":"333b236c.784a0c","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":530,"y":320,"wires":[["a3901a38.e53838"],["b06a3c59.3baeb"]]},{"id":"a3901a38.e53838","type":"api-current-state","z":"333b236c.784a0c","name":"Led Ligada?","server":"cfe1d51.9440928","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.sonoff_1000d9861d","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":510,"y":280,"wires":[[],["9096c36.dd7d94"]]},{"id":"b06a3c59.3baeb","type":"api-current-state","z":"333b236c.784a0c","name":"Led Desligada?","server":"cfe1d51.9440928","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.sonoff_1000d9861d","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":500,"y":380,"wires":[[],["32cd9918.2a5df6"]]},{"id":"9096c36.dd7d94","type":"api-call-service","z":"333b236c.784a0c","name":"Led1 Ligar","server":"cfe1d51.9440928","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.sonoff_1000d9861d","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":670,"y":280,"wires":[["2eb1e209.15bf1e"]]},{"id":"32cd9918.2a5df6","type":"api-call-service","z":"333b236c.784a0c","name":"Led1 Desligar","server":"cfe1d51.9440928","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.sonoff_1000d9861d","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":680,"y":380,"wires":[["2eb1e209.15bf1e"]]},{"id":"6594bebd.3b182","type":"api-current-state","z":"333b236c.784a0c","name":"Geral","server":"cfe1d51.9440928","version":1,"outputs":2,"halt_if":"true","halt_if_type":"bool","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.terrario1","state_type":"habool","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":370,"y":320,"wires":[["3f8c643f.52b9ec"],["b06a3c59.3baeb"]]},{"id":"e8eb0145.02655","type":"change","z":"333b236c.784a0c","name":"Nomes Dispositivos","rules":[{"t":"change","p":"payload.text","pt":"msg","from":"sonoff_1000da512f","fromt":"str","to":"Fan Auxiliar","tot":"str"},{"t":"change","p":"payload.text","pt":"msg","from":"sonoff_1000d9861d","fromt":"str","to":"Luz1","tot":"str"},{"t":"change","p":"payload.text","pt":"msg","from":"sonoff_1000d9ef4a","fromt":"str","to":"Exaustor","tot":"str"},{"t":"change","p":"payload.text","pt":"msg","from":"sonoff_1000d98c59","fromt":"str","to":"Aquecedor","tot":"str"},{"t":"change","p":"payload.text","pt":"msg","from":"sonoff_1000d98be8","fromt":"str","to":"Desumidificador","tot":"str"},{"t":"change","p":"payload.text","pt":"msg","from":"sonoff_1000d91305","fromt":"str","to":"Led2","tot":"str"},{"t":"change","p":"payload.text","pt":"msg","from":"sonoff_100103178a","fromt":"str","to":"Purificador","tot":"str"},{"t":"change","p":"payload.text","pt":"msg","from":"off","fromt":"str","to":"Desligado","tot":"str"},{"t":"change","p":"payload.text","pt":"msg","from":"on","fromt":"str","to":"Ligado","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1150,"y":200,"wires":[["bd1f1b38.584708"]]},{"id":"2eb1e209.15bf1e","type":"function","z":"333b236c.784a0c","name":"OK","func":"var estado = msg.payload.service.split('_')[1]\nvar dispositivo = msg.payload.data.entity_id.split('.')[1]\n// var geral = msg.topic\nvar texto = '--> ' + dispositivo + ' está ' + estado + ' ! ';\nreturn {'payload': {'text':texto}};","outputs":1,"noerr":0,"initialize":"","finalize":"","x":990,"y":200,"wires":[["e8eb0145.02655"]]},{"id":"92786d10.8f71a","type":"comment","z":"333b236c.784a0c","name":"Quadro Geral","info":"","x":270,"y":40,"wires":[]},{"id":"ffad79ef.391fc8","type":"comment","z":"333b236c.784a0c","name":"Temporizador","info":"","x":270,"y":200,"wires":[]},{"id":"5b86b33d.d8269c","type":"comment","z":"333b236c.784a0c","name":"Humidade OK","info":"","x":250,"y":820,"wires":[]},{"id":"d13122e4.47f84","type":"server-state-changed","z":"333b236c.784a0c","name":"Humi Target","server":"cfe1d51.9440928","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.humidity_target","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","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,"x":90,"y":860,"wires":[["4eb472eb.f198ec"]]},{"id":"22eb5f51.962c6","type":"server-state-changed","z":"333b236c.784a0c","name":"Humi Toler","server":"cfe1d51.9440928","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.humidity_tolerance","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","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,"x":80,"y":920,"wires":[["4eb472eb.f198ec"]]},{"id":"a7c264a8.88ff88","type":"server-state-changed","z":"333b236c.784a0c","name":"Humi Actual","server":"cfe1d51.9440928","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.sonoff_100103178a_humidity","entityidfiltertype":"exact","outputinitially":false,"state_type":"num","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,"x":90,"y":980,"wires":[["4eb472eb.f198ec"]]},{"id":"5a7bcfbf.4af22","type":"api-current-state","z":"333b236c.784a0c","name":"Desumidificador Off?","server":"cfe1d51.9440928","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.sonoff_1000d98be8","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":460,"y":860,"wires":[["9c981f68.08fcc"],[]]},{"id":"75310d11.9c8084","type":"api-current-state","z":"333b236c.784a0c","name":"Desumidificador On?","server":"cfe1d51.9440928","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.sonoff_1000d98be8","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":460,"y":980,"wires":[["a78c569c.a2d3d8"],[]]},{"id":"9c981f68.08fcc","type":"api-call-service","z":"333b236c.784a0c","name":"Desumidificador on","server":"cfe1d51.9440928","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.sonoff_1000d98be8","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":570,"y":900,"wires":[["2eb1e209.15bf1e"]]},{"id":"a78c569c.a2d3d8","type":"api-call-service","z":"333b236c.784a0c","name":"Desumidificador off","server":"cfe1d51.9440928","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.sonoff_1000d98be8","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":570,"y":940,"wires":[["2eb1e209.15bf1e"]]},{"id":"4eb472eb.f198ec","type":"join","z":"333b236c.784a0c","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":230,"y":920,"wires":[["ff24b62c.3aa8e8"]]},{"id":"ff24b62c.3aa8e8","type":"function","z":"333b236c.784a0c","name":"","func":"let grHumidity = msg.payload[\"sensor.sonoff_100103178a_humidity\"];\nlet grHumidityTarget = msg.payload[\"input_number.humidity_target\"];\nlet grHumidityTolerance = msg.payload[\"input_number.humidity_tolerance\"];\n\nif (grHumidity < (grHumidityTarget + grHumidityTolerance)) {\n return [msg, null];\n} else if (grHumidity > (grHumidityTarget - grHumidityTolerance)) {\n return [null, msg];\n}","outputs":2,"noerr":0,"initialize":"","finalize":"","x":360,"y":920,"wires":[["5a7bcfbf.4af22"],["75310d11.9c8084"]]},{"id":"9fbfc574.ccdd28","type":"api-call-service","z":"333b236c.784a0c","name":"Aquecedor ON","server":"cfe1d51.9440928","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.sonoff_1000d98c59","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":760,"y":480,"wires":[["2eb1e209.15bf1e"]]},{"id":"d60e082b.ca2e88","type":"api-call-service","z":"333b236c.784a0c","name":"Aquecedor Off","server":"cfe1d51.9440928","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.sonoff_1000d98c59","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":740,"y":540,"wires":[["2eb1e209.15bf1e"]]},{"id":"5f0e142e.20ed1c","type":"api-current-state","z":"333b236c.784a0c","name":"Aquecedor ON?","server":"cfe1d51.9440928","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.sonoff_1000d98c59","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":560,"y":540,"wires":[["d60e082b.ca2e88"],[]]},{"id":"c6f7cdae.4d3c2","type":"api-current-state","z":"333b236c.784a0c","name":"Aquecedor OFF?","server":"cfe1d51.9440928","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.sonoff_1000d98c59","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":570,"y":480,"wires":[["9fbfc574.ccdd28"],[]]},{"id":"b5312263.ee9be","type":"api-call-service","z":"333b236c.784a0c","name":"Exaustor On","server":"cfe1d51.9440928","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.sonoff_1000d9ef4a","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1030,"y":540,"wires":[["2eb1e209.15bf1e"]]},{"id":"99458dd5.6d721","type":"api-call-service","z":"333b236c.784a0c","name":"Exaustor Off","server":"cfe1d51.9440928","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.sonoff_1000d9ef4a","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1030,"y":720,"wires":[["2eb1e209.15bf1e"]]},{"id":"d9af1feb.dd9d6","type":"api-current-state","z":"333b236c.784a0c","name":"Exaustor OFF?","server":"cfe1d51.9440928","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.sonoff_1000d9ef4a","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":560,"y":600,"wires":[["b5312263.ee9be","3f8779bd.afdcb6"],[]]},{"id":"fb34f377.c14d2","type":"api-call-service","z":"333b236c.784a0c","name":"Fan ON","server":"cfe1d51.9440928","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.sonoff_1000da512f","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":700,"y":720,"wires":[["2eb1e209.15bf1e"]]},{"id":"a0ecbf05.4d991","type":"api-call-service","z":"333b236c.784a0c","name":"Fan OFF","server":"cfe1d51.9440928","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.sonoff_1000da512f","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":700,"y":780,"wires":[["2eb1e209.15bf1e"]]},{"id":"6bf09860.e60308","type":"api-current-state","z":"333b236c.784a0c","name":"Fan ON?","server":"cfe1d51.9440928","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.sonoff_1000da512f","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":540,"y":780,"wires":[["a0ecbf05.4d991"],[]]},{"id":"a70216d8.95a638","type":"api-current-state","z":"333b236c.784a0c","name":"Fan OFF?","server":"cfe1d51.9440928","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.sonoff_1000da512f","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":550,"y":720,"wires":[["fb34f377.c14d2"],[]]},{"id":"3183fdfb.b0a622","type":"comment","z":"333b236c.784a0c","name":"Termometro","info":"","x":270,"y":460,"wires":[]},{"id":"2ee34571.96e6ea","type":"api-current-state","z":"333b236c.784a0c","name":"Exaustor ON?","server":"cfe1d51.9440928","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.sonoff_1000d9ef4a","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":560,"y":660,"wires":[["be668273.71d68","f9b9ffea.824d7"],[]]},{"id":"ee53a3e2.77d6","type":"server-state-changed","z":"333b236c.784a0c","name":"Temp. Minimo","server":"cfe1d51.9440928","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.temp_minima","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","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,"x":90,"y":560,"wires":[["a045e91f.d8ded8"]]},{"id":"4e263f1d.df4d9","type":"server-state-changed","z":"333b236c.784a0c","name":"Temp. Actual","server":"cfe1d51.9440928","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"sensor.sonoff_100103178a_temperature","entityidfiltertype":"exact","outputinitially":false,"state_type":"num","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,"x":90,"y":680,"wires":[["a045e91f.d8ded8"]]},{"id":"61df5383.f35f4c","type":"server-state-changed","z":"333b236c.784a0c","name":"Temp. Maximo","server":"cfe1d51.9440928","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_number.temp_maximo","entityidfiltertype":"exact","outputinitially":true,"state_type":"num","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,"x":100,"y":620,"wires":[["a045e91f.d8ded8"]]},{"id":"a045e91f.d8ded8","type":"join","z":"333b236c.784a0c","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":true,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":270,"y":620,"wires":[["de93b43e.3448c8"]]},{"id":"de93b43e.3448c8","type":"function","z":"333b236c.784a0c","name":"","func":"if(msg.payload[\"sensor.sonoff_100103178a_temperature\"] < msg.payload[\"input_number.temp_maximo\"] && msg.payload[\"sensor.sonoff_100103178a_temperature\"] > msg.payload[\"input_number.temp_minima\"]){\n return [null, msg, null];\n}\n\nelse if(msg.payload[\"sensor.sonoff_100103178a_temperature\"] > msg.payload[\"input_number.temp_maximo\"]){\n return [null, null, msg];\n}\n\nelse if(msg.payload[\"sensor.sonoff_100103178a_temperature\"] < msg.payload[\"input_number.temp_minima\"]){\n return [msg, null, null];\n}","outputs":3,"noerr":0,"initialize":"","finalize":"","x":400,"y":620,"wires":[["c6f7cdae.4d3c2","2ee34571.96e6ea","6bf09860.e60308"],["c2a78a38.1d4528"],["5f0e142e.20ed1c","d9af1feb.dd9d6","a70216d8.95a638"]]},{"id":"bd1f1b38.584708","type":"telegrambot-payload","z":"333b236c.784a0c","name":"MyBot","bot":"3ffee45b.b9ea0c","chatId":"xxxxxx","sendMethod":"sendMessage","payload":"","x":1310,"y":200,"wires":[[]]},{"id":"17dd5adc.af6d75","type":"server-state-changed","z":"333b236c.784a0c","name":"Terrario1Geral","server":"cfe1d51.9440928","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.terrario1","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"for":0,"forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":90,"y":80,"wires":[["9edbc868.94de08"],["9edbc868.94de08","b06a3c59.3baeb","5f0e142e.20ed1c","2ee34571.96e6ea","6bf09860.e60308","75310d11.9c8084","be668273.71d68"]]},{"id":"9edbc868.94de08","type":"function","z":"333b236c.784a0c","name":"OK1","func":"// #var estado = msg.topic.split('_')[1]\nvar estado1 = msg.payload\nvar dispositivo1 = msg.topic\nvar texto1 = '-->' + dispositivo1 + ' está ' + estado1 + ' ! ';\nreturn {'payload': {'text':texto1}};","outputs":1,"noerr":0,"initialize":"","finalize":"","x":270,"y":80,"wires":[["21f01352.cb9a6c"]]},{"id":"21f01352.cb9a6c","type":"change","z":"333b236c.784a0c","name":"Nomes Dispositivos","rules":[{"t":"change","p":"payload.text","pt":"msg","from":"input_boolean.terrario2","fromt":"str","to":"Terrário2 Geral","tot":"str"},{"t":"change","p":"payload.text","pt":"msg","from":"input_boolean.terrario1","fromt":"str","to":"Terrário1 Geral","tot":"str"},{"t":"change","p":"payload.text","pt":"msg","from":"off","fromt":"str","to":"Desligado","tot":"str"},{"t":"change","p":"payload.text","pt":"msg","from":"on","fromt":"str","to":"Ligado","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":80,"wires":[["bd1f1b38.584708"]]},{"id":"2a729463.2811bc","type":"comment","z":"333b236c.784a0c","name":"Condicoes IDEAIS","info":"","x":1010,"y":900,"wires":[]},{"id":"b08a043c.07db78","type":"link in","z":"333b236c.784a0c","name":"","links":["cd0b2359.6edc4","31d1123c.217a5e","e7c748ec.f2a628"],"x":685,"y":40,"wires":[["bd1f1b38.584708"]]},{"id":"eecf2553.72b658","type":"api-current-state","z":"333b236c.784a0c","name":"Purificador Off?","server":"cfe1d51.9440928","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.sonoff_100103178a","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":860,"y":600,"wires":[["6931fa47.2e8c64"],[]]},{"id":"6931fa47.2e8c64","type":"api-call-service","z":"333b236c.784a0c","name":"Purificador on","server":"cfe1d51.9440928","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.sonoff_100103178a","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1040,"y":600,"wires":[["2eb1e209.15bf1e"]]},{"id":"be668273.71d68","type":"api-current-state","z":"333b236c.784a0c","name":"Purificador ON?","server":"cfe1d51.9440928","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.sonoff_100103178a","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":860,"y":660,"wires":[["c70cee20.f0ee3"],[]]},{"id":"c70cee20.f0ee3","type":"api-call-service","z":"333b236c.784a0c","name":"Purificador off","server":"cfe1d51.9440928","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.sonoff_100103178a","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":1040,"y":660,"wires":[["2eb1e209.15bf1e"]]},{"id":"f9b9ffea.824d7","type":"delay","z":"333b236c.784a0c","name":"Atraso","pauseType":"delay","timeout":"1","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":710,"y":680,"wires":[["99458dd5.6d721"]]},{"id":"3f8779bd.afdcb6","type":"delay","z":"333b236c.784a0c","name":"Atraso","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":710,"y":600,"wires":[["eecf2553.72b658"]]},{"id":"c2a78a38.1d4528","type":"api-current-state","z":"333b236c.784a0c","name":"Luz1 Ligada?","server":"cfe1d51.9440928","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.sonoff_1000d9861d","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":960,"y":980,"wires":[[],[]]},{"id":"cfe1d51.9440928","type":"server","name":"Home Assistant","addon":true},{"id":"3ffee45b.b9ea0c","type":"telegrambot-config","botname":"user_bot","usernames":"","chatIds":"","pollInterval":"300"}]
Material:
SonOff Basic R2 - Luz1
SonOff Basic R2 - Exaustor
SonOff Basic R2 - Desumidificador
SonOff Basic R2 - Fan Auxiliar
SonOff Basic R2 - Aquecedor
SonOff TH16 + Sensor Si7021 + OwnSwitch - Purificador
Funções:
- “Quadro Geral” - Para desactivar todos os dispositivos / Desactivar o Terrário
- Telegram Bot - Envia notificações sobre a alertas de alteração de estado de cada dispositivo
- Verifica Humidade entre valores defenidos e o actual e executa respectivas acções
- Temporizador básico para iluminação, controlado a hora que liga e desliga
- Consoante a Temperatura e Humidade Activa e desactiva a corculação de ar, aquecimento
-
Condições indicadas - A trabalhar nisto para executar um ciclo de ventilação
Aguardo Sugestões e Criticas para melhorar isto.
Até agora acho que estou a ter algum problema com a detecção de Humidade/Temperatura, parece-me que nem sempre está actualizar os valores correctamente, e verifiquei apos 48horas de teste, que volta e meia deixa de dar ordem ao Exaustor (no HA Dashboard, os Toogles não movem). :S
Próxima fase:
- Tasmotear os SonOffs, e devo resolver este problemas de “dessincronizaçao” Tik Tak
- Aguardar o Censor de qualidade de AR e o respectivo NodeMCU (ainda a caminho)
- Aplicar um alarme básico de detector de fogo, para desligar tudo e mandar notificação