[SOLVED] Sonoff device state is not changing under Basic UI if toggled through button

Hello folks,
I am continuously learning Openhab though I am not new to IOT but new to openhab.

I have made my openhab and sonoff devices (running Sonoff Tasmota firmware) communicating each other via MQTT. Everything is working as expected but have one issue.

When I turn the switch ON / OFF from Basic UI. State of switch under Basic UI changes correctly. But Sonoff devices such as Sonoff Basic, also have on-device button to toggle the switch. If I toggle the switch using on-device button then state does not change under Basic UI until I refresh the page. My .items and .sitemap files are given below.

Further Information:

Group    Home            "Home"           <house>

Group    Bedroom         "Bedroom"        <bedroom>       (Home)

Switch   Bedroom_Light   "Light"          <light>         (Bedroom, gLight)   ["Lighting"]     { mqtt=">[broker:cmnd/sonoff-A00EEA/POWER:command:*:default],
            <[broker:stat/sonoff-A00EEA/POWER:state:default]" }
Switch   Bedroom_Power   "Power Outlet"   <poweroutlet>   (Bedroom, gPower)   ["Switchable"]   { mqtt=">[broker:cmnd/sonoff-A01EEA/POWER:command:*:default],
            <[broker:stat/sonoff-A01EEA/POWER:state:default]" }

Group:Switch:OR(ON, OFF)   gLight   "Light"          <light>         (Home)
Group:Switch:OR(ON, OFF)   gPower   "Power Outlet"   <poweroutlet>   (Home)


sitemap home label="Home" {
    Frame {
        Group item=Bedroom

    Frame {
        Text label="Light" icon="light" {
            Default item=Bedroom_Light label="Bedroom"

        Text label="Power Outlet" icon="poweroutlet" {
            Default item=Bedroom_Power label="Bedroom"

May please someone help in this regard?

Why did you use a Text Item instead of a Switch.

Simplify your sitemap first:

sitemap home label="Home" {
    Frame {
        Group item=Bedroom

    Frame label="Bedroom" {
        Switch item=Bedroom_Light
        Switch item=Bedroom_Power

@opus I have created it using home builder.

@vzorglub It worked. Thanks.

Thank you Ahmed,
Please mark the thread as solved.
Tick the post that provided the solution

PS: You might be interest in: