[OH3] MQTT Setup and Configuration

First thing is you need to get around in your head is the structural change.

The problem is in openHAB you can do it however you want as long as it works.

For me in OH2 was mostly config files however in OH3 I have changed to UI because its just as easy.

So first you need a MQTT broker bridge to get MQTT working.

Then you create generic things, Make sure you change the label to some sort of good Identifier like Bedroom Lamp and change the identifier if you wish.

Next click on bridge and select the one you created.

Goto the channel tab and add channel

Create any channel you like maybe a switch for the Bedroom Lamp

Once you have finished goto the code tab.

It will show something like

UID: mqtt:topic:1fc045960e
label: Bedroom Lamp
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:myMQTTBroker
channels:
  - id: Power
    channelTypeUID: mqtt:switch
    label: Light
    description: ""
    configuration:
      commandTopic: light/command
      stateTopic: light/state

Now you can copy paste new channels in. You can’t change the channelTypeUID once it has been created.

Once you have all your channels in your thing you got to the Model page. It is well worth the effort to configure you model so create a Location bedroom

Then while the location is selected Create Equipment from Thing.

Select all and create.

This will generate all the items for your thing from the channels you setup. You can also use expert mode to have a oh2 config file familiar setup.

1 Like