Please use code fences in future when pasting contents of your items, logs etc - it prevents formatting getting lost.
The thing that jumps out at me is that your Item is configured with the default (which makes it seem like you’ve copied and pasted from a tutorial) of “broker”
How does your mqtt.cfg file in the conf/services directory identify your MQTT configuration? Is it called “broker” in there too?
(I like to put my outgoing and incoming commands onto separate lines so that I can easily see what is what, but that’s just personal preference, it can all be on a single line)
#
# 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
MQTT CFG File - i am sorry but dont think i ever configured it because all the videos tutorials i went through did have anything
#
# 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://192.168.0.99:1883
# Optional. Client id (max 23 chars) to use when connecting to the broker.
# If not provided a random default is generated.
#<broker>.clientId=<clientId>
# 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.
#<broker>.allowLongerClientIds=false
# 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/>
# 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>
/etc/openhab2/items/mqtt.items - This is blank again
The details of my mqtt setting on sonoff device
Host (domus1)
192.168.0.99
Port (1883)
1883
Client (DVES_00BEE7)
DVES_%06X
User (DVES_USER)
DVES_USER
Password
•••••••••
Topic = %topic% (sonoff)
Masterlight
Full Topic (%prefix%/%topic%/)
%prefix%/%topic%/
`I am using openhab2.10
Thanks and sorry for looking like a fool but i went through tons on online video and all just end up confusing
How did you setup the MQTT Broker. Is it running? Where is it running ?
MQTT fx? whats this?
Sorry for confusion but /etc/openhab2/items/mqtt.items is how I named my MQTT items. I have seperate items files for each type of binding. Like mqtt.items hue.items network.items
You need to configure your mqtt.cfg ! Like this. the first part mosquitto is THAT what you will use later inside your items.
It could also be something else like ULTRAMQTT but you need to remember that broker name!
--> mqtt.cfg with mosquitto. <--
{ mqtt=">[mosquitto:cmnd/sonoff-80786B/POW
ER2:command:*:default], <[mosquitto:stat/sonoff-80786B/POWER2:state:default]" }
--> mqtt.cfg with ULTRAMQTT <--
{ mqtt=">[ULTRAMQTT:cmnd/sonoff-80786B/POW
ER2:command:*:default], <[ULTRAMQTT:stat/sonoff-80786B/POWER2:state:default]" }
You clearly did not read the docs…
The broker, how did you set it up ???
Which IP does your broker have: ?
Which user did you set for the broker: ?
which password did you set for the broker: ?
# 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