[SOLVED] Implementing Groups In Items File

Hi all,

Up until now, I have had each item in its own .items file, but now I’m starting to get the system working I’m trying to tidy up everything starting with putting all items into single .items file.

I copied all items into the single file, and deleted the original individual files. All works fine.

Then I wanted to introduce groups, but as soon as I do this all items disappear from HABPanel. If I then comment out the group with a // and refresh HABPanel all items return.

Below is my items file as it stands (MQTT section edited for brevity)

Group gDownstairs “Downstairs Lights”

Switch Sonoff01 "Lamp [%s]" (gDownstairs) ["Lighting"] {mqtt....}
Switch Sonoff02 "Kitchen Counter [%s]" (gDownstairs) ["Lighting"] {mqtt....}
Switch Sonoff03 "Sonoff03 [%s]" {mqtt....}
Switch Shelly01 "Landing Lights [%s]" ["Lighting"] {mqtt....}
Switch Shelly02 "Shelly02 [%s]" {mqtt....}

I have also tried the following lines for the “group” configuration and all result in items becoming unavailable

Group:Switch:OR(ON, OFF) gDownstairs “Downstairs Lights [%d On]” [“Lighting”]
Group:Switch gDownstairs “Downstairs Lights [%d On]” [“Lighting”]
Group:Switch gDownstairs “Downstairs Lights” [“Lighting”]

Could someone advise where I am going wrong?

Thanks

Adam

can you please past some more lines of you items file. groups and first line of the itmes is enough.

Another question. What does the log say? Are all items still there or deleted?

Thanks for your reply. What I have posted above is my entire items file (all 5 of them!)

My logs show the following:

2019-02-03 18:29:42.864 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'Lighting.items'
2019-02-03 18:30:12.131 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'Lighting.items' has errors, therefore ignoring it: [1,19]: missing EOF at '“'

First line is when I save the items file with // comment against group, second line is when I remove the comments to make the group active.

I’ve sorted it.

Thanks to your post, it pointed me in the right direction.

I had copied the group syntax from an example online and it has used the wrong type of quotation marks. Changed these to the basic " in notepad and all is now working.

1 Like

You are using the tilted quotation marks, you should use the straight ones like "!

Edit: Someone was faster! :+1: