Issue with MQTT switch status Tasmota

Good Morning

I am finding it difficult to show the status of a reed switch connected to a Sonoff basic in openhab.

Here is my current set up and Tasmota status 0

10:45:19 CMD: Status 0 10:45:19 MQT: stat/Sonoff_6/STATUS = {"Status":{"Module":2,"FriendlyName":["Sonoff_6"],"Topic":"Sonoff_6","ButtonTopic":"","Power":0,"PowerOnState":3,"LedState":1,"SaveData":1,"SaveState":1,"SwitchTopic":"Sonoff_6/Garage_Door","SwitchMode":[0,1,0,0,0,0,0,0],"ButtonRetain":0,"SwitchRetain":1,"SensorRetain":0,"PowerRetain":0}} 10:45:19 MQT: stat/Sonoff_6/STATUS1 = {"StatusPRM":{"Baudrate":115200,"GroupTopic":"sonoffs","OtaUrl":"http://thehackbox.org/tasmota/release/sonoff.bin","RestartReason":"Software/System restart","Uptime":"0T00:13:09","StartupUTC":"2019-06-08T09:32:10","Sleep":0,"BootCount":23,"SaveCount":76,"SaveAddress":"F8000"}} 10:45:19 MQT: stat/Sonoff_6/STATUS2 = {"StatusFWR":{"Version":"6.3.0.14(sonoff)","BuildDateTime":"2019-03-01T20:59:14","Boot":7,"Core":"2_4_2","SDK":"2.2.1(cfd48f3)"}} 10:45:19 MQT: stat/Sonoff_6/STATUS3 = {"StatusLOG":{"SerialLog":0,"WebLog":2,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["ASUSHughes",""],"TelePeriod":300,"SetOption":["0000808B","558180C0","00000000"]}} 10:45:19 MQT: stat/Sonoff_6/STATUS4 = {"StatusMEM":{"ProgramSize":536,"Free":464,"Heap":17,"ProgramFlashSize":1024,"FlashSize":1024,"FlashChipId":"144051","FlashMode":3,"Features":["00000809","0FDAE794","000383A0","23B617CE","00003BC0"]}} 10:45:19 MQT: stat/Sonoff_6/STATUS5 = {"StatusNET":{"Hostname":"Sonoff_6-6203","IPAddress":"192.168.1.105","Gateway":"192.168.1.1","Subnetmask":"255.255.255.0","DNSServer":"8.8.8.8","Mac":"DC:4F:22:93:38:3B","Webserver":2,"WifiConfig":4}} 10:45:19 MQT: stat/Sonoff_6/STATUS6 = {"StatusMQT":{"MqttHost":"192.168.1.113","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_93383B","MqttUser":"","MqttType":1,"MAX_PACKET_SIZE":1000,"KEEPALIVE":15}} 10:45:19 MQT: stat/Sonoff_6/STATUS7 = {"StatusTIM":{"UTC":"Sat Jun 08 09:45:19 2019","Local":"Sat Jun 08 10:45:19 2019","StartDST":"Sun Mar 31 02:00:00 2019","EndDST":"Sun Oct 27 03:00:00 2019","Timezone":"+01:00","Sunrise":"04:47","Sunset":"20:50"}} 10:45:19 MQT: stat/Sonoff_6/STATUS10 = {"StatusSNS":{"Time":"2019-06-08T10:45:19","Switch2":"ON"}} 10:45:19 MQT: stat/Sonoff_6/STATUS11 = {"StatusSTS":{"Time":"2019-06-08T10:45:19","Uptime":"0T00:13:09","Vcc":3.462,"LoopSet":50,"LoadAvg":19,"POWER":"OFF","Wifi":{"AP":1,"SSId":"ASUSHughes","BSSId":"AC:22:0B:33:9E:68","Channel":4,"RSSI":94}}} 10:47:24 MQT: tele/Sonoff_6/STATE = {"Time":"2019-06-08T10:47:24","Uptime":"0T00:15:14","Vcc":3.475,"LoopSet":50,"LoadAvg":19,"POWER":"OFF","Wifi":{"AP":1,"SSId":"ASUSHughes","BSSId":"AC:22:0B:33:9E:68","Channel":4,"RSSI":76}} 10:47:24 MQT: tele/Sonoff_6/SENSOR = {"Time":"2019-06-08T10:47:24","Switch2":"ON"} 10:48:59 MQT: cmnd/Sonoff_6/Garage_Door/POWER2 = OFF (retained) 10:48:59 MQT: stat/Sonoff_6/RESULT = {"Command":"Unknown"} 10:49:03 MQT: cmnd/Sonoff_6/Garage_Door/POWER2 = ON (retained) 10:49:03 MQT: stat/Sonoff_6/RESULT = {"Command":"Unknown"}

Switch Sonoff_6a "Garage Status" <garagedoor> {mqtt="<[broker:stat/stat/Sonoff_6/Garage_Door/POWER2:state:default]"}`

Switch item=Sonoff_6a mappings=[ON="Open", OFF="Closed"]

The reed switch is connected to the rx pin gpio3 or 1 I think and has been cofigured as switch2

Can anybody shed some light on this for me please?

  1. Is the Tasmota sending messages? Confirm using something like MQTT.fx.
  2. Do you have the 1.x or 2.x version of the binding? You are using the 1.x version syntax but if you are running oh 2.4 or later the 2.x version is probably installed.

Thank you for your reply. I found my issue. The device was sending out a MQTT command message not a stat/… update. Which now means the switch on my Tasmota Sonoff is now working correctly and getting its updates. All I need to do now is configure a push button to send a command to openhab and create a rule to use that item update to activate the relay on the Sonoff. The Switchmode of the button and switch have to be the same on Tasmota I believe so the switch which is actually a reed switch didn’t want to control the relay directly. I’m just using is to show the status of a garage door(open/closed) but with that switch mode the push button won’t control the relay either! So need to do what I suggested above it think?

Honestly, I have no idea. It is still not clear to me what you are doing and how you are doing it and it involves a lot of stuff that is outside the scope of OH.

Maybe I don’t understand what you want, but why shouldn’t the push button action activate the relay directly?

I am making a garage door opener with a Sonoff basic on Tasmota firmware. I have isolated the 240v from the relay so it just closes the connection between the cables coming out of the opener. I have a reed switch to show me the status of the door position connected to tx and gnd which works perfectly set as Switch2. I have SwitchMode set to 1 so the switch doesn’t directly control the relay and only sends an MQTT message. I want to connect a emergency push button to the Sonoff waterproof case so I can manually operate the door for whatever reason. I planned on using the rx pin and ground but can’t get the button to work if I configure it as a button so I configured it as a switch instead. So now I need to create a rule within Tasmota to take the command of switch3 changing to ON and send a command to the Sonoff relay to turn on.

Because I have the button connected to the rx pin and With the SwitchTopic being set to 1 for the reed switch that makes all other switches and buttons use that topic and not control the relay. As I put above. For some reason I can’t configure the button as a button properly using the rx pin but that’s the only one I have left! So set it as a switch

Why can’t you use the button that came with the garage door opener? That is how I have mine wired up.

Which is outside the scope of openHAB. You might find more/better help on a Tasmota forum.

Just as a learning project to be honest, I totally understand it’s not a question for the openhab community. So I asked on Tasmota forum and a button running on rx pin can not implement rules for some reason so my next step is creating a rule in openhab instead. So something along the lines of. When Sonoff_6b received update ON send command Sonoff_6 ON. If you wouldn’t mind pointing me in the right direction :grinning:

I would advise against that; it’s not much of an emergency button if it relies on WiFi and openHAB being fully operational in order to work.
I’d persist with trying to get a true local control - does the built-in sonoff button not do what you want? (you can extend wiring to an external push as well)

I do have a factory fitted push button fitted to the opener. This is more of a learning project. I did try to solder 2 wires to the internal switch but managed to unsolder the switch pins in the process and can’t seem to solder them back down!

Maybe the pushbutton plastic body has melted and its pins retreated. Might be worth removing it altogether and soldering flying wires in its place.

I am using two momentary push button connected to GPIO0 for switch1 and GPIO9 for switch2. Pushing (connecting) either one will switch the connected relay, Wifi working or not!
See explantion here