switchMode question

129 views
Skip to first unread message

Toshi Bass

unread,
Oct 1, 2017, 12:56:04 PM10/1/17
to SonoffUsers
Hi I am quite new to Tasmota and have a question regarding SwitchMode / SwitchTopic

What I would like to do is connect a reed switch to rx or tx, gpio 1 or gpio 3 on a sonoff s20 and send a mqtt message only (I do not want to activate the sonoff relay when the reed switch is activated/deactivated) I just want to to see a mqtt message in node-red when the state of say gpio 1 (or gpio 3) state changes.

is it possable ?

I am quite confused with the cmds SwitchMode and SwitchTopic as to which cmd I need to use, and if I would just short the relative gpio pin to ground when activating the reed switch or if I would need to use a resistor from one side of the reed switch to +ve like you would on a raspberry pi gpio

any help would be appreciated thanks

Toshi Bass

unread,
Oct 2, 2017, 6:04:29 AM10/2/17
to SonoffUsers
OK found the info I needed     https://github.com/arendst/Sonoff-Tasmota/wiki/Understanding-SwitchMode-and-SwitchTopic

In node-red

I set the SwitchTopic with msg.topic="cmnd/sonoff_s20_1/SwitchTopic";   msg.payload="sonoff_s20_1_reed_switch";

I set the TX SwitchMode with msg.topic="cmnd/sonoff_s20_1/SwitchMode2";   msg.payload="2";

and with a mqtt node with Topic cmnd/sonoff_s20_1_reed_switch/POWER2 when I activate the reed switch I get "ON" and when i deactivate the reed switch I get "OFF" (sonoff relay does not activate in this mode) Perfect...



The only thing I am missing is being able to get the state of  sonoff_s20_1_reed_switch  on say power on ... any ideas anyone ?


Toshi Bass

unread,
Oct 3, 2017, 1:14:53 PM10/3/17
to SonoffUsers
Ok I figured out this as well, thanks for all the help NOT !

Thomas Walter

unread,
Oct 3, 2017, 3:33:37 PM10/3/17
to sonof...@googlegroups.com
Hey Toshi,

Am 03.10.17 um 19:14 schrieb Toshi Bass:
> Ok I figured out this as well, thanks for all the help NOT !

since there seems to be nobody in here who knew the answer (or perhaps
was busy working on the software that was provided to you for free), it
would have been nice if you explained your solution for others looking
for the same answer.

Balu
Reply all
Reply to author
Forward
0 new messages