I pretty much did a copy/past of the code only changing my login information in the things file. I know that i’m going to have to replace a piece of this code with my Sonoff S31 client ID name which is AP1 for now, just haven’t figured out where that goes yet.
The following is my Sonoff.Items file:
Group GF_Sonoff_S20 "Sonoff S20" <sonoff_s20_uk> (Sonoff_S20)
String GF_Sonoff_S20_Reachable "Reachable: [%s]" <contactable> (GF_Sonoff_S20) { channel="mqtt:topic:mosquitto:sonoffs20:reachable" }
Switch GF_Sonoff_S20_Power "Power" <sonoff_s20_uk> (GF_Sonoff_S20) { channel="mqtt:topic:mosquitto:sonoffs20:power" }
Number GF_Sonoff_S20_RSSI "WiFi Signal Strength [%d %%]" <wifi> (GF_Sonoff_S20) { channel="mqtt:topic:mosquitto:sonoffs20:rssi" }
Group FF_Sonoff_B1 "Sonoff B1" <sonoff_b1> (Sonoff_B1)
String FF_Sonoff_B1_Reachable "Reachable: [%s]" <contactable> (FF_Sonoff_B1) { channel="mqtt:topic:mosquitto:sonoffb1:reachable" }
Switch FF_Sonoff_B1_Power "Power" <light> (FF_Sonoff_B1) { channel="mqtt:topic:mosquitto:sonoffb1:power" }
Switch FF_Sonoff_B1_Fade "Fade: [%s]" <fade_out> (FF_Sonoff_B1) { channel="mqtt:topic:mosquitto:sonoffb1:fade" }
Dimmer FF_Sonoff_B1_Dimmer "Dimmer" <brightness> (FF_Sonoff_B1) { channel="mqtt:topic:mosquitto:sonoffb1:dimmer" }
String FF_Sonoff_B1_Mode "Mode: [MAP(spotlightmode.map):%s]" <colorlight> (FF_Sonoff_B1) { channel="mqtt:topic:mosquitto:sonoffb1:mode" }
Color FF_Sonoff_B1_ColorHSB "Colour [%s]" <colorlight> (FF_Sonoff_B1) { channel="mqtt:topic:mosquitto:sonoffb1:colour" }
Number FF_Sonoff_B1_RSSI "WiFi Signal Strength [%d %%]" <wifi> (FF_Sonoff_B1) { channel="mqtt:topic:mosquitto:sonoffb1:rssi" }
Group FF_Sonoff_POW "Sonoff POW" <sonoff_pow> (Sonoff_POW)
String FF_Sonoff_POW_Reachable "Reachable: [%s]" <contactable> (FF_Sonoff_POW) { channel="mqtt:topic:mosquitto:sonoffpow:reachable" }
Switch FF_Sonoff_POW_Power "Power []" <sonoff_pow> (FF_Sonoff_POW) { channel="mqtt:topic:mosquitto:sonoffpow:power" }
Number FF_Sonoff_POW_Load "Power load [%.1f W]" <voltage> (FF_Sonoff_POW) { channel="mqtt:topic:mosquitto:sonoffpow:powerload" }
Number FF_Sonoff_POW_Voltage "Line voltage [%.1f V]" <voltage> (FF_Sonoff_POW) { channel="mqtt:topic:mosquitto:sonoffpow:voltage" }
Number FF_Sonoff_POW_Current "Line current [%.3f A]" <current> (FF_Sonoff_POW) { channel="mqtt:topic:mosquitto:sonoffpow:current" }
Number FF_Sonoff_POW_Today "Total energy today [%.3f kWh]" <total_energy> (FF_Sonoff_POW) { channel="mqtt:topic:mosquitto:sonoffpow:total" }
Number FF_Sonoff_POW_Yesterday "Total energy yesterday [%.3f kWh]" <total_energy> (FF_Sonoff_POW) { channel="mqtt:topic:mosquitto:sonoffpow:totalyest" }
Number FF_Sonoff_POW_RSSI "WiFi Signal Strength [%d %%]" <wifi> (FF_Sonoff_POW) { channel="mqtt:topic:mosquitto:sonoffpow:rssi" }
Group GF_Sonoff_SC "Sonoff SC" <sonoff_sc> (Sonoff_SC)
String GF_Sonoff_SC_Reachable "Reachable: [%s]" <contactable> (GF_Sonoff_SC) { channel="mqtt:topic:mosquitto:sonoffsc:reachable" }
Number GF_Sonoff_SC_Temperature "Temperature [%d °C]" <temp> (GF_Sonoff_SC) { channel="mqtt:topic:mosquitto:sonoffsc:temperature" }
Number GF_Sonoff_SC_Humidity "Humidity [%d %%]" <humidity> (GF_Sonoff_SC) { channel="mqtt:topic:mosquitto:sonoffsc:humidity" }
Number GF_Sonoff_SC_Light "Light [%d %%]" <light> (GF_Sonoff_SC) { channel="mqtt:topic:mosquitto:sonoffsc:light" }
Number GF_Sonoff_SC_Noise "Noise [%d %%]" <microphone> (GF_Sonoff_SC) { channel="mqtt:topic:mosquitto:sonoffsc:noise" }
Number GF_Sonoff_SC_AirQuality "Air Quality [%d %%]" <air_quality> (GF_Sonoff_SC) { channel="mqtt:topic:mosquitto:sonoffsc:airquality" }
Number GF_Sonoff_SC_RSSI "WiFi Signal Strength [%d %%]" <wifi> (GF_Sonoff_SC) { channel="mqtt:topic:mosquitto:sonoffsc:rssi" }
Group GF_Sonoff_RF "RF Bridge" <sonoff_rf> (Sonoff_RF)
String GF_Sonoff_RF_Reachable "Reachable: [%s]" <contactable> (GF_Sonoff_RF) { channel="mqtt:topic:mosquitto:sonoffrf:reachable" }
String GF_Sonoff_RF_Received_Data "Received Data: [%s]" <none> (GF_Sonoff_RF) { channel="mqtt:topic:mosquitto:sonoffrf:recieveddata" }
String GF_Sonoff_RF_Received_Sync "Received Sync: [%s]" <none> (GF_Sonoff_RF) { channel="mqtt:topic:mosquitto:sonoffrf:recievedsync" }
String GF_Sonoff_RF_Received_Low "Received Low: [%s]" <none> (GF_Sonoff_RF) { channel="mqtt:topic:mosquitto:sonoffrf:recievedlow" }
String GF_Sonoff_RF_Received_High "Received High: [%s]" <none> (GF_Sonoff_RF) { channel="mqtt:topic:mosquitto:sonoffrf:recievedhigh" }
String GF_Sonoff_RF_Received_RfKey "Received RfKey: [%s]" <none> (GF_Sonoff_RF) { channel="mqtt:topic:mosquitto:sonoffrf:recievedrfkey" }
Switch GF_Sonoff_RF_Button_1 "Button 1" <none> (GF_Sonoff_RF) { channel="mqtt:topic:mosquitto:sonoffrf:button1", autoupdate="false"}
...
Switch GF_Sonoff_RF_Button_16 "Button 16: [%s]" <none> (GF_Sonoff_RF) { channel="mqtt:topic:mosquitto:sonoffrf:button16", autoupdate="false"}
Number GF_Sonoff_RF_RSSI "WiFi Signal Strength [%d %%]" <wifi> (GF_Sonoff_RF) { channel="mqtt:topic:mosquitto:sonoffrf:rssi" }
This is my MQTT.things
Bridge mqttbrokermosquitto Mosquitto [ host=localhost, port=1883, secure=false, username=MQTT, password=NonOfYourBusiness, clientID=Replanced_with_My_ID_in_broker ]
{
Sonoffs
Thing topic sonoffs20 Sonoff S20 @ Some Room {
Channels
Type string reachable Reachable [ stateTopic=telesonoff-s20LWT ]
Type switch power Power [ stateTopic=statsonoff-s20POWER, commandTopic=cmndsonoff-s20POWER ]
Type number rssi WiFi Signal Strength [ stateTopic=telesonoff-s20STATE, transformationPattern=JSONPATH$.Wifi.RSSI]
}
Thing topic sonoffb1 Sonoff B1 @ Some Room {
Channels
Type string reachable Reachable [ stateTopic=telesonoff-b1LWT ]
Type switch power Power [ stateTopic=statsonoff-b1POWER, commandTopic=cmndsonoff-b1POWER ]
Type switch fade Fade [ stateTopic=telesonoff-b1STATE, commandTopic=cmndsonoff-b1FADE, transformationPattern=JSONPATH$.Fade ]
Type dimmer dimmer Dimmer [ stateTopic=telesonoff-b1STATE, commandTopic=cmndsonoff-b1DIMMER, transformationPattern=JSONPATH$.Dimmer ]
Type string mode Mode [ stateTopic=telesonoff-b1STATE, commandTopic=cmndsonoff-b1SCHEME, transformationPattern=JSONPATH$.Scheme ]
Type colorHSB colour Colour [ stateTopic=telesonoff-b1STATE, commandTopic=cmndsonoff-b1HSBColor, transformationPattern=JSONPATH$.HSBColor ]
Type number rssi WiFi Signal Strength [ stateTopic=telesonoff-b1STATE, transformationPattern=JSONPATH$.Wifi.RSSI]
}
Thing topic sonoffpow Sonoff POW @ Some Other Room {
Channels
Type string reachable Reachable [ stateTopic=telesonoff-powLWT ]
Type switch power Power [ stateTopic=statsonoff-powPOWER, commandTopic=cmndsonoff-powPOWER ]
Type number powerload Power load [ stateTopic=telesonoff-powSENSOR, transformationPattern=JSONPATH$.ENERGY.Power]
Type number voltage Line voltage [ stateTopic=telesonoff-powSENSOR, transformationPattern=JSONPATH$.ENERGY.Voltage]
Type number current Line current [ stateTopic=telesonoff-powSENSOR, transformationPattern=JSONPATH$.ENERGY.Current]
Type number total Total energy today [ stateTopic=telesonoff-powSENSOR, transformationPattern=JSONPATH$.ENERGY.Today]
Type number totalyest Total energy yesterday [ stateTopic=telesonoff-powSENSOR, transformationPattern=JSONPATH$.ENERGY.Yesterday]
Type number rssi WiFi Signal Strength [ stateTopic=telesonoff-powSTATE, transformationPattern=JSONPATH$.Wifi.RSSI]
}
Thing topic sonoffsc Sonoff SC @ Another Room {
Channels
Type string reachable Reachable [ stateTopic=telesonoff-scLWT ]
Type number temperature Temperature [ stateTopic=telesonoff-scSENSOR, transformationPattern=JSONPATH$.SonoffSC.Temperature]
Type number humidity Humidity [ stateTopic=telesonoff-scSENSOR, transformationPattern=JSONPATH$.SonoffSC.Humidity]
Type number light Light [ stateTopic=telesonoff-scSENSOR, transformationPattern=JSONPATH$.SonoffSC.Light]
Type number noise Noise [ stateTopic=telesonoff-scSENSOR, transformationPattern=JSONPATH$.SonoffSC.Noise]
Type number airquality Air Quality [ stateTopic=telesonoff-scSENSOR, transformationPattern=JSONPATH$.SonoffSC.AirQuality]
Type number rssi WiFi Signal Strength [ stateTopic=telesonoff-scSTATE, transformationPattern=JSONPATH$.Wifi.RSSI]
}
Thing topic sonoffrf RF Bridge @ Yet Another Room {
Type string reachable Reachable [ stateTopic=telesonoff-rfLWT ]
Type string recieveddata Received Data [ stateTopic=telesonoff-rfRESULT, transformationPattern=JSONPATH$.RfReceived.Data]
Type string recievedsync Received Sync [ stateTopic=telesonoff-rfRESULT, transformationPattern=JSONPATH$.RfReceived.Sync]
Type string recievedlow Received Low [ stateTopic=telesonoff-rfRESULT, transformationPattern=JSONPATH$.RfReceived.Low]
Type string recievedhigh Received High [ stateTopic=telesonoff-rfRESULT, transformationPattern=JSONPATH$.RfReceived.High]
Type string recievedrfkey Received RfKey [ stateTopic=telesonoff-rfRESULT, transformationPattern=JSONPATH$.RfReceived.RfKey]
Type switch button1 Button 1 [ stateTopic=statsonoff-rfRESULT, commandTopic=cmndsonoff-rfRFKEY1, transformationPattern=JSONPATH$.RfKey1 ]
...
Type switch button16 Button 16 [ stateTopic=statsonoff-rfRESULT, commandTopic=cmndsonoff-rfRFKEY16, transformationPattern=JSONPATH$.RfKey16 ]
Type number rssi WiFi Signal Strength [ stateTopic=telesonoff-rfSTATE, transformationPattern=JSONPATH$.Wifi.RSSI]
}
}
This is my sonoff.sitemap file:
sitemap default label="Some Place" {
Frame label="Ground Floor" icon="groundfloor" {
Group item=GF_Sonoff_S20 label="Some Adapter"
Group item=GF_Sonoff_SC label="Some Sensors" {
Text item=GF_Sonoff_SC_Reachable label="Status [%s]"
Text item=GF_Sonoff_SC_Temperature label="Temperature [%d °C]"
Text item=GF_Sonoff_SC_Humidity label="Humidity [%d %%]"
Text item=GF_Sonoff_SC_Light label="Light [%d %%]"
Text item=GF_Sonoff_SC_Noise label="Noise [%d %%]"
Text item=GF_Sonoff_SC_AirQuality label="Air Quality [%d %%]"
Text item=GF_Sonoff_SC_RSSI label="WiFi Signal Strength [%d %%]"
}
Group item=GF_Sonoff_RF {
Text item=GF_Sonoff_RF_Reachable label="Status [%s]"
Text item=GF_Sonoff_RF_Received_Data label="Data [%s]"
Text item=GF_Sonoff_RF_Received_Sync label="Sync [%s]"
Text item=GF_Sonoff_RF_Received_Low label="Low [%s]"
Text item=GF_Sonoff_RF_Received_High label="High [%s]"
Text item=GF_Sonoff_RF_Received_RfKey label="RfKey [%s]"
Switch item=GF_Sonoff_RF_Button_1 label="RfKey1" mappings=[ON="Key 1"]
...
Switch item=GF_Sonoff_RF_Button_16 label="RfKey16" mappings=[ON="Key 16"]
Text item=GF_Sonoff_RF_RSSI label="WiFi Signal Strength [%d %%]"
}
}
Frame label="First Floor" icon="firstfloor" {
Group item=FF_Sonoff_B1 label="Some Light" {
Text item=FF_Sonoff_B1_Reachable label="Status [%s]"
Switch item=FF_Sonoff_B1_Power label="Power"
Switch item=FF_Sonoff_B1_Fade label="Fade"
Slider item=FF_Sonoff_B1_Dimmer label="Brightness [%d]"
Selection item=FF_Sonoff_B1_Mode label="Color Mode" mappings=["0"="Single Color", "1"="Wake up", "2"="Slow Cycle", "3"="Fast Cycle", "4"="Disco"]
Colorpicker item=FF_Sonoff_B1_ColorHSB label="Colour"
Text item=FF_Sonoff_B1_RSSI label="WiFi Signal Strength [%d %%]"
}
Group item=FF_Sonoff_POW {
Text item=FF_Sonoff_POW_Reachable label="Status [%s]"
Switch item=FF_Sonoff_POW_Power label="Power []"
Text item=FF_Sonoff_POW_Load label="Power load [%.1f W]"
Text item=FF_Sonoff_POW_Voltage label="Line voltage [%.1f V]"
Text item=FF_Sonoff_POW_Current label="Line current [%.3f A]"
Text item=FF_Sonoff_POW_Today label="Total energy today [%.3f kWh]"
Text item=FF_Sonoff_POW_Yesterday label="Total energy yesterday [%.3f kWh]"
Text item=FF_Sonoff_POW_RSSI label="WiFi Signal Strength [%d %%]"
}
}
}