Okay lets start.
We need input.
Give us your /etc/openhab2/services/mqtt.cfg
Give us your /etc/openhab2/items/mqtt.items
Give us a Screenshot of your Sonoff Device>Configuration>MQTT
Do you use openHABian?
openHAB 2.X ? Which one?
Did you read the MQTT Docs ?
Did you read this Topic ? ITEAD Sonoff switches and sockets - cheap ESP8266 Wifi+MQTT hardware
Did you check out the Tasmota Wiki?
mqtt.items example
Switch a_Licht_Outdoor_Sonoff4Channel_2_Biertisch "Lichterketten Biertisch" (g_Outdoor, g_MYSQL) { mqtt=">[mosquitto:cmnd/sonoff-80786B/POW
ER2:command:*:default], <[mosquitto:stat/sonoff-80786B/POWER2:state:default]" }
mqtt.cfg example
#
# Define your MQTT broker connections here for use in the MQTT Binding or MQTT
# Persistence bundles. Replace <broker> with an ID you choose.
#
# URL to the MQTT broker, e.g. tcp://localhost:1883 or ssl://localhost:8883
#<broker>.url=tcp://<host>:1883
# Optional. Client id (max 23 chars) to use when connecting to the broker.
# If not provided a default one is generated.
#<broker>.clientId=<clientId>
# Optional. User id to authenticate with the broker.
#<broker>.user=<user>
# Optional. Password to authenticate with the broker.
#<broker>.pwd=<password>
# Optional. Set the quality of service level for sending messages to this broker.
# Possible values are 0 (Deliver at most once),1 (Deliver at least once) or 2
# (Deliver exactly once). Defaults to 0.
#<broker>.qos=<qos>
# Optional. True or false. Defines if the broker should retain the messages sent to
# it. Defaults to false.
#<broker>.retain=<retain>
# Optional. True or false. Defines if messages are published asynchronously or
# synchronously. Defaults to true.
#<broker>.async=<async>
# Optional. Defines the last will and testament that is sent when this client goes offline
# Format: topic:message:qos:retained <br/>
#<broker>.lwt=<last will definition>
mosquitto.clientId=SmartOffice
#mosquitto.url=tcp://192.168.107.2:1883
#mosquitto.url=tcp://107.0.0.1:1883
mosquitto.url=tcp://192.168.107.2:1883
mosquitto.user=openhabian
mosquitto.pwd=NoWayYouGetMyPass
mosquitto.qos=1
mosquitto.retain=true
mosquitto.async=true
# The Sonoff Tasomate Broker
#maddox.url=tcp://sonoff.maddox.co.uk:1883
Example Screenshot of my 4Ch Sonoff
https://puu.sh/yrn1X/c2d47700ac.png
I could bet your broker is not named broker, for me I named it mosquitto. Followed the wiki.