Feeling Frustated :-( MQTT setup

I have been using openhab for about 5 years, and was very happy with openhab 2. I recently updated to openhab3 and now I have no idea how to make MQTT work. Is there an easy way to update my items file so it will work with openhab 3? Currently looks like:

Number timer_up_12 “Node12 time up [%.0f minutes]” (TimeMax,TimeMin,watchdog,Node12,log) {mqtt="<[OH3MQTTBRO:home/rfm_gw/nb/node12/dev00:state:default]"}
Number Radio_1202 “Node 12 Level [%.0f dB]” (radio,Node12,log,RadioMin,RadioMax) {mqtt="<[OH3MQTTBRO:home/rfm_gw/nb/node12/dev02:state:default]"}
Number Temperature_1248 “Kitchen 12/48 [%.1f °C]” (House,Kitchen,Node12,All_Temperature, temp_chart,log) {mqtt="<[OH3MQTTBRO:home/rfm_gw/nb/node12/dev48:state:default]"}
Number Temperature_1249 “Kitchen 12/49 [%.1f °C]” (House,Kitchen,All_Temperature,Node12,log) {mqtt="<[OH3MQTTBRO:home/rfm_gw/nb/node12/dev49:state:JS(minus3.js)]"}
Number Temperature_1251 “Kitchen 12/51 [%.1f °C]” (House,temperature, Kitchen,Node12,All_Temperature,log) {mqtt="<[OH3MQTTBRO:home/rfm_gw/nb/node12/dev51:state:default]"}
Number Pressure_1252 “Pressure 12/52[%.1f HPa]” (HouseData, Kitchen,pres_chart,Node12,log) {mqtt="<[OH3MQTTBRO:home/rfm_gw/nb/node12/dev52:state:default]"}
Number Humidity_1250 “Humidity 12/50[%.1f %%]” (HouseData, Kitchen,hum_chart,Node12,log) {mqtt="<[OH3MQTTBRO:home/rfm_gw/nb/node12/dev50:state:default]"}
Number lux_1251 “light level 12/53[%.1f lux]” (HouseData, light_chart,Kitchen,Node12,log) {mqtt="<[OH3MQTTBRO:home/rfm_gw/nb/node12/dev53:state:default]"}

Please use code fences, as it is really hard to read your config.

Your configuration uses the v1 version of the MQTT Binding, originally written for openHAB 1. Luckily openHAB 2 was able to use v1 bindings so nothing had to change. However, openHAB 3 can no longer use v1 bindings, so you must change your configuration to those accepted by the V2/V3 MQTT Binding.

Here is an example on how to convert.


Thanks - that’s great - so lots of work to do :slight_smile:

whats a code fence?

A code fence is:

It’s these at the top right of the editing box where you type in your question.

your code goes here

It formats the code so it can be easily read and copied.

1 Like

did you want to continue using files or do you want to create them with the main UI?

Thanks Greg, that’s helpful - still feeling annoyed that ‘upgrading’ from openhab2 has destroyed by pages, graphs, tags, and much of my data from the last five years (although it is saved in a mysql database) - wishing I hadn’t done anything - I have roughly 200 items/tags to recreate, let alone my rules, pages etc etc etc…

I was cautious about an upgrade so I did it slowly and in parallel.
I upgrade from 2.5 but the way I did it was snapshot the VM OH2.5 was on and then do the upgrade so I could get a backup of OH3.
Then I rolled back the snapshot so OH2.5 was running again just like no upgrade had ever happened.
I then created OH3 server and restored the backup from the upgrade. I had OH2.5 and OH3 running at the same time.
I removed all the DSL rules from the OH3 and then I created the rules one at a time from OH2.5 but this time I did it all in Javascript.
I just did a few rules at a time until all the rules were converted and on OH3 then I shut down the OH2.5.
I have no DSL rules and no items etc as files. All done via the UI.
I feel your annoyance but the OH3 is much better I think.

You’ve got the advantage of being later in the day than many others who have gone before. But you are failing to take advantage of their experiences. Migration is a big job, not to be undertaken lightly.

You are going to hit rule snags as well, changes in datetime handling and imports where used. Also depending on devices in use some Items may acquire units of measurement, again affecting rules.