Como ligar um reed a um Sonoff


(Helder Lima) #41

00:00:00 Project sonoff Sonoff Version 6.5.0(release-sonoff)-2_3_0
00:00:00 RUL: SWITCH2#BOOT=0 performs “publish2 cmnd/reedswitch/POWER2 OFF”
00:00:00 RSL: cmnd/reedswitch/POWER2 = OFF
00:00:00 WIF: Connecting to AP1 Wifi-lan1 in mode 11N as nodemcu2-3231…
00:00:03 WIF: Connected
00:00:03 HTP: Web server active on nodemcu2-3231 with IP address 192.168.1.70
23:40:27 MQT: Attempting connection…
23:40:29 MQT: Connected
23:40:29 MQT: tele/nodemcu2/LWT = Online (retained)
23:40:29 MQT: cmnd/nodemcu2/POWER =
23:40:29 MQT: stat/nodemcu2/RESULT = {“POWER5”:“OFF”}
23:40:29 MQT: stat/nodemcu2/POWER5 = OFF (retained)
23:40:29 MQT: tele/nodemcu2/INFO1 = {“Module”:“Generic”,“Version”:“6.5.0(release-sonoff)”,“FallbackTopic”:“cmnd/nodemcu2_fb/”,“GroupTopic”:“sonoffs”}
23:40:29 MQT: tele/nodemcu2/INFO2 = {“WebServerMode”:“Admin”,“Hostname”:“nodemcu2-3231”,“IPAddress”:“192.168.1.70”}
23:40:29 MQT: tele/nodemcu2/INFO3 = {“RestartReason”:“External System”}
23:40:29 MQT: stat/nodemcu2/RESULT = {“POWER1”:“OFF”}
23:40:29 MQT: stat/nodemcu2/POWER1 = OFF (retained)
23:40:29 MQT: stat/nodemcu2/RESULT = {“POWER2”:“OFF”}
23:40:29 MQT: stat/nodemcu2/POWER2 = OFF (retained)
23:40:29 MQT: stat/nodemcu2/RESULT = {“POWER3”:“OFF”}
23:40:29 MQT: stat/nodemcu2/POWER3 = OFF (retained)
23:40:29 MQT: stat/nodemcu2/RESULT = {“POWER4”:“OFF”}
23:40:29 MQT: stat/nodemcu2/POWER4 = OFF (retained)
23:40:29 MQT: stat/nodemcu2/RESULT = {“POWER5”:“OFF”}
23:40:29 MQT: stat/nodemcu2/POWER5 = OFF (retained)
23:40:29 MQT: stat/nodemcu2/RESULT = {“POWER1”:“OFF”}
23:40:29 MQT: stat/nodemcu2/POWER1 = OFF (retained)
23:40:29 MQT: stat/nodemcu2/RESULT = {“POWER2”:“OFF”}
23:40:29 MQT: stat/nodemcu2/POWER2 = OFF (retained)
23:40:30 MQT: stat/nodemcu2/RESULT = {“POWER3”:“OFF”}
23:40:30 MQT: stat/nodemcu2/POWER3 = OFF (retained)
23:40:30 MQT: stat/nodemcu2/RESULT = {“POWER4”:“OFF”}
23:40:30 MQT: stat/nodemcu2/POWER4 = OFF (retained)
23:40:37 MQT: tele/nodemcu2/STATE = {“Time”:“2019-04-06T23:40:37”,“Uptime”:“0T00:00:14”,“Vcc”:2.752,“SleepMode”:“Dynamic”,“Sleep”:50,“LoadAvg”:19,“POWER1”:“OFF”,“POWER2”:“OFF”,“POWER3”:“OFF”,“POWER4”:“OFF”,“POWER5”:“OFF”,“Wifi”:{“AP”:1,“SSId”:“Wifi-lan1”,“BSSId”:“C4:FF:1F:6A:E6:6C”,“Channel”:6,“RSSI”:78,“LinkCount”:1,“Downtime”:“0T00:00:03”}}
23:40:38 MQT: tele/nodemcu2/SENSOR = {“Time”:“2019-04-06T23:40:37”,“Switch2”:“OFF”}


(Nuno Neves) #42

Ok, já identifiquei o problema… Tenta assim…
rule1 on switch2#boot=1 do var1 ON endon on switch2#boot=0 do var1 OFF endon on Mqtt#Connected do backlog delay 10; publish2 cmnd/reedswitch/POWER2 %var1% endon


(Helder Lima) #43

Top! @Maddoctor está a funcionar impecável muito obrigado pela ajuda!!!:grinning:


(Jorge Assunção) #44

O problema era o Tasmota estar a enviar o estado antes de ter ligação ao MQTT.


(Nuno Neves) #45

Exactamente, esse era o problema da penúltima rule que tinha sugerido @j_assuncao ! :wink:


(Luis Miguel Sousa) #46

Uma dúvida!

É possível ligar um interruptor fim de curso


em vez do reed switch
reedswitch

A idéa é verificar se uma caixa de correio é aberta.

Obrigado


(Jorge Assunção) #47

Sim, podes ligar qualquer equipamento passivo que faça on/off.