Sonoff 1 channel Tasmota firmware reed contatct

Hi all!

I trying to make this with Sonoff 1 Channel inching switch

Everything works fine, but how to implement reed-s status in openhab?

Thanks!

What openHAB version are you running? Do you already have other MQTT devices integrated with openHAB? What messages does your device publish, and on what MQTT topic(s) is it publishing them?

Hi!

Here is my sitemap and items. The door switch working fine, but the state not showing anything when I move the reed contatct…

Here is my Sonoff-s log:
22:20:46 MQT: cmnd/dstate/POWER2 = OFF (retained)
22:20:48 MQT: cmnd/dstate/POWER2 = ON (retained)

sitemap:
Switch item=door mappings=[ON=“Nyit”]
Switch item=doorstate

items:
Switch door “door”
{ mqtt=">[raspberrypi:cmnd/1channelinching1/power:command:*:default],
<[raspberrypi:stat/1channelinching1/POWER:state:default]]" }

Switch doorstate “door state”
{ mqtt="<[raspberrypi:stat/dstate/POWER2:state:default]" }

Your configuration is for the V1 version of the MQTT Binding. This is very old, so depending on your openHAB version it may no longer be supported.

Also, if this really is a v1 config, your log shows the topic

cmnd/dstate/POWER2

but your config

stat/dstate/POWER2

I’aam using openHAB 2.5.7.

Yes, I’m using MQTT Binding 1.x but everything is works fine.

It works, thank you! :slight_smile:

1 Like

Can you help me one more thing?

How can I set the icon open door and close door, depends of state?

I don’t think you can when using a Switch Item, as presumably the door icon reacts to OPEN and CLOSED states, such as those you can get from a Contact Item.

So, either change to use a Contact Item, though you’ll have to transform your ON/OFF to OPEN/CLOSED.

Or, make your own icons.

Thanks, I will read it!