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 …
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
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 …
#
# 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)
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