I don't understand reaction of item config with mqtt

Because of adding simulation of control panel, i inserted an special panel. In item config i added the line

Switch sim_switch_1 “Eingang 1 [%s]” (gRaspPiSim) { mqtt=">[localbroker:state/IoTDemo/openHAB/switch_1:command:*:default,<[localbroker:command/IoTDemo/openHAB/switch_1:state:default]"}

When I click to that switch, on mqtt there sends state/IoTDemo/openHAB/sim_switch_1
Why OH2 sends sim_switch_1 instant of switch_1 as I defined as topic string?

And why OH2 sends command/IoTDemo/openHAB/sim_switch_1 additionally?

Thanks for any hinds.

Switch sim_switch_1 “Eingang 1 [%s]” (gRaspPiSim) { mqtt=">[localbroker:state/IoTDemo/openHAB/switch_1:command:*:default","<[localbroker:command/IoTDemo/openHAB/switch_1:state:default]"}

add the two " between the two statements (before and after the coma) and see what happens.

Not sure about OH2, but in OH1 the command and state comes after the topic. (unless your topic starts with state and command, which I don’t think is what you want?!

could it be that you forgot the closing ‘]’ at “default, <[ localbroker”
I think that should be “default], <[ localbroker”

yes, that too… good spotting :slight_smile:

Yet ,that’s it. you made my day :blush:

I must admitt I only saw it because i pasted one of my working MQTT’s under it. Then I saw it immediately. When I was just staring at the channel, i didnt spot it

My pleasure. and really, I have made more foolish mistakes than this