AIF - Agricultura Interior Forçada

Equipamento Tasmoteado. Terminaram os problemas com a perca de comunicação dos SonOffs com a cloud.

1 Curtiu

Bom dia Pessoal!

Estou a alguns dias nesta batalha e sem sucesso. (Já segui algumas orientações e nada :S )

Isto é o Sistema de Exaustao que é On/Off consoante a temperatura.
A questão aqui é iniciar um ciclo infinito no Purificador (ON 1minuto, OFF 2m), Enquanto o Exaustor (E Não o SISTEMA de Exaustao) está ON! Quando o EXAUSTOR Desliga, Força o Purificador a Parar.

O que está a acontecer é que o Exaustor Pára, mas o Purificador continua a fazer o ciclo.

Deixo aqui o Flow. :S

[{"id":"d702c63b.736f08","type":"tab","label":"Exhaustion System","disabled":false,"info":""},{"id":"e68593ac.3b9f","type":"api-call-service","z":"d702c63b.736f08","name":"Purifier Off","server":"92cf13e3.01318","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.purifier","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":630,"y":440,"wires":[["6b4d104d.454"]]},{"id":"7df118fa.47b778","type":"api-call-service","z":"d702c63b.736f08","name":"Exhaustion Off","server":"92cf13e3.01318","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.exhaustion","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":620,"y":500,"wires":[["6b4d104d.454"]]},{"id":"73345fd1.0dfde","type":"api-call-service","z":"d702c63b.736f08","name":"Exhaustion On","server":"92cf13e3.01318","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.exhaustion","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":480,"y":380,"wires":[["6b4d104d.454","748b1b2f.ef2ff4"]]},{"id":"5e146776.f8c338","type":"delay","z":"d702c63b.736f08","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":460,"y":500,"wires":[["7df118fa.47b778"]]},{"id":"ff8a339f.90b9b","type":"api-current-state","z":"d702c63b.736f08","name":"Purifier ON?","server":"92cf13e3.01318","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.purifier","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":470,"y":440,"wires":[["e68593ac.3b9f"],[]]},{"id":"a31d0e05.62f72","type":"api-current-state","z":"d702c63b.736f08","name":"Exhaustion ON?","server":"92cf13e3.01318","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.exhaustion","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":280,"y":440,"wires":[["ff8a339f.90b9b","5e146776.f8c338"],[]]},{"id":"8c8827a0.b1e088","type":"api-current-state","z":"d702c63b.736f08","name":"Exhaustion OFF?","server":"92cf13e3.01318","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.exhaustion","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":290,"y":380,"wires":[["73345fd1.0dfde"],[]]},{"id":"c19d57dc.4f35c8","type":"comment","z":"d702c63b.736f08","name":"Exaustion System","info":"","x":350,"y":20,"wires":[]},{"id":"6b4d104d.454","type":"function","z":"d702c63b.736f08","name":"OK","func":"var mystate = msg.payload.service.split('_')[1];\nvar mydevice = msg.payload.data.entity_id.split('.')[1];\nvar mytext = '--> ' + mydevice + ' está ' + mystate + ' ! ';\nreturn {'payload': {'text':mytext}};","outputs":1,"noerr":0,"initialize":"","finalize":"","x":830,"y":440,"wires":[["1d08a770.946269"]]},{"id":"1d08a770.946269","type":"change","z":"d702c63b.736f08","name":"PrettyNames","rules":[{"t":"change","p":"payload.text","pt":"msg","from":"exhaustion","fromt":"str","to":"Exhaustor","tot":"str"},{"t":"change","p":"payload.text","pt":"msg","from":"purifier","fromt":"str","to":"Purifier","tot":"str"},{"t":"change","p":"payload.text","pt":"msg","from":"off","fromt":"str","to":"OFF","tot":"str"},{"t":"change","p":"payload.text","pt":"msg","from":"on","fromt":"str","to":"ON","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":890,"y":400,"wires":[["1da0e32e.267e6d"]]},{"id":"1da0e32e.267e6d","type":"link out","z":"d702c63b.736f08","name":"TelegramOut","links":["f1029ef3.20edd"],"x":935,"y":480,"wires":[]},{"id":"6e510c31.ecaf64","type":"api-current-state","z":"d702c63b.736f08","name":"General","server":"92cf13e3.01318","version":1,"outputs":2,"halt_if":"true","halt_if_type":"bool","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.terrarium1","state_type":"habool","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":120,"y":460,"wires":[["a31d0e05.62f72"],["a31d0e05.62f72"]]},{"id":"ec67df6e.7f5e2","type":"server-state-changed","z":"d702c63b.736f08","name":"Exhaust System","server":"92cf13e3.01318","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.general_exhaust","entityidfiltertype":"exact","outputinitially":true,"state_type":"habool","haltifstate":"true","halt_if_type":"bool","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,"x":100,"y":400,"wires":[["8c8827a0.b1e088"],["6e510c31.ecaf64"]]},{"id":"a66d8d83.10647","type":"api-call-service","z":"d702c63b.736f08","name":"Purifier On","server":"92cf13e3.01318","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.purifier","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":270,"y":100,"wires":[["1ec735ee.15df1a","6b4d104d.454"]]},{"id":"4e309f7b.0a00c","type":"actionflows","z":"d702c63b.736f08","info":"Describe your action API here.","untilproptype":"num","proptype":"msg","name":"loop","prop":"loop","untilprop":0,"until":"gt","loop":"inc0","scope":"global","perf":false,"seq":false,"x":330,"y":160,"wires":[["9e8807e1.631be8"]]},{"id":"1ec735ee.15df1a","type":"delay","z":"d702c63b.736f08","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":420,"y":100,"wires":[["7db2b0c5.9eb52"]]},{"id":"d7a9950e.e48628","type":"delay","z":"d702c63b.736f08","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":900,"y":100,"wires":[["748b1b2f.ef2ff4"]]},{"id":"efbc6a4d.b59fe8","type":"api-call-service","z":"d702c63b.736f08","name":"Purifier Off","server":"92cf13e3.01318","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.purifier","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":750,"y":100,"wires":[["d7a9950e.e48628","6b4d104d.454"]]},{"id":"81b48b73.c11b78","type":"change","z":"d702c63b.736f08","name":"set Stop","rules":[{"t":"set","p":"payload","pt":"msg","to":"stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":440,"y":220,"wires":[["4e309f7b.0a00c"]]},{"id":"9e8807e1.631be8","type":"api-current-state","z":"d702c63b.736f08","name":"Purifier OFF?","server":"92cf13e3.01318","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.purifier","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":100,"y":100,"wires":[["a66d8d83.10647"],[]]},{"id":"7db2b0c5.9eb52","type":"api-current-state","z":"d702c63b.736f08","name":"Purifier ON?","server":"92cf13e3.01318","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.purifier","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":570,"y":100,"wires":[["efbc6a4d.b59fe8"],[]]},{"id":"748b1b2f.ef2ff4","type":"api-current-state","z":"d702c63b.736f08","name":"Exhaustion OFF?","server":"92cf13e3.01318","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.exhaustion","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":210,"y":260,"wires":[["81b48b73.c11b78"],["4e309f7b.0a00c"]]},{"id":"92cf13e3.01318","type":"server","name":"Home Assistant","addon":true}]

EDIT: RESOLVIDO!!! FINALMENTE :smiley:

Aqui fica a solução!

[{"id":"d702c63b.736f08","type":"tab","label":"Exhaustion System","disabled":false,"info":""},{"id":"e68593ac.3b9f","type":"api-call-service","z":"d702c63b.736f08","name":"Purifier Off","server":"92cf13e3.01318","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.purifier","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":630,"y":280,"wires":[["6b4d104d.454"]]},{"id":"7df118fa.47b778","type":"api-call-service","z":"d702c63b.736f08","name":"Exhaustion Off","server":"92cf13e3.01318","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.exhaustion","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":620,"y":340,"wires":[["6b4d104d.454"]]},{"id":"73345fd1.0dfde","type":"api-call-service","z":"d702c63b.736f08","name":"Exhaustion On","server":"92cf13e3.01318","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.exhaustion","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":480,"y":220,"wires":[["6b4d104d.454","8fc24026.42e64"]]},{"id":"5e146776.f8c338","type":"delay","z":"d702c63b.736f08","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":460,"y":340,"wires":[["7df118fa.47b778"]]},{"id":"ff8a339f.90b9b","type":"api-current-state","z":"d702c63b.736f08","name":"Purifier ON?","server":"92cf13e3.01318","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.purifier","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":470,"y":280,"wires":[["e68593ac.3b9f"],[]]},{"id":"a31d0e05.62f72","type":"api-current-state","z":"d702c63b.736f08","name":"Exhaustion ON?","server":"92cf13e3.01318","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.exhaustion","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":280,"y":280,"wires":[["ff8a339f.90b9b","5e146776.f8c338"],[]]},{"id":"8c8827a0.b1e088","type":"api-current-state","z":"d702c63b.736f08","name":"Exhaustion OFF?","server":"92cf13e3.01318","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.exhaustion","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":290,"y":220,"wires":[["73345fd1.0dfde"],[]]},{"id":"c19d57dc.4f35c8","type":"comment","z":"d702c63b.736f08","name":"Exaustion System","info":"","x":350,"y":20,"wires":[]},{"id":"6b4d104d.454","type":"function","z":"d702c63b.736f08","name":"OK","func":"var mystate = msg.payload.service.split('_')[1];\nvar mydevice = msg.payload.data.entity_id.split('.')[1];\nvar mytext = '--> ' + mydevice + ' está ' + mystate + ' ! ';\nreturn {'payload': {'text':mytext}};","outputs":1,"noerr":0,"initialize":"","finalize":"","x":830,"y":280,"wires":[["1d08a770.946269"]]},{"id":"1d08a770.946269","type":"change","z":"d702c63b.736f08","name":"PrettyNames","rules":[{"t":"change","p":"payload.text","pt":"msg","from":"exhaustion","fromt":"str","to":"Exhaustor","tot":"str"},{"t":"change","p":"payload.text","pt":"msg","from":"purifier","fromt":"str","to":"Purifier","tot":"str"},{"t":"change","p":"payload.text","pt":"msg","from":"off","fromt":"str","to":"OFF","tot":"str"},{"t":"change","p":"payload.text","pt":"msg","from":"on","fromt":"str","to":"ON","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":890,"y":240,"wires":[["1da0e32e.267e6d"]]},{"id":"1da0e32e.267e6d","type":"link out","z":"d702c63b.736f08","name":"TelegramOut","links":["f1029ef3.20edd"],"x":935,"y":320,"wires":[]},{"id":"6e510c31.ecaf64","type":"api-current-state","z":"d702c63b.736f08","name":"General","server":"92cf13e3.01318","version":1,"outputs":2,"halt_if":"true","halt_if_type":"bool","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.terrarium1","state_type":"habool","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":120,"y":300,"wires":[["a31d0e05.62f72"],["a31d0e05.62f72"]]},{"id":"ec67df6e.7f5e2","type":"server-state-changed","z":"d702c63b.736f08","name":"Exhaust System","server":"92cf13e3.01318","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.general_exhaust","entityidfiltertype":"exact","outputinitially":true,"state_type":"habool","haltifstate":"true","halt_if_type":"bool","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,"x":100,"y":240,"wires":[["8c8827a0.b1e088"],["6e510c31.ecaf64"]]},{"id":"a66d8d83.10647","type":"api-call-service","z":"d702c63b.736f08","name":"Purifier On","server":"92cf13e3.01318","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.purifier","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":290,"y":80,"wires":[["1ec735ee.15df1a","6b4d104d.454"]]},{"id":"1ec735ee.15df1a","type":"delay","z":"d702c63b.736f08","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":440,"y":80,"wires":[["7db2b0c5.9eb52"]]},{"id":"d7a9950e.e48628","type":"delay","z":"d702c63b.736f08","name":"","pauseType":"delay","timeout":"6","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":440,"y":160,"wires":[["8fc24026.42e64"]]},{"id":"efbc6a4d.b59fe8","type":"api-call-service","z":"d702c63b.736f08","name":"Purifier Off","server":"92cf13e3.01318","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.purifier","data":"","dataType":"jsonata","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":290,"y":160,"wires":[["d7a9950e.e48628","6b4d104d.454"]]},{"id":"9e8807e1.631be8","type":"api-current-state","z":"d702c63b.736f08","name":"Purifier OFF?","server":"92cf13e3.01318","version":1,"outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.purifier","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":120,"y":80,"wires":[["a66d8d83.10647"],[]]},{"id":"7db2b0c5.9eb52","type":"api-current-state","z":"d702c63b.736f08","name":"Purifier ON?","server":"92cf13e3.01318","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.purifier","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":110,"y":160,"wires":[["efbc6a4d.b59fe8"],[]]},{"id":"78f1dd94.9195b4","type":"api-current-state","z":"d702c63b.736f08","name":"Exhaustion ON?","server":"92cf13e3.01318","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"switch.exhaustion","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":820,"y":160,"wires":[["9e8807e1.631be8"],["46d57088.32129"]]},{"id":"8fc24026.42e64","type":"actionflows","z":"d702c63b.736f08","info":"Describe your action API here.","untilproptype":"num","proptype":"msg","name":"loop","prop":"loop","untilprop":0,"until":"gt","loop":"inc0","scope":"global","perf":false,"seq":false,"x":670,"y":160,"wires":[["78f1dd94.9195b4"]]},{"id":"46d57088.32129","type":"change","z":"d702c63b.736f08","name":"set Stop","rules":[{"t":"set","p":"payload","pt":"msg","to":"stop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":80,"wires":[["8fc24026.42e64"]]},{"id":"92cf13e3.01318","type":"server","name":"Home Assistant","addon":true}]

UPDATE: Afinal não est+a bem … :confused:

1 Curtiu

Agora sim e foi usado um pallete “looptimer-advanced” :slight_smile:


Copyright © 2017-2021. Todos os direitos reservados
CPHA.pt - info@cpha.pt


FAQ | Termos de Serviço/Regras | Política de Privacidade