Biding MQTT to OpenHab item


#1

Hi

I’ve been trying to connect a Sonoff Flashed with ESPURNA to OpenHub. I’m having problems to create the switch in home.items.

These are the screen captures with my setup,

I’m creating the item with the code

Switch SONOFF_1 “LED Light” {mqtt=">[broker:living/SONOFF_1:command:ON:1],>[broker:living/SONOFF_1:command:OFF:0],<[broker:living/SONOFF_1:state:ON:1],<[broker:living/SONOFF_1:state:OFF:0"} [ “Switchable” ]

But it is not connecting to OpenHab2. Could anyone let me know where my error is?


#2

did you find a solution?
I am encountering an problem when using [“Switchable”] and curious to see how you solve this.


#3

I have this configuration and it is working.
Switch DR_Light_SW [“DR Light”] {mqtt=">[broker:cmnd/sonoff_touch1/POWER:command:*:default],
<[broker:stat/sonoff_touch1/POWER:state:default]"}

I ran into mqtt broker (mosquitto) authentication errors, once that was fixed i have no issues.