Hi There. I am stuck
I have installed openhab 2 on a raspberry pi with openhabian. Everything is running fine. I also have Mosquitto MQTT installed.
I then added a sonoff wifi relay and its connected to Mosquitto MQTT.
When I publish a topic directly using terminal to the queue, my relay works perfectly. this is the command
mosquitto_pub -r -t /relay/newsonoff1 -m “0”
I then add a sitemap, and have an switch item setup using a itme file usiong this command
Switch Sonoff {mqtt="<[mosquitto:/relay/newsonoff1:state:MAP(onoff.map)],>[mosquitto:/relay/newsonoff1:command:ON:1],>[mosquitto:/relay/newsonoff1:command:OFF:0]"}
The switch appears in the Basic UI.
PROBLEM:
When I toggle the switch using the UI, it doesnt always publish the command to the queue.
When I listen to the topic in Mosquitto, it would work 4 times, and then it doesnt work for 10 times, then work 4 times again.
Can anybody please help me