Hello, I new on that forum, started with OH2 few weeks ago.
After struggling for few evening with controlling the 4ch DC sonoff module (in fact produced by Eachen, however I bought it as a Sonoff) flashed with Tasmota I decided to ask your help. I have read many topics on mqtt setup to control sonoff. Generally it finally works for me now with one exclusion I can’t resolve up till now: the switch commanded by mqtt message or by keyboard input on Tasmota console “power1 on” switches on and in a second it switches back itself. This happenes on my two modules configured with mqtt and does not happen on the module which does not communicate on mqtt. Apart from that the modules are configured the same.
I have checked all Tasmota configuration options that seemed to relate to retention or pulse operation, eg. PulseTime (=0), SetOption65 (=1), PowerOnState (=0), SetOption0 (=0), SetOption63 (=1).
I cleared retained data on Mosquito by deleting its db, and checked that thare is no retained data on the module with mqqt-forget app.
mqtt-forget -t sonoff6260_106/#
found 0 retained topics
My OH2 version 2.5.0.M3
My things file:
mqtt:broker:mosquitto "Mosquitto" [ host="127.0.0.1", port=1883, secure=false, username="openhab", password="xxx" , clientID="Pi" ]
Bridge mqtt:broker:mosquitto "Mosquitto" [ host="127.0.0.1", port=1883, secure=false, username="openhab", password="xxx" , clientID="Pi" ]
{
Thing topic sonoff6260_106 "Roleta1" {
Channels:
Type switch : Power1 [ stateTopic="stat/sonoff6260_106/POWER1", commandTopic="cmnd/sonoff6260_106/POWER1" ]
Type switch : Power2 [ stateTopic="stat/sonoff6260_106/POWER2" , commandTopic="cmnd/sonoff6260_106/POWER2" ]
Type number : rssi "WiFi Signal Strength" [ stateTopic="tele/sonoff6260_106/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI"]
}
}
My items file:
Switch LivingRoom_Roleta1Up "Roleta 1 Up" <light> (gRoleta1, gMqttOut, GF_LivingRoom) { channel="mqtt:topic:mosquitto:sonoff6260_106:POWER1" }
Switch LivingRoom_Roleta1Down "Roleta 1 Down" <light> (gRoleta1, gMqttOut, GF_LivingRoom) { channel="mqtt:topic:mosquitto:sonoff6260_106:POWER2" }
Number LivingRoom_Roleta_RSSI "WiFi Signal Strength [%d %%]" <wifi> (gRoleta1, GF_LivingRoom) { channel="mqtt:topic:mosquitto:sonoff6260_106:rssi" }
The Sonoff module is configured as generic (type 18).
Mqtt config page:
The other thing that I’m not sure of is that I need to link the above items to above channels in PaperUI otherwise messages are not send. Config files are not enough. However state works without the GUI link. Strange for me, however I’m new to OH, so perhaps it’s normal.
I will be grateful for any hint or idea where to look for.