OH2 Not Loading my Lights Items

Was running a two year old OH2 build on a windows 7 machine that a month or two back stopped controlling my Hue lights out of the blue. I recently moved and started resetting up the smart home and decided I would update to see if a new version helped.

I just finished installing the most recent stable build and copying over my rules, items and sitemaps but I am still having the same issue. I did a fresh install choosing not to update hoping to avoid transferring the issue over unfortunately that did not help. I do have the Hue binding installed as well as the Wemo and Network binding. Both the Wemo Plugs and Network devices bound in my plugs.items and users.items files work as expected but none of my lights in the lights.items are showing up in PaperUI’s Items section and do not work in my Basic UI sitemap.

I will admit I half use PaperUI in that I used it to add all things then I copy the Thing ID’s to make my item files, rules and sitemaps but this worked before and works in all other situations except seemingly lights. I will post my lights.item and plugs.items so you can see what I have working and what is not. I’m hoping its something small but it may be a bug but I have no clue how it started happening out of the blue on an old unchanged build before updating. Do bindings possibly auto update? I wouldn’t be so confused if it only happened after I updated or if the binding auto updated!

lights.items

//Groups

Group:Switch:OR(ON,OFF) All_Lights "All Lights Group" ["Lighting"]
Group:Switch:OR(ON,OFF) Bedroom_Lights "Bedroom Lights Group" <hue_ambiance> (All_Lights) {autoupdate="false"} ["Lighting"]
Group:Color Bedroom_Ceiling_Lights "Bedroom Overhead Lights Group" <hue_ambiance> (Bedroom_Lights) {autoupdate="false"} ["Lighting"]
 
//Hue White Bulbs
Dimmer Hue_Bedside_Light "Bedside Light" <hue_ambiance> (Bedroom_Lights) ["Lighting"] { channel="hue:0220:00178825acf3:13:brightness", autoupdate="false" }
 
//Hue Color Ambiance Bulbs 
Color Hue_Bedroom_Ceiling_Left_Light "Living Room Left Light" <hue_color> (Bedroom_Ceiling_Lights) ["Lighting"] { channel="hue:0210:00178825acf3:1:color", autoupdate="false" }   
Color Hue_Bedroom_Ceiling_Light "Living Room Right Light" <hue_color> (Bedroom_Ceiling_Lights) ["Lighting"] { channel="hue:0210:00178825acf3:9:color", autoupdate="false" }

//Hue Lightstrips
Color Hue_Desk_Lightstrip "Desk Lightstrip" <hue_color> (Bedroom_Lights) ["Lighting"] { channel="hue:0210:00178825acf3:11:color", autoupdate="false" }

plugs.items

Number Enail_Timer "Minutes Before Auto-Off:  [%.0f]"

Switch Wemo_Enail_Plug "E-nail Plug" <enail> ["Outlet"] { channel="wemo:socket:Socket-1_0-221710K010472B:state" }

Switch Wemo_Arcade_Plug "Arcade Plug" <poweroutlet_us> ["Outlet"] { channel="wemo:socket:Socket-1_0-22A8B1K0108FDA:state" }

Hi @Dracrius,

Your code is hard to read. Please use code fences (</>) instead of blockquotes. :wink:

At a quick glance, the first thing I notice is that your ceiling lights are in a group called Bedroom_Overhead_Lights, but your group is defined as Bedroom_Ceiling_Lights.

What does your log show when you save lights.items? If there are errors, it’ll tell you exactly where they are.

If there are no errors, try commenting out all of the items and putting in a single unbound item to see if that loads. If that works, uncomment one of your lights to see if that loads.

Apologies it kept breaking my code blocks at first since it wanted a line break before a code block but a blockquote didn’t so I just used what worked as I tried to get it up before I left the house.

Changing the one group name mismatch did not change anything though I’m not sure if you really expected it. That was just a mismatch from my own name changes organizing earlier today. I updated the code block to reflect it though thank you.

So what’s in your log, and what happens when you reduce the file to a single item?

Well the log say

2020-04-30 14:40:47.384 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'lights.items' has errors, therefore ignoring it: [7,112]: missing EOF at '['

Any idea what EOF means?

EOF means End of File.

This is why it’s always a good idea to check your logs when saving files. It’s telling you that you opened a square bracket on line 7, column 112, and then you never closed it.

Since line 7 in the code you posted is a comment, I’m guessing that you haven’t copied in the exact contents of lights.items. Look at your 7th line and you should be able to find the missing bracket.

hmmm I do not see it that is this line

Group:Switch:OR(ON,OFF) Bedroom_Lights "Bedroom Lights Group" <hue_ambiance> (All_Lights) {autoupdate="false"} ["Lighting"]

and here is my exact version with my commented out unused lights

//Groups

Group:Switch:OR(ON,OFF) All_Lights "All Lights Group" ["Lighting"]

//Group:Switch:OR(ON,OFF) Hallway_Lights "Hallway Lights Group" <hue_white> (All_Lights) ["Lighting"]
//Group:Switch:OR(ON,OFF) Living_Room_Lights "Living Room Lights Group" <hue_color> (All_Lights) {autoupdate="false"} ["Lighting"]
Group:Switch:OR(ON,OFF) Bedroom_Lights "Bedroom Lights Group" <hue_ambiance> (All_Lights) {autoupdate="false"} ["Lighting"]
Group:Color Bedroom_Ceiling_Lights "Bedroom Overhead Lights Group" <hue_ambiance> (Bedroom_Lights) {autoupdate="false"} ["Lighting"]
//Group:Switch:OR(ON,OFF) Office_Lights "Office Lights Group" <hue_ambiance> (All_Lights) {autoupdate="false"} ["Lighting"]

//Hue White Bulbs
/*
Dimmer Hue_Front_Door_Light "Front Door Light" <hue_white> (Hallway_Lights) { channel="hue:0100:00178825acf3:4:brightness", autoupdate="false" }

Dimmer Hue_Hallway_Bulb_1 "Hallway Bulb 1" <hue_white> (Hallway_Lights) { channel="hue:0100:00178825acf3:5:brightness", autoupdate="false" }
Dimmer Hue_Hallway_Bulb_2 "Hallway Bulb 2" <hue_white> (Hallway_Lights) { channel="hue:0100:00178825acf3:6:brightness", autoupdate="false" }
Dimmer Hue_Hallway_Bulb_3 "Hallway Bulb 3" <hue_white> (Hallway_Lights) { channel="hue:0100:00178825acf3:7:brightness", autoupdate="false" }
Dimmer Hue_Hallway_Bulb_4 "Hallway Bulb 4" <hue_white> (Hallway_Lights) { channel="hue:0100:00178825acf3:8:brightness", autoupdate="false" }

Dimmer Hue_Guest_Side_Overhead_Light "Guest Side Overhead Light" <hue_white> (Bedroom_Overhead_Lights) ["Lighting"] { channel="hue:0100:00178825acf3:14:brightness", autoupdate="false" }
*/

//Hue White Ambiance Bulbs

Dimmer Hue_Bedside_Light "Bedside Light" <hue_ambiance> (Bedroom_Lights) ["Lighting"] { channel="hue:0220:00178825acf3:13:brightness", autoupdate="false" }

//Dimmer Hue_Desk_Overhead_Light "Desk Overhead Light" <hue_ambiance> (Bedroom_Overhead_Lights) ["Lighting"] { channel="hue:0220:00178825acf3:12:brightness", autoupdate="false" }

//Hue Color Ambiance Bulbs

Color Hue_Bedroom_Ceiling_Left_Light "Living Room Left Light" <hue_color> (Bedroom_Ceiling_Lights) ["Lighting"] { channel="hue:0210:00178825acf3:1:color", autoupdate="false" }

Color Hue_Bedroom_Ceiling_Light "Living Room Right Light" <hue_color> (Bedroom_Ceiling_Lights) ["Lighting"] { channel="hue:0210:00178825acf3:9:color", autoupdate="false" }

//Hue Lightstrips

Color Hue_Desk_Lightstrip "Desk Lightstrip" <hue_color> (Bedroom_Lights) ["Lighting"] { channel="hue:0210:00178825acf3:11:color", autoupdate="false" }

Why would it think it is unclosed?

Nothing jumps out at me. Try commenting out that group to see what happens.

Bottom line is that there’s an error somewhere in this file. The easiest way to find it is to remove the items and then add them back in until you find it.

More “unexpected”, perhaps.

Items file definitions are sensitive to the order of elements that you include.
Any [tags] must be placed before any {bindings} in the line.

Fields must be entered in the order shown

1 Like

Right, I totally forgot about that since I’ve moved to using metadata for Google Assistant.

Yes but the Tag in question is on a group which would not normally be followed by a binding. Do I just add the matching binding or can you not Tag a group?

{autoupdate="false"} ["Lighting"]

Whether or not it’s attached to a binding, {autoupdate="false"} is still binding config, and still needs to come after your tags.

I missed that since I switched to using metadata in binding config for Google Assistant.

2 Likes

I think if you just put the fields in the order that the docs say you must put them in, it will work. I can’t think of any reason why you’d need to put them in a different order.

Na my apologies I was not catching my own {autoupdate="false"} I did not realize or clue in that it counted as a binding so I had no clue that was the part I had to move in front of until @rpwong mentioned it. It was a very long time ago when I added that part to solve wrong status reports for hue lights and I had completely forgotten it was a binding field. Very strange that my old build had a problem out of the blue though this items files has been like that for at least 2 years.

Thanks for the help!

Also side question what do you mean by

I switched to using metadata in binding config for Google Assistant.

I have not gotten around to it but do plan to integrate my OpenHAB with my Google Home/ Assistant. I had maintained these Tags assuming they would be useful for exactly that. Is there another method I need to use for Google Assistant to recognize them? I see no setting in the bindings I am using but as of right now technically my assistant has direct access to my hue lights but I plan on adding many Mqtt items that I wanted to expose to Google Assistant in the next few days.

Tags still work, but metadata replaced them as the preferred method earlier this year, and the OH developers have expanded what kind of devices you can use.

If I recall correctly, you can have both tags and metadata in an item. If metadata exists, the Google Assistant action will ignore the tag. So if you want an item to work with both Hue and GA, you’ll need:

["Lighting"] {channel="", autoupdate="false", ga="Light"}

I don’t think you can use groups in Google Assistant at this time (aside from the special group item for thermostats). So if you want to control a group of switches, you’ll need a proxy item that you can expose to Google.

1 Like