daberne
(Björn)
February 23, 2017, 6:52pm
1
Hi guys,
as I’m fairly new to openhab I would like to ask you for some help.
I’ve setup a groupswitch which should be on when any device in the group is on (1 up to all). But its always displayed as offline in the sitemap.
I already found out that the groupswitch is messed up if one item is in multiple groups. Does that sound right?
item:
Sitemap:
Group item=gDeviceOn label=“Gerät an”
Any help please?
rlkoshak
(Rich Koshak)
February 24, 2017, 5:02pm
2
I’ve never tried to create a Group (or any Item for that matter)through PaperUI so I don’t know if there is something weird going on with that.
Have you tried “Any ON → ON else OFF” (I’m guessing what the function is named).
Try putting it on your sitempa as Test item=gDeviceOn label="Gerät an [%s]"
and see it you can see the proper state that way.
That shouldn’t be a problem but I’ve never tried to create Items or Groups in this way so don’t know if there are any limitations.
lopez1de
(Markus Gehlhaar)
February 24, 2017, 5:39pm
3
Don’t get confused with Item Group and Sitemap Group. This are two completely different things. Item Group will group items logically. Sitemap Groups will just group them for displaying purposes.
But this will not solve your problem. I just saying this in case you didn’t know.
I’m in trouble with Group:Switch also. I already opened an issue.
opened 07:48AM - 22 Feb 17 UTC
closed 02:00PM - 04 May 17 UTC
bug
Core
With OH2 GA (might also occur with other versions) I do face an issue with Group… :Switch:OR going to "UNDEF" instead of ON or OFF.
I do own some motion sensors (Homematic HM-Sen-MDIR-O-2) and "itemized" them as follows:
```
Group:Switch:OR(ON,OFF) gMotion "Motion detected"
Switch M1 "Motion Sensor #1" <motion> (gMotion) { channel="homematic:..." }
Switch M2 "Motion Sensor #2 " <motion> (gMotion) { channel="homematic:..." }
```
However, the group's state only is ON or OFF if both sensors have the same state. If their state's differ, the group reports itself as UNDEF.
On motion, the event.log prints
```
[GroupItemStateChangedEvent] - gMotion changed from OFF to UNDEF through M1
[ItemStateChangedEvent ] - M1 changed from OFF to ON
```
later:
```
[ItemStateChangedEvent ] - M1 changed from ON to OFF
[GroupItemStateChangedEvent] - gMotion changed from UNDEF to OFF through M1
Source of Issue (issue reported by m0wlheldChristoph Dahlen):
https://community.openhab.org/t/issue-with-group-switch-or-going-to-undef/21403
```
My findings:
If all switches are OFF, the group is OFF
If only one or several are ON, then the group is UNDEF
If all are ON, the group is ON
###################
I checked another group of 30 switches. All have changed from NULL to OFF after starting OH. The group then switches from NULL to OFF too, when the last item of the group switches to OFF.
`gStickyUnreach changed from NULL to OFF through Win_Kind1_StickyUnreach`
So far so good.
But when I change one switch to ON, the group goes UNDEF for some reason.
```
2017-02-18 11:34:46.020 [ItemStateChangedEvent ] - Heiz_WohnZ_StickyUnreach changed from OFF to ON
2017-02-18 11:34:46.023 [GroupItemStateChangedEvent] - gStickyUnreach changed from OFF to UNDEF through Heiz_WohnZ_StickyUnreach
```
daberne
(Björn)
February 24, 2017, 9:32pm
4
Hi Rich, hi Markus,
thank you for the reply and your help.
to be honest it also seems like a bug to me. I’m trying to set the basic things up with the paperUI but I get more and more clues that I cannot do most things with paperUI without running into some bugs…
It doesn’t matter what I change the group rule to, it seems to always be “undefined” if its items are mixed (on and off both available).
From the paperUI it should be the rule “All OFF -> OFF else ON” if I want to have the group ON when any device is on, correct?
daberne
(Björn)
February 25, 2017, 5:49pm
5
I got some news:
To me it seems to be related to the creation with paperUI. When I create the group in the config file it works fine. To bad Maybe that issue gets fixed together with your Markus.
rlkoshak
(Rich Koshak)
February 26, 2017, 9:28pm
6
Correct. “Any ON -> ON else OFF” should also work.