# Confused about MQTT on openhab2

**URL:** <https://community.openhab.org/t/confused-about-mqtt-on-openhab2/12990>\
**Category:** Bindings\
**Tags:** openhab2, mqtt, binding\
**Created:** [August 4, 2016, 8:06pm UTC](https://community.openhab.org/t/confused-about-mqtt-on-openhab2/12990 "2016-08-04T20:06:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![yves](https://community.openhab.org/user_avatar/community.openhab.org/yves/32/3856_2.png) [@yves](https://community.openhab.org/u/yves)\
**Post date:** [August 4, 2016, 8:06pm UTC](https://community.openhab.org/t/confused-about-mqtt-on-openhab2/12990/1 "2016-08-04T20:06:06Z")

</div>

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.

y

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [August 4, 2016, 8:40pm UTC](https://community.openhab.org/t/confused-about-mqtt-on-openhab2/12990/2 "2016-08-04T20:40:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![yves](https://community.openhab.org/user_avatar/community.openhab.org/yves/32/3856_2.png) [@yves](https://community.openhab.org/u/yves)\
**Post date:** [August 4, 2016, 8:57pm UTC](https://community.openhab.org/t/confused-about-mqtt-on-openhab2/12990/3 "2016-08-04T20:57:55Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![yves](https://community.openhab.org/user_avatar/community.openhab.org/yves/32/3856_2.png) [@yves](https://community.openhab.org/u/yves)\
**Post date:** [August 4, 2016, 9:06pm UTC](https://community.openhab.org/t/confused-about-mqtt-on-openhab2/12990/4 "2016-08-04T21:06:08Z")

</div>

> [@rlkoshak](#):
>
> 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.

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

---

<div class="post-metadata">

**Author:** ![rlkoshak](https://community.openhab.org/user_avatar/community.openhab.org/rlkoshak/32/75251_2.png) [@rlkoshak](https://community.openhab.org/u/rlkoshak)\
**Post date:** [August 4, 2016, 9:28pm UTC](https://community.openhab.org/t/confused-about-mqtt-on-openhab2/12990/5 "2016-08-04T21:28:48Z")

</div>

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.

> [@yves](#):
>
> and the second part of my question : where do I configure the MQTT in openhab2?

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:

> [@Install and setup OpenHAB 2.0 with Mosquitto and ESPEasy+HC-SR04](https://community.openhab.org/t/install-and-setup-openhab-2-0-with-mosquitto-and-espeasy-hc-sr04/7893/19):
>
> Configuring OpenHAB with MQTT Broker First make sure the OpenHAB application is running and that you can access the setup wizard page: .http:/youripaddress:8080/ui/index.html#/setup/wizard Just to recap, in the openhab2.0 directory, run startup.bat from the command line and enter youripaddress:8080 in your browser. The following web page should appear: [image] Click on Extensions: [image] Scroll down until you see “MQTT Binding” and click on the “Install” button. (My MQTT Bind is already…

---

<div class="post-metadata">

**Author:** ![yves](https://community.openhab.org/user_avatar/community.openhab.org/yves/32/3856_2.png) [@yves](https://community.openhab.org/u/yves)\
**Post date:** [August 4, 2016, 10:05pm UTC](https://community.openhab.org/t/confused-about-mqtt-on-openhab2/12990/6 "2016-08-04T22:05:07Z")

</div>

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.
