MQTT Channel - best method to link items

  • OH4, OH5 and future OH

What is the best method to link items to MQTT channels ? Which method results in the minimal load ?

Method 1:

Create a thing with one channel for each value you wish to extract from incoming JSON-String. If you get multiple values, you have to create multiple channels - channel types corresponds to item types.

Method 2:

Create a thing with exactly one string channel and link multiple items to the same channel, using profiles (JSONPATH, REGEX etc) on items. Different item types are possible, if you create a new item while linking with PaperUI.

Method 1 has the lower load and is the standard approach. Method 2 is what one does in those rare cases where Method 1 isn’t possible (e.g. the binding doesn’t support transformations on the Channels).

Following best practices, each device should be represented with a separate Thing.

But this is somewhat a case of premature optimization. Even if Method 1 had a higher load, it would still be the best approach over all without further details. The difference in load is marginal if it’s even measurable.

Thanks for information - no need for config changes then.