[SOLVED] Simple Group Switch light not working

Hey Guys,

I have a simple case to setup, but it is not working. I want 1 group switch to switch on 2 smart bulbs (Mi-Light). I can switch them on seperately, but not with a group switch for all lights.

** default.items
Group:Switch:OR(ON, OFF) AlleLampen “Alle lampies” [“Switchable”]

Switch WoonkamerLamp “WoonkamerLamp” (AlleLampen) [“Lighting”] {channel=“milight:rgbwwLed:F0FE6B3BD6A2:1:ledbrightness”} # Switch for all bulbs

Switch KeukenLamp “KeukenLamp” (AlleLampen) [“Lighting”] {channel=“milight:rgbwwLed:F0FE6B3BD6A2:2:ledbrightness”} # Switch for all bulbs

**default.sitemap
Frame label=“Alle lampen” {
Switch item=AlleLampen label=“Alle lampies” icon=“switch”
}

Now I can see the switch in my PaperUI, but when I switch it on, it immediatly turns off again. Does anyone have a good hint?

With kind regards!!

This seems like a behavior controlled by the binding. What do you see in events.log?

Are those comments in the original? I think .items file comments are //, not #. Maybe both are supported, I don’t know.

PaperUI is an administrators UI, and does not behave the same as e.g. Basic UI.
Clicking to turn a switch on only tries to change the state. It does not issue a command.

A Group’s state is derived from it’s member Items. It is not possible to update the state of a group directly.

A Group sent a command will pass it along to its member Items. It won’t affect the group state directly, but of course the member Items might change state in respnse to the command, and that will get reflected in the Group state.

The summary is, put your Group on a sitemap as a switch and view it with BasicUI and it will all behave more like you expect.

I always thought it did issue commands. The Control tab is even less useful than I thought.

Hi Rich, I replaced the # for // and I do see now that 1 error is gone now in the logs. Strangest thing is that I replaced the group item for a normal item and afterwards I undid this change putting back in the group item. Now I can turn it on and the switch stays on. These are the logs now:

==> /var/log/openhab2/events.log <==

2019-02-26 08:49:09.667 [ome.event.ItemCommandEvent] - Item ‘AlleLampen’ received command OFF

2019-02-26 08:49:09.687 [vent.ItemStateChangedEvent] - AlleLampen changed from ON to OFF

==> /var/log/openhab2/openhab.log <==

2019-02-26 08:49:10.820 [WARN ] [sitemap.internal.SitemapProviderImpl] - Filename default.sitemap does not match the name Steenuilie of the sitemap - please fix this as you might see unexpected behavior otherwise.

2019-02-26 08:49:14.581 [WARN ] [sitemap.internal.SitemapProviderImpl] - Filename default.sitemap does not match the name Steenuilie of the sitemap - please fix this as you might see unexpected behavior otherwise.

==> /var/log/openhab2/events.log <==

2019-02-26 08:49:15.923 [ome.event.ItemCommandEvent] - Item ‘AlleLampen’ received command ON

2019-02-26 08:49:15.936 [vent.ItemStateChangedEvent] - AlleLampen changed from OFF to ON

Hi Rossko, thanks for reaching out to help. Also thanks for clearing out to me to better use the BasicUI. I will… I don’t quite get where you want to go to with “put your Group on a sitemap as a switch”, I thought I allready had that?
Now I can switch the switch on without it falling back. But when I look into BasicUI I still can’t see that the members are turned on:

My confusion over your meaning here, perhaps.

If you can see the expected things happening in your events.log, then this is just a UI view refresh issue.

I’m not sure this will improve the refresh - but you better fix your sitemap. See this thread.

Hey Ross, I fixed the name. Also I will take a closer look when I will be at home later today to this group switch. Thanks so far!

Thanks Ross I allready figured it out. I only change the state of the switch. Then I have to work with rules to do something with the states.