Using Sonoff Power Switches with Tasmota firmware and openHAB2 MQTT2 binding

Tags: #<Tag:0x00007faee5cc0ab0> #<Tag:0x00007faee5cc0538> #<Tag:0x00007faee5cc0060>

Had the same problem. Fixed it by deleting the cache and temp removing and afterwards adding the things file with the broker. probably had some mixed paperui old mqtt v1 stuff

Has there been changes to the MQTT 2.4 binding recently?
The “Sonoff Maintenance” rule earlier in this thread no longer works. I get an error

2019-02-25 17:38:51.504 [INFO ] [.smarthome.model.script.sonoff.rules] - Sonoff Maintenance on all devices:queryFW

2019-02-25 17:38:51.505 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Sonoff Maintenance': Instance is not an MQTTActions class.

It was working fine earlier. Currently on the latest 2.5 snapshot

There are a lot of build related changes and it could just be that the actions part did not compile / not got included / some dependencies are not resolving. It is at the moment not the best idea to use the snapshots and if you do, you need to check your logs intensively.

Cheers, David

Thanks David. So should I just go with the M1 build instead?
Unfortunately I also need the latest Z wave snaphots for my z wave devices

Just download the latest zwave snapshot binding and put it in your addons folder. Uninstall the PaperUI zwave binding first.

Thank you . What is the safest way to move from 2.40/2.50 snapshot to 2.5 M1 , and not have to reconfigure all the Z wave and MQTT items again? Docker installation for OH

Sorry, no idea about Docker :sunglasses:

I am using the 2.5 snapshot atm and got strange behaviour…

when is use that thing file entry :

Bridge mqtt:broker:myAuthentificatedBroker "MyBroker" @ "MyHome" [ host="192.168.178.212", secure=false, username="openhabian", password="xxxx", qos=1] {
Channels:
        Type string : reachable "Reachable"            [ stateTopic="tasmota/tele/sonoff-basic-1-00/LWT" ]
        Type switch : power     "Power"                [ stateTopic="tasmota/stat/sonoff-basic-1-00/POWER", commandTopic="tasmota/cmnd/sonoff-basic-1-00/POWER", on="ON", off="OFF" ]
        Type number : rssi      "WiFi Signal Strength" [ stateTopic="tasmota/tele/sonoff-basic-1-00/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI"]
        Type publishTrigger : myTriggerChannel "Receive everything" [ stateTopic="tasmota/#", separator="#" ]
}

without the Thing line, i get channels shown in Visual studio in the Thing list.

if i go like this, which should be correct according to the documentation from what i can see, it doesnt show any channels :

Bridge mqtt:broker:myAuthentificatedBroker "MyBroker" @ "MyHome" [ host="192.168.178.212", secure=false, username="openhabian", password="xxxxxx", qos=1] {
Thing mqtt:topic:SonoffBasic01 "Sonoff Power Switch 01" @ "MQTT"  {
Channels:
        Type string : reachable "Reachable"            [ stateTopic="tasmota/tele/sonoff-basic-1-00/LWT" ]
        Type switch : power     "Power"                [ stateTopic="tasmota/stat/sonoff-basic-1-00/POWER", commandTopic="tasmota/cmnd/sonoff-basic-1-00/POWER", on="ON", off="OFF" ]
        Type number : rssi      "WiFi Signal Strength" [ stateTopic="tasmota/tele/sonoff-basic-1-00/STATE", transformationPattern="JSONPATH:$.Wifi.RSSI"]
        Type publishTrigger : myTriggerChannel "Receive everything" [ stateTopic="tasmota/#", separator="#" ]
}
}

now the channels need to be correct, since a thing config like this :

Type publishTrigger : myTriggerChannel "Receive everything" [ stateTopic="tasmota/tele/sonoff-basic-1-00/POWER", separator="#" ]

results in that loggin

2019-03-30 15:37:37.621 [vent.ChannelTriggeredEvent] - mqtt:broker:myAuthentificatedBroker:reachable triggered Online

2019-03-30 15:37:43.861 [vent.ChannelTriggeredEvent] - mqtt:broker:myAuthentificatedBroker:power triggered ON

2019-03-30 15:37:56.665 [vent.ChannelTriggeredEvent] - mqtt:broker:myAuthentificatedBroker:power triggered OFF

2019-03-30 15:37:59.593 [vent.ChannelTriggeredEvent] - mqtt:broker:myAuthentificatedBroker:rssi triggered {"Time":"2019-03-30T15:38:00","Uptime":"0T00:05:20","Vcc":3.170,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":20,"POWER":"OFF","Wifi":{"AP":1,"SSId":"Elias W-LAN","BSSId":"A0:04:60:86:32:62","Channel":6,"RSSI":32,"LinkCount":1,"Downtime":"0T00:00:06"}}

the item file is like follows, but either way, does not really work

String Reachable "Reachable" {channel="mqtt:broker:myAuthentificatedBroker:reachable"}
Number Rssi "WiFi Signal Strength" {channel="mqtt:broker:myAuthentificatedBroker:rssi"}
Switch 		OnOff_Bath_Mirror_OG	"An/Aus (Bad Spiegel) OG"		<light_led>		/*(G_Lights_Bath,G_OnOff)*/		{channel="mqtt:broker:myAuthentificatedBroker:power"}

i have no clue what the problem is… does anyone see the mistake or know the reason why i cant have the thing line in the thing config file ?
Also i am not sure why the JASONPATH transformation is not working … i have the transformation jsonpath installed…

@schelli Marc, maybe I am not the best person to answer your question I’ve got it working with all the examples I found on this forum. for starters I use MQTT bridge in a separate thing file. This file contains no “{”; so think you can remove that in your bridge line. Not sure but the differences in your StateTopic might be problem.
Please note my solution works but might be not the most perfect solotion.

PS Still not found the SonOff icons, anyone?

Bridge:

Bridge mqtt:broker:MyMosquitto "MQTT Broker Mosquitto" @ "MQTT" 
[ 
.....
]

Thing:

//=================================================================================================================================================
Thing mqtt:topic:Sonoff1 "Sonoff 1" (mqtt:broker:MyMosquitto) @ "MQTT"  {
  Channels:
    Type switch : power          [ stateTopic="stat/Sonoff1/POWER",  commandTopic="cmnd/Sonoff1/Power"]
    Type string : fw             [ stateTopic="tele/Sonoff1/INFO1",  transformationPattern="JSONPATH:$.Version"]
    Type string : hostname       [ stateTopic="tele/Sonoff1/INFO2",  transformationPattern="JSONPATH:$.Hostname"]
    Type string : ip             [ stateTopic="tele/Sonoff1/INFO2",  transformationPattern="JSONPATH:$.IPAddress"]
    Type string : wifi-rssi      [ stateTopic="tele/Sonoff1/STATE",  transformationPattern="JSONPATH:$.Wifi.RSSI" ]
    Type switch : devicestate    [ stateTopic="tele/Sonoff1/LWT",    transformationPattern="MAP:reachable.map" ]
} // end of thing
//=================================================================================================================================================

Item:

//=================================================================================================================================================
Switch Sonoff1_Switch          "Voordeur"            <selflight>    (Sonoffs) { channel="mqtt:topic:Sonoff1:power" }
String Sonoff1_hostname        "Sonoff1 hostname"                   (Sonoffs) { channel="mqtt:topic:Sonoff1:hostname" }
String Sonoff1_IP              "Sonoff1 IP"          <ip>           (Sonoffs) { channel="mqtt:topic:Sonoff1:ip" }
String Sonoff1_FW              "Sonoff1 FW"          <selfinfo>     (Sonoffs) { channel="mqtt:topic:Sonoff1:fw" }
String Sonoff1_WifiRssi        "Sonoff1 Wifi RSSI"   <network>      (Sonoffs) { channel="mqtt:topic:Sonoff1:wifi-rssi" }
Switch Sonoff1_DeviceState     "Sonoff1 Device State" <selfshield> (gReachable,Sonoffs) { channel="mqtt:topic:Sonoff1:devicestate" }
//=================================================================================================================================================

IMHO it is possible to add channels to the broker-thing ( which is a bridge), but those channels are of no use!
Did you copy the channel definition from your PaperUI? The channel definition show on PaperUI can be used in both cases, either if things are defined on PaperUI as well as in files.

Hmm, the problem was as so many times between my own ears :roll_eyes:

I was looking in the thing list under the MQTT Broker name for channels to appear. but ofc i had to look under the name of my MQTT topic thing in the thing list … incredibly stupid, but well, cost me 2 or 3 hours fiddling around, just a simple thinking mistake … thx for your help though.

@opus actually your note about being able to create those channels without effect, made me think about where the channels should be / appear…

I’m having the same here. Thanks for your post, that brought me on the right track.

So, whenever I save the thing-file that contains the bridge, all related MQTT things immediately stop working.

Only solutions I have found:

  • Renaming the Bridge
  • Restarting OpenHAB

The trick with defining the bridge in a separate file - and of course never touching that again - therefore is the only way to add new MQTT things without breaking everything.

I’m running 2.5.0.M1

OH 2.4 introduced the new MQTT extension, and the issue really is that I don’t use textual configuration files, I guess. But since OH 2.4 and also OH 2.5M1 a lot of fixes have accumulated that should make the MQTT binding also useful for textual configuration users.

Cheers, David

Been struggling to get this working, I’ve used Openhab since 1.6 and the MQTT2 plugin has been the hardest nut to crack thus far… Ended up moving from 2.4 Stable to 2.5 M1 to address the bridge offline bugs.

I split my config into a mqtt.things and mqtt-bridge.things file as others have done to address stability issues, i see this requires a syntax change in the Thing stanzas - can we confirm?

single file:

Thing mqtt:topic:Sonoff1 "Sonoff 1"  {

split config:

Thing mqtt:topic:Sonoff1 "Sonoff 1" (mqtt:broker:MyMosquitto) @ "MQTT"  {

it appears with the split config you need to specify the broker name? I got errors until I followed this convention.

what is the @ "MQTT" part at the end of the Thing definition? I’ve not seen it in the docs / plugin wiki.

@David_Graeff I mean no disrespect and am thankful for all your hard work! Many OH2 users stick with the text files as it’s a crapshoot whether PaperUI will have the functionality / features needed / portability of config. Could we update the wiki page with more details / syntax guide for text config? This plugin uses a different file format than any I’ve worked with in the OH1/2 ecosystems and it’s a shame to have to dig thru months old forum posts to piece together basic configuration.

There are many options in Smart Home platforms but what makes OH2 shine is the flexibility and depth of control offered by text configuration. I’m looking forward to moving off the MQTT1 plugin and onto this as soon as the details are fleshed out.

The @ “MQTT” will put the linked items on the control tab of PaperUI into the section MQTT. Nothing more nothing less.
The different syntax in the .things is caused by the need to assign a bridge (the broker thing) to each mqtt thing. In case of the single file that is done by declaring each mqtt thing within the "{ } " after the broker thing definition.
David has already made an update for documentation concerning the thing-file syntax, but that hasn’t been merged. (Can’t find it ATM)

There is a 3 pages long examples file in the repository. That was once part of the main mqtt documentation, but I took the right as the maintainer to split that part off as the documentation grew.

I have notified the website guys to please include additional example files (in a second tab, via a sidebar link or however), but since then nothing has changed :confused:

I have to say though: If the textual files are soo complicated and non intuitive (the bridge / thing split syntax is not an mqtt invention btw), they might need to change :wink:

Cheers, David

@opus where is the info on the @ flag or other modifiers? I’d like to read up - haven’t seen mention of it anywhere.

@David_Graeff you’ll hear no argument from me about the non-intuitiveness of OH textual configuration, it’s downright nasty! Unfortunately every platform has this problem - the nature of automation is gluing things together that were never meant to talk, so with that comes complexity… Even professional platforms have terrible script languages (Crestron) its a necessary evil to build an elegant solution.

Thank you for following up with the website team to get additional examples posted, There is a larger issue of disorganization in the OH2 documentation making it hard to track down syntax.

1 Like

The @ flag is documented Here, look for location.

2 Likes

Hi,

my sonoff S20 switches dont work. I add all, the broker mosquitto is running, the devices connected.
The state updates are not in the event log of openhab. In the openhab.log every time i have trouble logs of double entries with “state”. Its the first time i use sonoff in openhab (Fresh install test system for mqtt2)

I dont know why it now work.

here is my config:
mqtt.things

Bridge mqtt:broker:MosquittoMqttBroker “Mosquitto MQTT Broker” @ “MQTT” [
host=“IP Adress”,
secure=false,
port=1883,
qos=0,
retain=false,
clientid=“Oh2Mqtt2Thing”,
//certificate="",
//certificatepin=false,
//publickey="",
//publickeypin=false,
keep_alive_time=30000,
reconnect_time=60000,
//lastwill_message="",
//lastwill_qos=1,
//lastwill_topic="",
username="",
password=""
]
{
// Buero

// Sonoff Corin-I Strom
Thing mqtt:topic:CorinI “Sonoff Corin-I Strom” @ “Büro” {
Channels:
Type switch : switch “Power Switch” [
stateTopic=“buero/CorinI/POWER”,
commandTopic=“buero/CorinI/cmnd/POWER”,
//retained=false,
//postCommand="",
//transformationPattern=“JSONPATH:$.POWER”,
//formatBeforePublish="%s",
on=“ON”,
off=“OFF”
]
Type string : state01 “Switch State 01” [
stateTopic=“buero/CorinI/STATE”,
transformationPattern=“JSONPATH:$.POWER”,
on=“ON”,
off=“OFF”
]
Type string : state02 “Switch State 02” [
stateTopic=“stat/CorinI/POWER”,
on=“ON”,
off=“OFF”
]
Type string : state03 “Switch State 03” [
stateTopic=“stat/CorinI/RESULT”,
transformationPattern=“JSONPATH:$.POWER”,
on=“ON”,
off=“OFF”
]
Type number : vcc “VCC” [
stateTopic=“buero/CorinI/STATE”,
transformationPattern=“JSONPATH:$.Vcc”
]
Type string : wifi-ap “Wifi AP” [
stateTopic=“buero/CorinI/STATE”,
transformationPattern=“JSONPATH:$.Wifi.AP”
]
Type string : wifi-ssid “Wifi SSID” [
stateTopic=“buero/CorinI/STATE”,
transformationPattern=“JSONPATH:$.Wifi.SSId”
]
Type string : wifi-channel “Wifi Channel” [
stateTopic=“buero/CorinI/STATE”,
transformationPattern=“JSONPATH:$.Wifi.Channel”
]
Type string : wifi-rssi “Wifi RSSI” [
stateTopic=“buero/CorinI/STATE”,
transformationPattern=“JSONPATH:$.Wifi.RSSI”
]
Type string : uptime “Uptime” [
stateTopic=“buero/CorinI/STATE”,
transformationPattern=“JSONPATH:$.Uptime”
]
Type string : time “Time” [
stateTopic=“buero/CorinI/STATE”,
transformationPattern=“JSONPATH:$.Time”
]
Type string : devicestate “Device State” [
stateTopic=“buero/CorinI/LWT”
]
}

// Sonoff Valeshi-I Strom
Thing mqtt:topic:ValeshiI “Sonoff Valeshi-I Strom” @ “Büro” {
Channels:
Type switch : switch “Power Switch” [
stateTopic=“buero/ValeshiI/POWER”,
commandTopic=“buero/ValeshiI/cmnd/POWER”,
//retained=false,
//postCommand="",
//transformationPattern=“JSONPATH:$.POWER”,
//formatBeforePublish="%s",
on=“ON”,
off=“OFF”
]
Type string : state01 “Switch State 01” [
stateTopic=“buero/ValeshiI/STATE”,
transformationPattern=“JSONPATH:$.POWER”,
on=“ON”,
off=“OFF”
]
Type string : state02 “Switch State 02” [
stateTopic=“stat/ValeshiI/POWER”,
on=“ON”,
off=“OFF”
]
Type string : state03 “Switch State 03” [
stateTopic=“stat/ValeshiI/RESULT”,
transformationPattern=“JSONPATH:$.POWER”,
on=“ON”,
off=“OFF”
]
Type number : vcc “VCC” [
stateTopic=“buero/ValeshiI/STATE”,
transformationPattern=“JSONPATH:$.Vcc”
]
Type string : wifi-ap “Wifi AP” [
stateTopic=“buero/ValeshiI/STATE”,
transformationPattern=“JSONPATH:$.Wifi.AP”
]
Type string : wifi-ssid “Wifi SSID” [
stateTopic=“buero/ValeshiI/STATE”,
transformationPattern=“JSONPATH:$.Wifi.SSId”
]
Type string : wifi-channel “Wifi Channel” [
stateTopic=“buero/ValeshiI/STATE”,
transformationPattern=“JSONPATH:$.Wifi.Channel”
]
Type string : wifi-rssi “Wifi RSSI” [
stateTopic=“buero/ValeshiI/STATE”,
transformationPattern=“JSONPATH:$.Wifi.RSSI”
]
Type string : uptime “Uptime” [
stateTopic=“buero/ValeshiI/STATE”,
transformationPattern=“JSONPATH:$.Uptime”
]
Type string : time “Time” [
stateTopic=“buero/ValeshiI/STATE”,
transformationPattern=“JSONPATH:$.Time”
]
Type string : devicestate “Device State” [
stateTopic=“buero/ValeshiI/LWT”
]
}

// Wohnzimmer

// Sonoff Media Center Strom
Thing mqtt:topic:MediaCenter “Sonoff Media Center” @ “Wohnzimmer” {
Channels:
Type switch : switch “Power Switch” [
stateTopic=“wohnzimmer/MediaCenter/POWER”,
commandTopic=“wohnzimmer/MediaCenter/cmnd/POWER”,
//retained=false,
//postCommand="",
//transformationPattern=“JSONPATH:$.POWER”,
//formatBeforePublish="%s",
on=“ON”,
off=“OFF”
]
Type string : state01 “Switch State 01” [
stateTopic=“wohnzimmer/MediaCenter/STATE”,
transformationPattern=“JSONPATH:$.POWER”,
on=“ON”,
off=“OFF”
]
Type string : state02 “Switch State 02” [
stateTopic=“stat/MediaCenter/POWER”,
on=“ON”,
off=“OFF”
]
Type string : state03 “Switch State 03” [
stateTopic=“stat/MediaCenter/RESULT”,
transformationPattern=“JSONPATH:$.POWER”,
on=“ON”,
off=“OFF”
]
Type number : vcc “VCC” [
stateTopic=“wohnzimmer/MediaCenter/STATE”,
transformationPattern=“JSONPATH:$.Vcc”
]
Type string : wifi-ap “Wifi AP” [
stateTopic=“wohnzimmer/MediaCenter/STATE”,
transformationPattern=“JSONPATH:$.Wifi.AP”
]
Type string : wifi-ssid “Wifi SSID” [
stateTopic=“wohnzimmer/MediaCenter/STATE”,
transformationPattern=“JSONPATH:$.Wifi.SSId”
]
Type string : wifi-channel “Wifi Channel” [
stateTopic=“wohnzimmer/MediaCenter/STATE”,
transformationPattern=“JSONPATH:$.Wifi.Channel”
]
Type string : wifi-rssi “Wifi RSSI” [
stateTopic=“wohnzimmer/MediaCenter/STATE”,
transformationPattern=“JSONPATH:$.Wifi.RSSI”
]
Type string : uptime “Uptime” [
stateTopic=“wohnzimmer/MediaCenter/STATE”,
transformationPattern=“JSONPATH:$.Uptime”
]
Type string : time “Time” [
stateTopic=“wohnzimmer/MediaCenter/STATE”,
transformationPattern=“JSONPATH:$.Time”
]
Type string : devicestate “Device State” [
stateTopic=“wohnzimmer/MediaCenter/LWT”
]
}

}

sonoff.items

// Steckdose Corin-I Strom
Switch CorinI_Switch “Corin-I Switch” (SonoffPowerSwitches_Basic,ChristmasLivingrooms) { channel=“mqtt:topic:CorinI:switch” }
String CorinI_State “Corin-I State” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:CorinI:state01”, channel=“mqtt:topic:CorinI:state02”, channel=“mqtt:topic:CorinI:state03”, channel=“mqtt:topic:CorinI:switch” }
Number CorinI_Vcc “Corin-I VCC” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:CorinI:vcc” }
String CorinI_WifiAp “Corin-I Wifi AP” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:CorinI:wifi-ap” }
String CorinI_WifiSsid “Corin-I Wifi SSID” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:CorinI:wifi-ssid” }
String CorinI_WifiChannel “Corin-I Wifi Channel” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:CorinI:wifi-channel” }
String CorinI_WifiRssi “Corin-I Wifi RSSI” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:CorinI:wifi-rssi” }
String CorinI_Uptime “Corin-I Uptime” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:CorinI:uptime” }
String CorinI_Time “Corin-I Time” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:CorinI:time” }
String CorinI_DeviceState “Corin-I Device State” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:CorinI:devicestate” }

// Steckdose Valeshi-I Strom
Switch ValeshiI_Switch “Valeshi-I Switch” (SonoffPowerSwitches_Basic,ChristmasLivingrooms) { channel=“mqtt:topic:ValeshiI:switch” }
String ValeshiI_State “Valeshi-I State” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:ValeshiI:state01”, channel=“mqtt:topic:ValeshiI:state02”, channel=“mqtt:topic:ValeshiI:state03”, channel=“mqtt:topic:ValeshiI:switch” }
Number ValeshiI_Vcc “Valeshi-I VCC” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:ValeshiI:vcc” }
String ValeshiI_WifiAp “Valeshi-I Wifi AP” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:ValeshiI:wifi-ap” }
String ValeshiI_WifiSsid “Valeshi-I Wifi SSID” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:ValeshiI:wifi-ssid” }
String ValeshiI_WifiChannel “Valeshi-I Wifi Channel” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:ValeshiI:wifi-channel” }
String ValeshiI_WifiRssi “Valeshi-I Wifi RSSI” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:ValeshiI:wifi-rssi” }
String ValeshiI_Uptime “Valeshi-I Uptime” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:ValeshiI:uptime” }
String ValeshiI_Time “Valeshi-I Time” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:ValeshiI:time” }
String ValeshiI_DeviceState “Valeshi-I Device State” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:ValeshiI:devicestate” }

// Steckdose Media Center Strom
Switch MediaCenter_Switch “Media Center Switch” (SonoffPowerSwitches_Basic,ChristmasLivingrooms) { channel=“mqtt:topic:MediaCenter:switch” }
String MediaCenter_State “Media Center State” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:MediaCenter:state01”, channel=“mqtt:topic:MediaCenter:state02”, channel=“mqtt:topic:MediaCenter:state03”, channel=“mqtt:topic:MediaCenter:switch” }
Number MediaCenter_Vcc “Media Center VCC” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:MediaCenter:vcc” }
String MediaCenter_WifiAp “Media Center Wifi AP” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:MediaCenter:wifi-ap” }
String MediaCenter_WifiSsid “Media Center Wifi SSID” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:MediaCenter:wifi-ssid” }
String MediaCenter_WifiChannel “Media Center Wifi Channel” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:MediaCenter:wifi-channel” }
String MediaCenter_WifiRssi “Media Center Wifi RSSI” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:MediaCenter:wifi-rssi” }
String MediaCenter_Uptime “Media Center Uptime” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:MediaCenter:uptime” }
String MediaCenter_Time “Media Center Time” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:MediaCenter:time” }
String MediaCenter_DeviceState “Media Center Device State” (SonoffPowerSwitches_Basic) { channel=“mqtt:topic:MediaCenter:devicestate” }

Paper UI

sonoff console

22:00:33 MQT: Verbindungsversuch…
22:00:33 MQT: verbunden
22:00:33 MQT: buero/sonoff-CorinI/LWT = Online (beibehalten)
22:00:33 MQT: buero/sonoff-CorinI/cmnd/POWER =
22:01:23 MQT: buero/sonoff-CorinI/STATE = {“Time”:“2019-07-13T22:01:23”,“Uptime”:“0T11:06:21”,“Heap”:15,“SleepMode”:“Dynamic”,“Sleep”:50,“LoadAvg”:19,“POWER”:“ON”,“Wifi”:{“AP”:1,“SSId”:“C-Lab Network”,“BSSId”:“9C:3D:CF:49:96:8F”,“Channel”:1,“RSSI”:48,“LinkCount”:1,“Downtime”:“0T00:00:06”}}
22:02:24 MQT: buero/sonoff-CorinI/STATE = {“Time”:“2019-07-13T22:02:24”,“Uptime”:“0T11:07:22”,“Heap”:15,“SleepMode”:“Dynamic”,“Sleep”:50,“LoadAvg”:19,“POWER”:“ON”,“Wifi”:{“AP”:1,“SSId”:“C-Lab Network”,“BSSId”:“9C:3D:CF:49:96:8F”,“Channel”:1,“RSSI”:42,“LinkCount”:1,“Downtime”:“0T00:00:06”}}
22:03:24 MQT: buero/sonoff-CorinI/STATE = {“Time”:“2019-07-13T22:03:24”,“Uptime”:“0T11:08:22”,“Heap”:15,“SleepMode”:“Dynamic”,“Sleep”:50,“LoadAvg”:19,“POWER”:“ON”,“Wifi”:{“AP”:1,“SSId”:“C-Lab Network”,“BSSId”:“9C:3D:CF:49:96:8F”,“Channel”:1,“RSSI”:46,“LinkCount”:1,“Downtime”:“0T00:00:06”}}
22:04:24 MQT: buero/sonoff-CorinI/STATE = {“Time”:“2019-07-13T22:04:24”,“Uptime”:“0T11:09:22”,“Heap”:15,“SleepMode”:“Dynamic”,“Sleep”:50,“LoadAvg”:19,“POWER”:“ON”,“Wifi”:{“AP”:1,“SSId”:“C-Lab Network”,“BSSId”:“9C:3D:CF:49:96:8F”,“Channel”:1,“RSSI”:44,“LinkCount”:1,“Downtime”:“0T00:00:06”}}
22:05:24 MQT: buero/sonoff-CorinI/STATE = {“Time”:“2019-07-13T22:05:24”,“Uptime”:“0T11:10:22”,“Heap”:15,“SleepMode”:“Dynamic”,“Sleep”:50,“LoadAvg”:19,“POWER”:“ON”,“Wifi”:{“AP”:1,“SSId”:“C-Lab Network”,“BSSId”:“9C:3D:CF:49:96:8F”,“Channel”:1,“RSSI”:46,“LinkCount”:1,“Downtime”:“0T00:00:06”}}
22:06:24 MQT: buero/sonoff-CorinI/STATE = {“Time”:“2019-07-13T22:06:24”,“Uptime”:“0T11:11:22”,“Heap”:15,“SleepMode”:“Dynamic”,“Sleep”:50,“LoadAvg”:19,“POWER”:“ON”,“Wifi”:{“AP”:1,“SSId”:“C-Lab Network”,“BSSId”:“9C:3D:CF:49:96:8F”,“Channel”:1,“RSSI”:44,“LinkCount”:1,“Downtime”:“0T00:00:06”}}

Logs:
openhab2.log

2019-07-13 23:02:44.345 [INFO ] [el.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model ‘mqtt.things’, using it anyway:

Provide a thing type ID and a thing ID in this format:

Provide a thing type ID and a thing ID in this format:

Provide a thing type ID and a thing ID in this format:

2019-07-13 22:51:35.741 [WARN ] [ore.common.registry.AbstractRegistry] - Cannot add “Metadata” with key “channel:CorinI_State”. It exists already from provider “GenericMetadataProvider”! Failed to add a second with the same UI

D from provider “GenericMetadataProvider”!

2019-07-13 22:51:35.741 [WARN ] [ore.common.registry.AbstractRegistry] - Cannot add “Metadata” with key “channel:CorinI_State”. It exists already from provider “GenericMetadataProvider”! Failed to add a second with the same UI

D from provider “GenericMetadataProvider”!

2019-07-13 22:51:35.759 [WARN ] [ore.common.registry.AbstractRegistry] - Cannot add “Metadata” with key “channel:CorinI_State”. It exists already from provider “GenericMetadataProvider”! Failed to add a second with the same UI

D from provider “GenericMetadataProvider”!

2019-07-13 22:51:35.760 [WARN ] [ore.common.registry.AbstractRegistry] - Cannot add “Metadata” with key “channel:ValeshiI_State”. It exists already from provider “GenericMetadataProvider”! Failed to add a second with the same

UID from provider “GenericMetadataProvider”!

2019-07-13 22:51:35.760 [WARN ] [ore.common.registry.AbstractRegistry] - Cannot add “Metadata” with key “channel:ValeshiI_State”. It exists already from provider “GenericMetadataProvider”! Failed to add a second with the same

UID from provider “GenericMetadataProvider”!

2019-07-13 22:51:35.761 [WARN ] [ore.common.registry.AbstractRegistry] - Cannot add “Metadata” with key “channel:ValeshiI_State”. It exists already from provider “GenericMetadataProvider”! Failed to add a second with the same

UID from provider “GenericMetadataProvider”!

2019-07-13 22:51:35.764 [WARN ] [ore.common.registry.AbstractRegistry] - Cannot add “Metadata” with key “channel:MediaCenter_State”. It exists already from provider “GenericMetadataProvider”! Failed to add a second with the sa

me UID from provider “GenericMetadataProvider”!

2019-07-13 22:51:35.765 [WARN ] [ore.common.registry.AbstractRegistry] - Cannot add “Metadata” with key “channel:MediaCenter_State”. It exists already from provider “GenericMetadataProvider”! Failed to add a second with the sa

me UID from provider “GenericMetadataProvider”!

2019-07-13 22:51:35.765 [WARN ] [ore.common.registry.AbstractRegistry] - Cannot add “Metadata” with key “channel:MediaCenter_State”. It exists already from provider “GenericMetadataProvider”! Failed to add a second with the sa

me UID from provider “GenericMetadataProvider”!

i hope you may help me.

I would recommend to cut your problem into little pieces.

  1. Can you switch on/off the SonOff divices using their web-pages (so OH independent)?
  2. Can you monitor your MQTT traffic (with i.e. MQTTlens)?
  3. Can you improve readability? (see my example)
  4. Start with one new device at the time
  5. Do not ignore errors (too much)
  6. Check your “Paper UI: configuration -> things” for duplicates?

Seems your problem is in your thing file (for starters). I prefer i.e. to split brigde and things file and for a Sonoff basic (with Tasmota) the thing file is reduced to a simple:

Thing mqtt:topic:Sonoff2 "Sonoff 2" (mqtt:broker:MyMosquitto) @ "MQTT"  {
  Channels:
    Type switch : power          [ stateTopic="stat/Sonoff2/POWER",  commandTopic="cmnd/Sonoff2/Power"]
    Type string : fw             [ stateTopic="tele/Sonoff2/INFO1",  transformationPattern="JSONPATH:$.Version"]
    Type string : hostname       [ stateTopic="tele/Sonoff2/INFO2",  transformationPattern="JSONPATH:$.Hostname"]
    Type string : ip             [ stateTopic="tele/Sonoff2/INFO2",  transformationPattern="JSONPATH:$.IPAddress"]
    Type string : wifi-rssi      [ stateTopic="tele/Sonoff2/STATE",  transformationPattern="JSONPATH:$.Wifi.RSSI" ]
    Type switch : devicestate    [ stateTopic="tele/Sonoff2/LWT",    transformationPattern="MAP:reachable.map" ]
} // end of thing

My suggestion would be to start over slowly. Succes.