Hello. I’m trying to set up my sonoff switch with tasmota firmware.
I’m using Sonoff basic switch with temperature sensor AM2302.
It works well when i’m using any mqtt client.
Now i’m trying to make it work with openhab.
I’ve installed mqtt 2.4 binding.
Things file:
Bridge mqtt:broker:mosquitto [ host="localhost", secure=false ]
{
Thing topic SonoffBathroom "Sonoff Bathroom" {
Channels:
Type switch : fan "Bathroom fan" [ stateTopic="stat/sonoff_bathroom/POWER", commandTopic="cmnd/sonoff_bathroom/POWER", on="ON", off="OFF"]
}
}
My items file:
Switch Bathroom_Fan "Bathroom fan" { channel="mqtt:topic:mosquitto:SonoffBathroom:fan" }
The above config works well,
but if i’m trying to add a new channel which will provide temperature/humidity status povided by the sonoff like this:
Bridge mqtt:broker:mosquitto [ host="localhost", secure=false ]
{
Thing topic SonoffBathroom "Sonoff Bathroom" {
Channels:
Type switch : fan "Bathroom fan" [ stateTopic="stat/sonoff_bathroom/POWER", commandTopic="cmnd/sonoff_bathroom/POWER", on="ON", off="OFF"]
Type string : sensor "Temperature and Humidity" [ stateTopic="tele/sonoff_bathroom/SENSOR" ]
}
}
Switch immediately stop working through OH and it does not show any status update in the log for the switch. No any warning/error message in the log. I can only make it work when I remove temp&humidity channel AND after I restart OH.