Hue Switch does not show correct state in Basic UI after rule sends command

Hi,
I’m new here and have build a lot of cool things with OH with all the great topics here.
But for now, i have a problem with the state of my hue lights.

I run OH on Ubuntu 18.04 - latest stable Version with all updates. Installed just two weeks ago.

I have created a rule for some hue scenes to select from in the basic ui app.

So this rule works and I use the Wohnzimmer_Szenen.postUpdate(-1) command, to reset the blue buttons on sitemap selection.

the problem now is, that the Switch icons of the single light bulbs not always shows the right state.
They stay “OFF” often, after the rule has turned on the lights. For example, here you see that “Theke Schalter” is off, although the light was turned on by the scene rule.

I tried to add the Wohn_Esszimmer_Switch.postUpdate(ON) command to the end of each case, bit this does not change anything.

It would be great if anyone has a clue, how I can get the Switches to show the correct state.

Here is the rule:

rule "Wohnzimmer Szenen"
    when
    	Item Wohnzimmer_Szenen received command
    then
    		switch (receivedCommand) {
    		case 0: { // Hell
    				Kuechentheke_1_Dimmer.sendCommand(100)
    				Kuechentheke_1_Temp.sendCommand(40)
    				Esstisch_Dimmer.sendCommand(100)
    				Esstisch_Temp.sendCommand(40)
    				WZ_Decke_Color.sendCommand("40,20,100")
    				WZ_Laterne_Color.sendCommand("40,20,70")
    		}
    		case 1: { // Essen
    				Kuechentheke_1_Dimmer.sendCommand(80)
    				Kuechentheke_1_Temp.sendCommand(70)
    				Esstisch_Dimmer.sendCommand(90)
    				Esstisch_Temp.sendCommand(50)
    				WZ_Decke_Color.sendCommand("40,80,60")
    				WZ_Laterne_Color.sendCommand("0,100,50")		
    		}
    		case 2: { // Kino
    				Kuechentheke_1_Dimmer.sendCommand(20)
    				Kuechentheke_1_Temp.sendCommand(80)
    				Esstisch_1_Toggle.sendCommand(OFF)
    				Esstisch_3_Toggle.sendCommand(OFF)
    				Esstisch_2_Dimmer.sendCommand(20)
    				Esstisch_2_Temp.sendCommand(80)
    				WZ_Decke_Color.sendCommand("30,80,20")
    				WZ_Laterne_Color.sendCommand("0,100,40")
    		}		
    		case 3: { // Aus
    				Wohn_Esszimmer_Switch.sendCommand(OFF)				
    		}
    		}
    		Thread::sleep(1000)
                Wohnzimmer_Szenen.postUpdate(-1)

end

Here are my items:

    Group:Switch:OR(ON,OFF) Esstisch_Switch
    Group:Dimmer:MAX Esstisch_Dimmer
    Group:Dimmer:MAX Esstisch_Temp
    Group:Switch:OR(ON,OFF) Wohn_Esszimmer_Switch
    Group:Switch:OR(ON,OFF) Alle_Lampen

    Switch Flur_EG_Toggle "Switch" (Alle_Lampen) { channel="hue:0220:0XXXXXXX56f:4:brightness" }
    Dimmer Flur_EG_Dimmer "Brightness" { channel="hue:0220:00XXXXXXX56f:4:brightness" }
    Dimmer Flur_EG_Temp "Temperature" { channel="hue:0220:00XXXXXXX56f:4:color_temperature" }

    Switch WZ_Decke_Toggle "Switch" (Alle_Lampen, Wohn_Esszimmer_Switch) { channel="hue:0210:XXXXXXX6f:1:color" }
    Color WZ_Decke_Color "Color" { channel="hue:0210:00XXXXXXX356f:1:color" }
    Dimmer WZ_Decke_Temp "Temperature" { channel="hue:0210:0XXXXXXX6f:1:color_temperature"}

    Switch WZ_Laterne_Toggle "Switch" (Alle_Lampen, Wohn_Esszimmer_Switch) { channel="hue:0210:0XXXXXXX6f:3:color" }
    Color WZ_Laterne_Color "Color" { channel="hue:021XXXXXXX6f:3:color" }
    Dimmer WZ_Laterne_Temp "Temperature" { channel="hue:0210:00XXXXXXX6f:3:color_temperature"}

    Switch Kuechentheke_1_Toggle "Switch" (Alle_Lampen, Wohn_Esszimmer_Switch) { channel="hue:0220:00XXXXXXXf:9:brightness"}
    Dimmer Kuechentheke_1_Dimmer "Brightness" { channel="hue:0220:00XXXXXXX6f:9:brightness"}
    Dimmer Kuechentheke_1_Temp "Temperature" { channel="hue:0220:XXXXXXX6f:9:color_temperature"}

    Switch Esstisch_1_Toggle "Switch" (Esstisch_Switch, Alle_Lampen, Wohn_Esszimmer_Switch) { channel="hue:0220:00XXXXXXX6f:7:brightness"}
    Dimmer Esstisch_1_Dimmer "Brightness" (Esstisch_Dimmer) { channel="hue:0220:0XXXXXXX6f:7:brightness"}
    Dimmer Esstisch_1_Temp "Temperature" (Esstisch_Temp) { channel="hue:0220:00XXXXXXX6f:7:color_temperature"}
    Switch Esstisch_2_Toggle "Switch" (Esstisch_Switch, Alle_Lampen, Wohn_Esszimmer_Switch) { channel="hue:0220:0XXXXXXX6f:6:brightness"}
    Dimmer Esstisch_2_Dimmer "Brightness" (Esstisch_Dimmer) { channel="hue:0220:0XXXXXXX6f:6:brightness"}
    Dimmer Esstisch_2_Temp "Temperature" (Esstisch_Temp) { channel="hue:0220:00XXXXXXX6f:6:color_temperature"}
    Switch Esstisch_3_Toggle "Switch" (Esstisch_Switch, Alle_Lampen, Wohn_Esszimmer_Switch) { channel="hue:0220:00XXXXXXX6f:8:brightness"}
    Dimmer Esstisch_3_Dimmer "Brightness" (Esstisch_Dimmer) { channel="hue:0220:00XXXXXXX6f:8:brightness"}
    Dimmer Esstisch_3_Temp "Temperature" (Esstisch_Temp) { channel="hue:0220:00XXXXXXX6f:8:color_temperature"}

    Switch Test1 "Test1"

    Number Wohnzimmer_Szenen "Wohnzimmer Szenen"

Thanks!

1 Like

Ok, after another testing, I found out, that if I use the Wohn_Esszimmer_Switch.postUpdate(ON) not on the group of lights, but on every single light, the update works.
But this makes the rule with sendCommands and sendUpdates for every light very big.
Is it not possible to update the group at once?
Or is there a command, that the light switches updates them self?

You can do sendCommand on a group and it will send a command to the group items BUT you can’t do postUpdate