SOLVED Help please! Groups wont work - I have spent 4+ hours on this - It should be easy

I cant get groups to work at all, and maybe im doing something wrong… But I have invested a quite a bit of time so far. So if I could get some help that would be AWESOME! :slight_smile:

I cant even log the item names in glight group see below:

Item:

Switch Bedroom5Lights    "Mancave Light" <glight> ["Lighting"] {mqtt=">[broker:openhab/out/Bedroom5Lights/gpio/12:command:ON:1],>[broker:openhab/out/Bedroom5Lights/gpio/12:command:OFF:0],<[broker:openhab/in/Bedroom5Lights/Rstate:state:MAP(onoff.map)]"}

Rule:

// Scene Rules
        rule "Scene: Going to work"
                when
                Item SceneWork changed to ON
                then
                logInfo("JADE","JADEJADEJADDEJADEJADEJADE")
//              Bedroom5Lights.sendCommand(OFF)
                glight.members.forEach[ item|
                                        logInfo("TestRules", "Item: " + item.name)
                                        ]
                logInfo("JADE","111111111111111111111111111")
                createTimer(now.plusSeconds(2)) [|
                                        SceneWork.postUpdate(OFF)
                                                ]
                logInfo("JADE","ENDENDENDENDENDENDENDEND")

        end

==> /var/log/openhab2/openhab.log <==
2018-10-14 08:37:47.662 [INFO ] [.eclipse.smarthome.model.script.JADE] - JADEJADEJADDEJADEJADEJADE
2018-10-14 08:37:47.669 [INFO ] [.eclipse.smarthome.model.script.JADE] - 111111111111111111111111111
2018-10-14 08:37:47.683 [INFO ] [.eclipse.smarthome.model.script.JADE] - ENDENDENDENDENDENDENDEND
==> /var/log/openhab2/events.log <==
2018-10-14 08:37:49.680 [ItemStateChangedEvent     ] - SceneWork changed from ON to OFF

please use code fences when posting

you need to add the item to the group - add (glight) to your item declaration…

Sorry I tried to do that… and I think it striped the out :frowning:
This is the item dec

Switch Bedroom5Lights    "Mancave Light" <glight> ["Lighting"] {mqtt=">[broker:openhab/out/Bedroom5Lights/gpio/12:command:ON:1],>[broker:openhab/out/Bedroom5Lights/gpio/12:command:OFF:0],<[broker:openhab/in/Bedroom5Lights/Rstate:state:MAP(onoff.map)]"}

glight with () not <> as @mjcumming suggested. I also added a space in the lighting tag.

Switch Bedroom5Lights    "Mancave Light" (glight) [ "Lighting" ] {mqtt=">[broker:openhab/out/Bedroom5Lights/gpio/12:command:ON:1],>[broker:openhab/out/Bedroom5Lights/gpio/12:command:OFF:0],<[broker:openhab/in/Bedroom5Lights/Rstate:state:MAP(onoff.map)]"}

LOL… Im an idiot!

THANKS SO MUCH!!!

My next option was to hard code the s*** out of it. (and I didn’t want that because im still adding automation devices… and I wanted a ton of scenes!

Please mark as solved by clicking the square box on the post that provided the solution.

Thanks