Bind existing item directly to MQTT?

Hi there,

Quick question, I have an existing squeezeplayer power switch item (on/off) that I also want to control via
MQTT (old binding).

Is there any way I can enable this for the existing switch item, or do I need to create a proxy item and add a rule to toggle the real switch item if the proxy item is changed?

Thank you,

You may use multiple channels for an item (separated by a comma):

@sihui thank you, are there any examples how this would look like with MQTT channels?
And: How to do this if I have the Item not defined in the files but in the jsondb?

Yes. please use the search button in this forum.
Here is one with three channels linked:

Switch FibFGS222_DoubleRelay1_1 { channel="zwave:device:uzb:node36:switch_binary",mqtt="<[mosquitto:/wss3/command/Light_Hall_Up:command:ON:ON],<[mosquitto:/wss3/command/Light_Hall_Up:command:OFF:OFF]",expire="10m,command=OFF" }

No idea, sorry. I use PaperUI for autodiscovery of Things, nothing else :sunglasses:

Thank you, that helps.

Just one more question, I can export my Items definition with the script:

so I get for example:
Switch squeezebox_squeezeboxplayer_f3ddcc30_b827eb8b559e_power “Power”

However, I don’t see the channel linking here? How is this done?

Let me rephrase, @sihui could you tell me, if I have the Things definition in PaperUI, with a channel like this:

How would I create this item in the textfile, linked to that channel, does this just have to be:

Edit: I think I got it :slight_smile:

Switch "Power" { channel="squeezebox_squeezeboxplayer_f3ddcc30_b827eb8b559e_power" }

This would only work it that power channel is for sending ON and OFF. If it is power consumption switch is the wrong item type.

1 Like