Confused about MQTT on openhab2

in paper UI I see a MQTT in the persistence part and also an MQTT in the “normal” bindings

I think that to use MQTT, I need to install also an MQTT server like mosquito, or is that handled in Openhab2?

if not what is the difference between the two mqtt options I can select in paperUI?
And where do I configure them. I don’t see any files created for them.


You do indeed need to install an MQTT broker like mosquitto. openHAB is just an MQTT client, not a broker unto itself.

The MQTT Persistence binding is a way to publish all updates/changes/periodically the states of your Items to an MQTT topic. So instead/in addition to setting up rrd4j, you can set up mqtt persistence. It is one way to expose all or select parts of what is happening inside your openHAB to the outside world via MQTT. NOTE that this communication is only one way. openHAB only publishes events, it does not receive through the MQTT Persistence binding.

The MQTT Binding is used to bind Items to topics in order to send AND receive messages and populate the states of your Items. The MQTT Binding is used FAR more often than the Persistenec binding and is almost certainly the one you want to use.

1 Like

thanks that is clear.

I had used the RRD4J for persistence also yet was never able to make it work, from this I suspect I might need to install rrd4J also using apt get is that correcT?

and the second part of my question : where do I configure the MQTT in openhab2?

No, rrd4j is embedded (at least it was for OH 1) requiring no additional installation. What didn’t work?

NOTE: There are limitations with rrd4j including: can only save numbers, usually only works when you save values at least once per minute.

I’m no expert on OH 2 yet. My understanding though is that the config files have been broken out into separate files so I would expect you would either configure it through PaperUI or through a file named something like mqtt.conf.

Unfortunately, the “Installing an Extension” part of the tutorial is not yet written. But this post should be helpful:

thanks. For RRD4J, I will look later, it’s not important right now, just a small sidetrack because I thought it might have been related.

I had not seen this post. Thank you

It’s not working fully as it states, I’ll reply to that one.