Not enough information to provide a thorough answer. Issues like yours should include screen shots of the Main, Controller, and Device pages.
But for a start, I suggest changing the home.items to this format:
Code: Select all
Switch LampaBanc {mqtt=">[localbroker:/LampaBanc/gpio/5:command:ON:1],>[localbroker:/LampaBanc/gpio/5:command:OFF:0]"}
Your mqtt.cfg does not look correct. If the MQTT broker is on the same IP as your OpenHAB (installed on same machine), then this is the typical syntax:
Code: Select all
localbroker.url=tcp://localhost:1883
Also, there are two different MQTT bindings available to OpenHab. Your syntax and files are for the old legacy MQTT Binding (1.x) version. I use the old 1.x binding, so if you are running the new 2.x version then I won't be able to help (and you should ignore all my suggestions above).
And if you haven't tested the MQTT broker then I suggest you use a tool and confirm it is working. For example, Chrome MQTTLens addon.
- Thomas