MQTT Binding Question

Edit: after doing some research I think the problem is this openhab item configuration:
Switch node2_sw1 “sw2” (node2,all) {mqtt=">[mysensor:MyMQTT/21/1/V_LIGHT:command:ON:1],>

I understand everything except “MyMQTT/21/1/V_LIGHT”

From github:
Item itemName {mqtt="[::::]" }

this is the “topic” part but how can I find out what to put there for my setup?

Hey guys, thanks for taking the time to help me.

I am trying to use one wifi Rpi running Openhab to control another Rpi breadboard LED

wifi Rpi breadboard LED works great with a python program (MQTT installed pip install paho-mqtt)

Just confused how my bindings are setup and other constants (device id, client id, user id, password)

My python program that runs on my Rpi with the breadboard has device credentials:

device credentials

device_id = ‘sensor’ # (I just chose this, I’m not sure how it applies to Openhab)
device_secret = ‘313131’ # (my MQTT client password)
random_client_id = ‘MQTT’ # (my client id)

On the Rpi running Openhab I have this

openhab.cng file:

And for my .items file (which this part I am very unclear about) I have this:
Switch node2_sw1 “sw2” (node2,all) {mqtt=">[mysensor:MyMQTT/21/1/V_LIGHT:command:ON:1],>[mysensor:MyMQTT/21/1/V_LIGHT:command:OFF:0]"}

I have my sitemap and .map and transform files configured but I’m hoping someone might be able to see the problem with what I’ve written.

Thanks so much for any help


THIS “MyMQTT/21/1/V_LIGHT” is your topic, not the entire string. So you have to have something subscribed to the topic in order to receive the “1” that you have set for the ON command.