Here it is:
MQTT.items
Group gSonoffPowerSwitches_Basic
String Sonoff_Action "Sonoff Action"
Switch sonoff_s20_1_Switch "Schranklicht Essen West" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-s20-1:switch", channel="mqtt:topic:MosquittoBroker:sonoff-s20-1:state01", channel="mqtt:topic:MosquittoBroker:sonoff-s20-1:state02", channel="mqtt:topic:MosquittoBroker:sonoff-s20-1:state03", expire="8h,command=OFF" }
//Switch sonoff-s20-1Switch_Switch "SPS01 Switch" (gSonoffPowerSwitches_Basic,ChristmasLivingrooms) { channel="mqtt:topic:MosquittoBroker:sonoff-s20-1:switch" }
//Switch sonoff_s20_1_State "sonoff s20-1 State" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-s20-1:state01", channel="mqtt:topic:MosquittoBroker:sonoff-s20-1:state02", channel="mqtt:topic:MosquittoBroker:sonoff-s20-1:state03", channel="mqtt:topic:MosquittoBroker:sonoff-s20-1:switch" }
//Number sonoff_s20_1_Vcc "sonoff s20-1 VCC" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-s20-1:vcc" }
//String sonoff_s20_1_WifiAp "sonoff s20-1 Wifi AP" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-s20-1:wifi-ap" }
//String Ssonoff_s20_1_WifiSsid "sonoff s20-1 Wifi SSID" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-s20-1:wifi-ssid" }
//String sonoff_s20_1_WifiChannel "sonoff s20-1 Wifi Ch" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-s20-1:wifi-channel" }
Number sonoff_s20_1_WifiRssi "sonoff s20-1 Wifi RSSI" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-s20-1:wifi-rssi", channel="mqtt:topic:MosquittoBroker:sonoff-s20-1:wifi-rssi2" }
// Number sonoff_s20_1_WifiRssi2 "sonoff s20-1 Wifi RSSI 2" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-s20-1:wifi-rssi2" }
String sonoff_s20_1_Uptime "sonoff s20-1 Uptime" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-s20-1:uptime" }
DateTime sonoff_s20_1_Time "sonoff s20-1 Time [%1$tA, %1$td.%1$tm.%1$tY %1$tT]" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-s20-1:time", channel="mqtt:topic:MosquittoBroker:sonoff-s20-1:time2" }
// String sonoff_s20_1_Time2 "sonoff s20-1 Time 2" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-s20-1:time2" }
String sonoff_s20_1_DeviceState "sonoff s20-1 Device State" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-s20-1:devicestate" }
String sonoff_s20_1_Version "sonoff s20-1 Firmware" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-s20-1:version" }
Switch sonoff_s20_2_Switch "Schranklicht Essen Süd" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-s20-2:switch", channel="mqtt:topic:MosquittoBroker:sonoff-s20-2:state01", channel="mqtt:topic:MosquittoBroker:sonoff-s20-2:state02", channel="mqtt:topic:MosquittoBroker:sonoff-s20-2:state03", expire="8h,command=OFF" }
Number sonoff_s20_2_WifiRssi "sonoff s20-2 Wifi RSSI" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-s20-2:wifi-rssi" }
String sonoff_s20_2_Version "sonoff s20-2 Firmware" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-s20-2:version" }
Switch sonoff_pow2_1_Switch "sonoff pow2-1" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-pow2-1:switch", channel="mqtt:topic:MosquittoBroker:sonoff-pow2-1:power2", expire="2h,command=ON" }
Number sonoff_pow2_1_WifiRssi "sonoff pow2-1 Wifi RSSI" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-pow2-1:wifi-rssi" }
String sonoff_pow2_1_Version "sonoff pow2-1 Firmware" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-pow2-1:version" }
String sonoff_pow2_1_Reachable "Reachable: [%s]" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-pow2-1:reachable" }
Number sonoff_pow2_1_Power "pow2-1 Power load [%.1f W]" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-pow2-1:powerload", channel="mqtt:topic:MosquittoBroker:sonoff-pow2-1:powerload2" }
Number sonoff_pow2_1_Power_charts "Kühlschrank Küche kW [%.3f kW]" (gSonoffPowerSwitches_Basic, gStrom_Verbrauch_Chart)
Number sonoff_pow2_1_Voltage "Line voltage [%.1f V]" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-pow2-1:voltage", channel="mqtt:topic:MosquittoBroker:sonoff-pow2-1:voltage2" }
Number sonoff_pow2_1_Current "Line current [%.3f A]" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-pow2-1:current", channel="mqtt:topic:MosquittoBroker:sonoff-pow2-1:current2" }
Number sonoff_pow2_1_Today "Total today [%.3f kWh]" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-pow2-1:totaltoday", channel="mqtt:topic:MosquittoBroker:sonoff-pow2-1:totaltoday2" }
Number sonoff_pow2_1_Yesterday "Total yesterday [%.3f kWh]" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-pow2-1:totalyest" }
Number sonoff_pow2_1_Total "Total [%.3f kWh]" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-pow2-1:total" }
DateTime sonoff_pow2_1_TotalStart "Total Start [%1$tA, %1$td.%1$tm.%1$tY %1$tT]" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-pow2-1:totalstarttime" }
Switch sonoff_pow_1_Switch "sonoff pow-1" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-pow-1:switch", channel="mqtt:topic:MosquittoBroker:sonoff-pow-1:power2", expire="2h,command=ON" }
Number sonoff_pow_1_WifiRssi "sonoff pow-1 Wifi RSSI" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-pow-1:wifi-rssi" }
String sonoff_pow_1_Version "sonoff pow-1 Firmware" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-pow-1:version" }
String sonoff_pow_1_Reachable "Reachable: [%s]" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-pow-1:reachable" }
Number sonoff_pow_1_Power "pow-1 Power load [%.1f W]" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-pow-1:powerload", channel="mqtt:topic:MosquittoBroker:sonoff-pow-1:powerload2" }
Number sonoff_pow_1_Power_charts "Gefrierschrank Speis kW [%.3f kW]" (gSonoffPowerSwitches_Basic, gStrom_Verbrauch_Chart)
Number sonoff_pow_1_Voltage "Line voltage [%.1f V]" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-pow-1:voltage", channel="mqtt:topic:MosquittoBroker:sonoff-pow-1:voltage2" }
Number sonoff_pow_1_Current "Line current [%.3f A]" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-pow-1:current", channel="mqtt:topic:MosquittoBroker:sonoff-pow-1:current2" }
Number sonoff_pow_1_Today "Total today [%.3f kWh]" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-pow-1:totaltoday", channel="mqtt:topic:MosquittoBroker:sonoff-pow-1:totaltoday2" }
Number sonoff_pow_1_Yesterday "Total yesterday [%.3f kWh]" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-pow-1:totalyest" }
Number sonoff_pow_1_Total "Total [%.3f kWh]" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-pow-1:total" }
DateTime sonoff_pow_1_TotalStart "Total Start [%1$tA, %1$td.%1$tm.%1$tY %1$tT]" (gSonoffPowerSwitches_Basic) { channel="mqtt:topic:MosquittoBroker:sonoff-pow-1:totalstarttime" }
String Sonoff_Current_FW_Available "Current Release available from Theo[%s]" (gSonoffPowerSwitches_Basic) { http="<[https://api.github.com/repos/arendst/Sonoff-Tasmota/tags:86400000:JSONPATH($[0].name)]"}
MQTT.things:
Bridge mqtt:broker:MosquittoBroker "Mosquitto" [ host="localhost", port=1883, secure=false, username="mosquitto", password="mqttpassword", clientID="OpenHAB2" ]
//Bridge mqtt:broker:MQTTBroker "MQTTBroker" [ host="localhost", port=1884, clientID="OpenHAB2" ]
{
// Sonoff S20-1 Power Switch
Thing topic sonoff-s20-1 "Sonoff S20-1 Power Switch" @ "MQTT" {
Channels:
Type switch : switch "Power Switch" [
stateTopic="stat/sonoff-s20-1/POWER",
commandTopic="cmnd/sonoff-s20-1/cmnd/POWER",
//retained=false,
//postCommand="",
//transformationPattern="JSONPATH:$.POWER",
//formatBeforePublish="%s",
on="ON",
off="OFF"
]
Type switch : state01 "Switch State 01" [ stateTopic="tele/sonoff-s20-1/STATE", transformationPattern="JSONPATH:$.POWER", on="ON", off="OFF" ]
Type switch : state02 "Switch State 02" [ stateTopic="stat/sonoff-s20-1/POWER", on="ON", off="OFF" ]
Type switch : state03 "Switch State 03" [ stateTopic="stat/sonoff-s20-1/RESULT", transformationPattern="JSONPATH:$.POWER", on="ON", off="OFF" ]
Type number : vcc "VCC" [
stateTopic="tele/sonoff-s20-1/STATE",
transformationPattern="JSONPATH:$.Vcc"
]
Type string : wifi-ap "Wifi AP" [
stateTopic="tele/sonoff-s20-1/STATE",
transformationPattern="JSONPATH:$.Wifi.AP"
]
Type string : wifi-ssid "Wifi SSID" [
stateTopic="tele/sonoff-s20-1/STATE",
transformationPattern="JSONPATH:$.Wifi.SSId"
]
Type string : wifi-channel "Wifi Channel" [
stateTopic="tele/sonoff-s20-1/STATE",
transformationPattern="JSONPATH:$.Wifi.Channel"
]
Type number : wifi-rssi "Wifi RSSI" [
stateTopic="tele/sonoff-s20-1/STATE",
transformationPattern="JSONPATH:$.Wifi.RSSI"
]
Type number : wifi-rssi2 "Wifi RSSI2" [
stateTopic="stat/sonoff-s20-1/STATUS11",
transformationPattern="JSONPATH:$.StatusSTS.Wifi.RSSI"
]
Type string : uptime "Uptime" [
stateTopic="tele/sonoff-s20-1/STATE",
transformationPattern="JSONPATH:$.Uptime"
]
Type datetime : time "Time" [
stateTopic="tele/sonoff-s20-1/STATE",
transformationPattern="JSONPATH:$.Time"
]
Type datetime : time2 "Time2" [
stateTopic="stat/sonoff-s20-1/STATUS11",
transformationPattern="JSONPATH:$.StatusSTS.Time"
]
Type string : devicestate "Device State" [
stateTopic="tele/sonoff-s20-1/LWT"
]
Type string : version "Software Version" [
stateTopic="stat/sonoff-s20-1/STATUS2",
transformationPattern="JSONPATH:$.StatusFWR.Version"
]
}
// Sonoff S20-2 Power Switch
Thing topic sonoff-s20-2 "Sonoff S20-2 Power Switch" @ "MQTT" {
Channels:
Type switch : switch "Power Switch" [
stateTopic="stat/sonoff-s20-2/POWER",
commandTopic="cmnd/sonoff-s20-2/cmnd/POWER",
//retained=false,
//postCommand="",
//transformationPattern="JSONPATH:$.POWER",
//formatBeforePublish="%s",
on="ON",
off="OFF"
]
Type switch : state01 "Switch State 01" [ stateTopic="tele/sonoff-s20-2/STATE", transformationPattern="JSONPATH:$.POWER", on="ON", off="OFF" ]
Type switch : state02 "Switch State 02" [ stateTopic="stat/sonoff-s20-2/POWER", on="ON", off="OFF" ]
Type switch : state03 "Switch State 03" [ stateTopic="stat/sonoff-s20-2/RESULT", transformationPattern="JSONPATH:$.POWER", on="ON", off="OFF" ]
Type number : wifi-rssi "Wifi RSSI" [
stateTopic="tele/sonoff-s20-2/STATE",
transformationPattern="JSONPATH:$.Wifi.RSSI"
]
Type string : version "Software Version" [
stateTopic="stat/sonoff-s20-2/STATUS2",
transformationPattern="JSONPATH:$.StatusFWR.Version"
]
}
// Sonoff POW R2 - 1 Power Switch
Thing topic sonoff-pow2-1 "Sonoff POW2-1 Power Switch" @ "MQTT" {
Channels:
Type switch : switch "Power Switch" [
stateTopic="stat/sonoff-pow2-1/POWER",
commandTopic="cmnd/sonoff-pow2-1/cmnd/POWER",
//retained=false,
//postCommand="",
//transformationPattern="JSONPATH:$.POWER",
//formatBeforePublish="%s",
on="ON",
off="OFF"
]
Type switch : power2 "Power 2" [ stateTopic="tele/sonoff-pow2-1/STATE", transformationPattern="JSONPATH:$.POWER"]
Type number : wifi-rssi "Wifi RSSI" [
stateTopic="tele/sonoff-pow2-1/STATE",
transformationPattern="JSONPATH:$.Wifi.RSSI"
]
Type string : version "Software Version" [
stateTopic="stat/sonoff-pow2-1/STATUS2",
transformationPattern="JSONPATH:$.StatusFWR.Version"
]
Type string : reachable "Reachable" [ stateTopic="tele/sonoff-pow2-1/LWT" ]
Type number : powerload "Power load" [ stateTopic="tele/sonoff-pow2-1/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Power"]
Type number : voltage "Line voltage" [ stateTopic="tele/sonoff-pow2-1/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Voltage"]
Type number : current "Line current" [ stateTopic="tele/sonoff-pow2-1/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Current"]
Type number : totaltoday "Total energy today" [ stateTopic="tele/sonoff-pow2-1/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Today"]
Type number : totalyest "Total energy yesterday" [ stateTopic="tele/sonoff-pow2-1/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Yesterday"]
Type number : total "Total energy" [ stateTopic="tele/sonoff-pow2-1/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Total"]
Type datetime : totalstarttime "Total start" [ stateTopic="tele/sonoff-pow2-1/SENSOR", transformationPattern="JSONPATH:$.ENERGY.TotalStartTime"]
Type number : powerload2 "Power load" [ stateTopic="stat/sonoff-pow2-1/STATUS8", transformationPattern="JSONPATH:$.StatusSNS.ENERGY.Power"]
Type number : voltage2 "Line voltage" [ stateTopic="stat/sonoff-pow2-1/STATUS8", transformationPattern="JSONPATH:$.StatusSNS.ENERGY.Voltage"]
Type number : current2 "Line current" [ stateTopic="stat/sonoff-pow2-1/STATUS8", transformationPattern="JSONPATH:$.StatusSNS.ENERGY.Current"]
Type number : totaltoday2 "Total energy today" [ stateTopic="tele/sonoff-pow2-1/STATUS8", transformationPattern="JSONPATH:$.StatusSNS.ENERGY.Today"]
}
// Sonoff POW - 1 Power Switch
Thing topic sonoff-pow-1 "Sonoff POW-1 Power Switch" @ "MQTT" {
Channels:
Type switch : switch "Power Switch" [
stateTopic="stat/sonoff-pow-1/POWER",
commandTopic="cmnd/sonoff-pow-1/cmnd/POWER",
//retained=false,
//postCommand="",
//transformationPattern="JSONPATH:$.POWER",
//formatBeforePublish="%s",
on="ON",
off="OFF"
]
Type switch : power2 "Power 2" [ stateTopic="tele/sonoff-pow-1/STATE", transformationPattern="JSONPATH:$.POWER"]
Type number : wifi-rssi "Wifi RSSI" [
stateTopic="tele/sonoff-pow-1/STATE",
transformationPattern="JSONPATH:$.Wifi.RSSI"
]
Type string : version "Software Version" [
stateTopic="stat/sonoff-pow-1/STATUS2",
transformationPattern="JSONPATH:$.StatusFWR.Version"
]
Type string : reachable "Reachable" [ stateTopic="tele/sonoff-pow-1/LWT" ]
Type number : powerload "Power load" [ stateTopic="tele/sonoff-pow-1/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Power"]
Type number : voltage "Line voltage" [ stateTopic="tele/sonoff-pow-1/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Voltage"]
Type number : current "Line current" [ stateTopic="tele/sonoff-pow-1/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Current"]
Type number : totaltoday "Total energy today" [ stateTopic="tele/sonoff-pow-1/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Today"]
Type number : totalyest "Total energy yesterday" [ stateTopic="tele/sonoff-pow-1/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Yesterday"]
Type number : total "Total energy" [ stateTopic="tele/sonoff-pow-1/SENSOR", transformationPattern="JSONPATH:$.ENERGY.Total"]
Type datetime : totalstarttime "Total start" [ stateTopic="tele/sonoff-pow-1/SENSOR", transformationPattern="JSONPATH:$.ENERGY.TotalStartTime"]
Type number : powerload2 "Power load" [ stateTopic="stat/sonoff-pow-1/STATUS8", transformationPattern="JSONPATH:$.StatusSNS.ENERGY.Power"]
Type number : voltage2 "Line voltage" [ stateTopic="stat/sonoff-pow-1/STATUS8", transformationPattern="JSONPATH:$.StatusSNS.ENERGY.Voltage"]
Type number : current2 "Line current" [ stateTopic="stat/sonoff-pow-1/STATUS8", transformationPattern="JSONPATH:$.StatusSNS.ENERGY.Current"]
Type number : totaltoday2 "Total energy today" [ stateTopic="tele/sonoff-pow-1/STATUS8", transformationPattern="JSONPATH:$.StatusSNS.ENERGY.Today"]
}
}