In case of the Sonoff it’s a good idea to go with the Tasmota firmware. There is a whole thread on the Sonoff+Tasmota here in the forum.
You’ll also find a detailed description of how to connect modules to openHAB, with item examples and everything. I’d advice to safe you the trouble and switch right now.
Regarding your problem: first there shouldn’t be a starting slash in an mqtt topic. Seems however to be consistent between your configs. Next issue I’m seeing is that your broker is called “broker” but you are trying to talk to “mosquitto”. One other problem I’m seeing is, that you didn’t provide the login credentials in your mqtt.conf. Is the binding even connected?
Did you read the binding Readme carefully?
you were honestly not the first one to have starting trouble with the MQTT Binding in the beginning of their openHAB adventure. I’ve taken what I’ve written above over into a Tutorial. Could you please check if anything is missing or not clear to a newcomer?
The first line defines the Item with all it’s details, the second defined the outbound MQTT topic, the third the inbound. Because you didn’t show all needed details I’m not sure if the topic for the latter is correct.
# 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
# Optional. Client id (max 23 chars) to use when connecting to the broker.
# If not provided a random default is generated.
# Optional. True or false. If set to true, allows the use of clientId values
# up to 65535 characters long. Defaults to false.
# NOTE: clientId values longer than 23 characters may not be supported by all
# MQTT servers. Check the server documentation.
# Optional. User id to authenticate with the broker.
# Optional. Password to authenticate with the broker.
# 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.
# Optional. True or false. Defines if the broker should retain the messages sent to
# it. Defaults to false.
# Optional. True or false. Defines if messages are published asynchronously or
# synchronously. Defaults to true.
# Optional. Defines the last will and testament that is sent when this client goes offline
# Format: topic:message:qos:retained <br/>