hello,
i am trying to do a very simple arduino mqtt switch, in which i have an arduino to turn on and off a light with the help of openhab.
now the problem is that i am not able to see the openhab’s Graphical User Interface to be updated when i turn on the switch in the openhab. i have to refresh the whole page to do that. then if i toggel the switch on and refresh the page the bulb on the GUI turns yellow.
the second problem is i dont know what data i should send to openhab for the inbound of the switch state. why does the openhab dont change my toggel switch to off when i turn off the light switch manually on my arduino. why when i refresh the page only the bulb goes yellow and not the toggel switch turns to on state when i turn on the light manually on arduino.
below is my code
sitemap Test label="Arduino Home Automation"
{
Frame label="MQTT"
{
Switch item=mqttsw1 label="Light 1"
Switch item=mqttsw2 label="Light 2"
}
}
the .items
Group All
Switch mqttsw1 "Switch 1" (all) {mqtt=">[mybroker:/home/light1/command:command:ON:1],>[mybroker:/home/light1/command:command:OFF:0],<[mybroker:/home/light1/confirm:state:default]"}
Switch mqttsw2 "Switch 2" (all) {mqtt=">[mybroker:/home/light2/command:command:ON:1],>[mybroker:/home/light2/command:command:OFF:0],<[mybroker:/home/light1/confirm:state:default]"}
thanks in advance