[Solved] Arduino + Mqtt Not updating the openhab Gui

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

For the items you have, the light should send a topic of /home/light1/confirm and data of ON or OFF. (You have light1 for both lights in your item file, which may also be causing some confusion)

I’m not sure about your page update problem. Which version of openhab are you using? Version 1.8.2 had a problem updating the screen which was fixed in later versions. If not this, are you sure the item is actually getting updated (as indicated in the event log)?

I’m not sure about your page update problem. Which version of openhab
are you using? Version 1.8.2 had a problem updating the screen which
was fixed in later versions. If not this, are you sure the item is
actually getting updated (as indicated in the event log)?

yes i am using the openhab version 1.8.2…
And thank you for telling me the same i downgraded to version 1.7 and it works like charm. thanks a lot…