[Solved] Using %prefix% for full MQTT Topics

I had the setup working but decided to add a prefix to my local devices and now openHAB wont work with them.

My command topic was: cmnd/ZBBrdige/command message, this worked
Now it is: cmnd/Stockholm/ZBBridge/command message, this wont work for me

This is my thing def:

Thing mqtt:topic:tele:Stockholm:ZBBridge “ZBBridge” (mqtt:broker:MosquittoMqttBroker) {
Channels:
// Sonoff Zb Bridge
Type switch : Plug1 [
stateTopic=“stat/Stockholm/ZBBridge/RESULT”,
commandTopic=“cmnd/Stockholm/ZBBridge/ZbSend”,
formatBeforePublish="{“device”:“Plug1”,“send”:{“Power”:"%s"}}",
on=“On”,
off=“Off”]
and so on }

item desc:

/ device specific properties
Switch Plug1 “Plug1” {channel=“mqtt:topic:tele:Stockholm:ZBBridge:Plug1”}

Any hints would be appreciated.

Thanks

I bet you’re hitting the bug where OH doesn’t properly register that you’ve edited and saved your Things file. Try restarting openHAB.

This is unusual. Usually it’s just mqtt:topic:<uniqueID>

Strange, seems off command works but not on command.

This is the log from the ZBBridge at the off message:

00:38:33.345 MQT: stat/Stockholm/ZBBridge/RESULT = {“ZbSend”:“Done”}
00:38:33.476 MQT: tele/Stockholm/ZBBridge/RESULT = {“ZbResponse”:{“Device”:“0x5595”,“Name”:“Plug2”,“Command”:“0006!00”,“Status”:0,“StatusMessage”:“SUCCESS”,“Endpoint”:1,“LinkQuality”:147}}
00:38:34.080 MQT: tele/Plug2/SENSOR = {“ZbReceived”:{“Plug2”:{“Device”:“0x5595”,“Name”:“Plug2”,“Power”:0,“Endpoint”:1,“LinkQuality”:149}}}

and this is at the on message:

00:39:53.875 MQT: stat/Stockholm/ZBBridge/RESULT = {“ZbSend”:“Done”}
00:39:54.007 MQT: tele/Stockholm/ZBBridge/RESULT = {“ZbResponse”:{“Device”:“0x5595”,“Name”:“Plug2”,“Command”:“0006!00”,“Status”:0,“StatusMessage”:“SUCCESS”,“Endpoint”:1,“LinkQuality”:149}}
00:39:54.613 MQT: tele/Plug2/SENSOR = {“ZbReceived”:{“Plug2”:{“Device”:“0x5595”,“Name”:“Plug2”,“Power”:0,“Endpoint”:1,“LinkQuality”:149}}}

I am missing something right in front of my eyes…

restart it was!

Thanks!!

Restarting can be quite tedious, so I do this.