# Things files with MQTT 2.4

**URL:** <https://community.openhab.org/t/things-files-with-mqtt-2-4/61090>\
**Category:** Items & Sitemaps\
**Created:** [December 25, 2018, 8:13pm UTC](https://community.openhab.org/t/things-files-with-mqtt-2-4/61090 "2018-12-25T20:13:06Z")\
**Posts on this page:** 9\
**Page:** 2

<div class="post-metadata">

**Author:** ![RiotMode](https://community.openhab.org/user_avatar/community.openhab.org/riotmode/32/80291_2.png) [@RiotMode](https://community.openhab.org/u/RiotMode)\
**Post date:** [November 24, 2019, 4:12pm UTC](https://community.openhab.org/t/things-files-with-mqtt-2-4/61090/22 "2019-11-24T16:12:26Z")

</div>

> [@opus](#):
>
> Which version are you on?

i am on 2.4 correct.  
its good if this is a known bug.  
i will create a .thing file for each mqtt-device as long as it takes to fix.

---

<div class="post-metadata">

**Author:** ![opus](https://community.openhab.org/user_avatar/community.openhab.org/opus/32/55801_2.png) [@opus](https://community.openhab.org/u/opus)\
**Post date:** [November 24, 2019, 4:44pm UTC](https://community.openhab.org/t/things-files-with-mqtt-2-4/61090/23 "2019-11-24T16:44:02Z")

</div>

It is fixed already. The next stable version is scheduled to come before the coming xmas ( just as if we have nothing else to do during those days☺).

---

<div class="post-metadata">

**Author:** ![RiotMode](https://community.openhab.org/user_avatar/community.openhab.org/riotmode/32/80291_2.png) [@RiotMode](https://community.openhab.org/u/RiotMode)\
**Post date:** [November 24, 2019, 5:03pm UTC](https://community.openhab.org/t/things-files-with-mqtt-2-4/61090/24 "2019-11-24T17:03:05Z")

</div>

> [@opus](#):
>
> It is fixed already.

hmm, and why isnt it working on my side ?

> [@hakan](#):
>
> Hope this helps a little bit.

it helped me a lot - thank you hakan!

---

<div class="post-metadata">

**Author:** ![opus](https://community.openhab.org/user_avatar/community.openhab.org/opus/32/55801_2.png) [@opus](https://community.openhab.org/u/opus)\
**Post date:** [November 24, 2019, 6:47pm UTC](https://community.openhab.org/t/things-files-with-mqtt-2-4/61090/25 "2019-11-24T18:47:07Z")

</div>

It isn’t solved on your side because you are not using a changed version. In order to get a version with changed code you would need to update now either to a snapshot or milestone version. As said before a new stable version will be released soon, if you want to stick by stable versions you could use this one.

---

<div class="post-metadata">

**Author:** ![RiotMode](https://community.openhab.org/user_avatar/community.openhab.org/riotmode/32/80291_2.png) [@RiotMode](https://community.openhab.org/u/RiotMode)\
**Post date:** [November 24, 2019, 6:48pm UTC](https://community.openhab.org/t/things-files-with-mqtt-2-4/61090/26 "2019-11-24T18:48:32Z")

</div>

> [@opus](#):
>
> if you want to stick by stable versions

yes, because i am a noob 🙂 thanks for the clarification!

---

<div class="post-metadata">

**Author:** ![rossko57](https://community.openhab.org/user_avatar/community.openhab.org/rossko57/32/70263_2.png) [@rossko57](https://community.openhab.org/u/rossko57)\
**Post date:** [November 24, 2019, 7:21pm UTC](https://community.openhab.org/t/things-files-with-mqtt-2-4/61090/27 "2019-11-24T19:21:10Z")

</div>

> [@RiotMode](#):
>
> i have a working setup with 1 thing and 2 channels , but as soon as i put another thing in it, the whole stuff breaks.

What we really need for any useful comment, is what is your working setup, what is your not-working setup, what does “the whole stuff breaks” look like?

---

<div class="post-metadata">

**Author:** ![RiotMode](https://community.openhab.org/user_avatar/community.openhab.org/riotmode/32/80291_2.png) [@RiotMode](https://community.openhab.org/u/RiotMode)\
**Post date:** [November 24, 2019, 7:25pm UTC](https://community.openhab.org/t/things-files-with-mqtt-2-4/61090/28 "2019-11-24T19:25:49Z")

</div>

> [@rossko57](#):
>
> is what is your working setup, what is your not-working setup, what does “the whole stuff breaks” look like?

raspb.3 with openhabian 2.4

**bridge.things**

```
Bridge mqtt:broker:riot "MQTT Broker" 
[ 
    host="XXXXXXXXX", 
    port=1883, 
    secure=false, 
    username="XXXXXX", 
    password="XXXXXX" 
]

```

**sonoff.things**

```
Thing mqtt:topic:sonoff_th16 "MQTT Thing: Sonoff TH16" (mqtt:broker:riot) @ "MQTT-Things"
{
  Channels:
    Type switch : power "Power Switch" [ 
        stateTopic="stat/sonoff_th16/POWER", 
        commandTopic="cmnd/sonoff_th16/POWER",
        on="ON",
        off="OFF"          
    ]
    Type string : state "Power State" [ 
        stateTopic="stat/sonoff_th16/POWER",
        on="ON",
        off="OFF"
    ]
    Type number : temperature "Temperature" [ 
        stateTopic="tele/sonoff_th16/SENSOR",
        transformationPattern="JSONPATH:$.SI7021.Temperature"
    ]
    Type number : humidity "Humidity" [ 
        stateTopic="tele/sonoff_th16/SENSOR",
        transformationPattern="JSONPATH:$.SI7021.Humidity"
    ]
    Type number : rssi "RSSI" [ 
        stateTopic="tele/sonoff_th16/STATE",
        transformationPattern="JSONPATH:$.Wifi.RSSI"
    ]
    Type number : load "Load" [ 
        stateTopic="tele/sonoff_th16/STATE",
        transformationPattern="JSONPATH:$.LoadAvg"
    ]
    Type string : uptime "Uptime" [ 
        stateTopic="tele/sonoff_th16/STATE",
        transformationPattern="JSONPATH:$.Uptime"
    ]
    Type string : ssid "SSId" [ 
        stateTopic="tele/sonoff_th16/STATE",
        transformationPattern="JSONPATH:$.Wifi.SSId"
    ]
}

```

to here all is fine.

* * *

and as soon as i put this on the bottom of the file (sonoff.things) , both sonoffs arent showing up as Thing in PaperUI

```
Thing mqtt:topic:sonoff_1 "MQTT Thing: Sonoff Basic" (mqtt:broker:riot) @ "MQTT-Things"
{
    Channels:
        Type number : wifi "Wifi"  
        [ 
            stateTopic="/Sonoff_1/WI-FI/" 
        ]
        Type number : uptime "Uptime"  
        [ 
            stateTopic="/Sonoff_1/uptime/Minutes" 
        ]
}

```

in 2 seperate .things files, both sonoff work as intended

---

<div class="post-metadata">

**Author:** ![rossko57](https://community.openhab.org/user_avatar/community.openhab.org/rossko57/32/70263_2.png) [@rossko57](https://community.openhab.org/u/rossko57)\
**Post date:** [November 24, 2019, 7:51pm UTC](https://community.openhab.org/t/things-files-with-mqtt-2-4/61090/29 "2019-11-24T19:51:26Z")

</div>

> [@RiotMode](#):
>
> as soon as i put this on the bottom of the file (sonoff.things)

I’m gonna guess `openhab.log` will tell you something about it when the xxx.things file is loaded.

I wonder if it has anything to do with duplicate channel ID `uptime`

---

<div class="post-metadata">

**Author:** ![dr.dentz](https://community.openhab.org/letter_avatar_proxy/v4/letter/d/779978/32.png) [@dr.dentz](https://community.openhab.org/u/dr.dentz)\
**Post date:** [February 17, 2020, 8:59pm UTC](https://community.openhab.org/t/things-files-with-mqtt-2-4/61090/30 "2020-02-17T20:59:36Z")

</div>

Could you explain how you set this up with the embedded broker (Openhab Moquette, misc-mqttbroker - 2.5.1). I tried out all sorts of combinations of the bridge and things files but cannot manage to get it working. I try to send some test MQTT commands to OpenHAB via MQTT.fx first, but this does not work.

How do I setup the bridge.things file for the embedded broker? I both to use the “mqtt:systemBroker:embedded-mqtt-broker” directly in the mqtt.things file to assign a topic but also tried:

```csv
Bridge mqtt:broker:myMQTT "MQTT Broker: MyTest Mosquitto"
[
    host="localhost",
    port=1883,
    secure=false
]

```

Doesn’t work ☹

I tried it the other way around and apparently set it up somewhat correctly, because using a trigger and this rule, I can send MQTTs and can view them in MQTT.fx

```csv
rule "MQTTtest"
when
	Item mqtttest received command ON
then 
    val mqttActions = getActions("mqtt","mqtt:systemBroker:embedded-mqtt-broker")
    mqttActions.publishMQTT("MQTT-Testtrigger","Testtest", true)
end

```

[Previous page](https://community.openhab.org/t/things-files-with-mqtt-2-4/61090.md?page=1)
