Mqtt bindings not showing up

HI There,

I am running openHAB in a debian VM on FreeNAS. Works great and I have setup the inital stages on the webpage.

As my only devices I want to use are using mqtt I have installed the msqtt binding and action plugins. However I do not see the binding showup on the InBox.

How do I set it up? I have setup mqtt.cfg with my broker IP and named it mosquitto, as I have a mosquitto broker running.

My device is publishing data to mosquito and I see that in mosquitto debug window … how do I attach devices in the GUI (I am using PaperUI) or is it all config file based …

I have read the section on mqtt but it is not clear what to put in what config file, i.e where do I place the publish and subscribe lines, is it in mqtt-event-bus.ctf?

Even when I have done that how to I attach the GUI devices to those events …

Thanks

Welcome @bmentink

You will need to create a sitemap that you can browse with BasicUI (or openHAB mobile App)

See more here: https://www.openhab.org/docs/configuration/sitemaps.html

Check out also: https://www.openhab.org/docs/tutorial/

Thanks for that.

However, I do not have a /etc/openhab2/services/mqtt.cfg, (I did a manual install, so everything is in a local directory) I tried to find that file and located it in conf/services/mqtt.cfg, is that the one?
I still don’t know where the subscibe/publish lines go … I am following the howto in the following link:
mqtt howto

yup

in the item definition (within a $OPENHAB_CONF/items/my.items file)

got ya, thanks.

I had a look at the log and I see I am having authentication issues with my broker.
My broker uses only username, no password, so I provides just the username in mqtt.cfg, plus the broker.url of course, but still no authentication.

I am using a mosquitto broker … not sure what else to do …

?

post the mosquitto.conf plz and mqtt.cfg

#
# 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 
mosquitto.url=tcp://192.168.178.31: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>
mosquitto.user=bmentink

# Optional. Password to authenticate with the broker.
#<broker>.pwd=<password>
#mosquitto.pwd=

And here is the relevant part of mosquitto.conf: (I only added this line)

user bmentink

Please post the whole of mosquitto.conf

How? I can’t upload a file with that extension, and to paste as a block, I have to indent every line with 4 spaces … bah! it’s too long, I will be here forever …

# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example

pid_file /var/run/mosquitto.pid

persistence false
persistence_location /var/lib/mosquitto/

port 1883
#listener 1881

log_dest file /var/log/mosquitto/mosquitto.log
log_type information
connection_message true
log_timestamp true

include_dir /etc/mosquitto/conf.d
allow_anonymous false
password_file /etc/mosquitto/conf.d/passwordfile.txt

Took me 10 seconds

cd /etc/mosquitto
nano mosquitto.conf

copy/paste

Maybe, but my one is 660 lines or more …:joy:

I neeeeed to see this :slight_smile:

Then something is wrong

comment out the `user bmentink’ line you don’t need that if you are not using auth

Do you have a line like allow_anonymous true?

yes, that line is the default action …

the file is 37K of text, is there a way I can change it’s name and post it?

mosquitto.conf should only be a few lines unless you are running an industrial set-up with multiple mirror brokers etc…

1 Like

It’s running on my FreeNAS server so it’s FreeBSD … and has LOT’s of commented lines … very verbose …

Put it on google drive or drop box.