Groups and sitemaps with visibility

Hello,

Just starting getting my sitemap and items in order started from the demo and everything is working great.

However I have the feeling I’m doing things double or not very efficient. Mostly two things I can’t seem to figure out.

I’m using groups inside the items file and they are awsome, so it’s very easy to generate a first floor, second floor with a number of hue devices for example.

The problem starts when I want to do something with one of those items inside the group.

As an example for hue lamps I can use a “colorpicker” item to change the color of the lamps but only make it visibile when a certain switch is on. This works great but not if that switch is part of a group… and I can’t define a colorpicker as part of the group inside the item file…

Now to work around this I’m just creatings static frames inside my sitemaps and listing each and every item individually and than the the visibility trick… but it feels very wrong… is there any better way?

The 2nd part is I guess also with the groups.

I have multiple groups inside my items file examples, "firstfloor_lights, secondfloor_lights, roomXlights etc…"
What I often want to do is reference one of those groups with a certain “except”

For example turn off the ground_floor lights, except for two lamps inside that group.

the way I work around it now is greating another group firstfloor_lights_except_blablabla but again it feels wrong…

Hopefully someone will say “you dumb …, you can do it this way!”

No, it’s the only way (I know of).

Unfortunately there is not better way for this part of your question either. However, you might consider some other scheme for organizing your Items into Groups which might provide opportunities to simplify. Perhaps if you grouped them by time of day or function rather than location it might simplify things.

Personally, it is so easy to create groups and assigned items to them and they make it really easy to simplify your rules so creating a bunch of groups is not a problem in my book.

Alternatively you can implement the “except” part in your rules.

I had a similar problem with my NEST thermostats. I had a nice example sitemap but I didn’t want it splayed out on my default sitemap. I wanted to hide it in a group, but if I used the items file to group all of the NEST items they couldn’t be changed from the sitemap group…

Instead I did this inspired by the demo sitemap:

Frame label="Heating and Air" {
  Text label="Nest Thermostats" icon="house" {
	  Frame label="Upstairs Thermostat" {
	    Text item=NestTStatUpstairs_ambient_temperature_f visibility=[NestTStatUpstairs_temperature_scale=="F"]
	    Text item=NestTStatUpstairs_ambient_temperature_c visibility=[NestTStatUpstairs_temperature_scale=="C"]
	    Text item=NestTStatUpstairs_humidity
	    Switch item=NestTStatUpstairs_hvac_mode mappings=[heat="Heat",cool="Cool","heat-cool"="Auto",off="Off"]
	    Text item=NestTStatUpstairs_away_temperature_low_f visibility=[home_away=="away",home_away=="auto-away"]
	    Text item=NestTStatUpstairs_away_temperature_high_f visibility=[home_away=="away",home_away=="auto-away"]
	    Setpoint item=NestTStatUpstairs_target_temperature_f label="Target Temperature [%.1f °F]" minValue=50 maxValue=80 step=1 visibility=[NestTStatUpstairs_hvac_mode=="heat",NestTStatUpstairs_hvac_mode=="cool"]
	    Setpoint item=NestTStatUpstairs_target_temperature_low_f label="Minimum Temperature [%.1f °F]" minValue=50 maxValue=80 step=1 visibility=[NestTStatUpstairs_hvac_mode=="heat-cool"]
	    Setpoint item=NestTStatUpstairs_target_temperature_high_f label="Maximum Temperature [%.1f °F]" minValue=50 maxValue=80 step=1 visibility=[NestTStatUpstairs_hvac_mode=="heat-cool"]
	    Text item=NestTStatUpstairs_last_connection
	  }
	  Frame label="Downstairs Thermostat" {
	    Text item=NestTStatDownstairs_ambient_temperature_f visibility=[NestTStatDownstairs_temperature_scale=="F"]
	    Text item=NestTStatDownstairs_ambient_temperature_c visibility=[NestTStatDownstairs_temperature_scale=="C"]
	    Text item=NestTStatDownstairs_humidity
	    Switch item=NestTStatDownstairs_hvac_mode mappings=[heat="Heat",cool="Cool","heat-cool"="Auto",off="Off"]
	    Text item=NestTStatDownstairs_away_temperature_low_f visibility=[home_away=="away",home_away=="auto-away"]
	    Text item=NestTStatDownstairs_away_temperature_high_f visibility=[home_away=="away",home_away=="auto-away"]
	    Setpoint item=NestTStatDownstairs_target_temperature_f label="Target Temperature [%.1f °F]" minValue=50 maxValue=80 step=1 visibility=[NestTStatDownstairs_hvac_mode=="heat",NestTStatDownstairs_hvac_mode=="cool"]
	    Setpoint item=NestTStatDownstairs_target_temperature_low_f label="Minimum Temperature [%.1f °F]" minValue=50 maxValue=80 step=1 visibility=[NestTStatDownstairs_hvac_mode=="heat-cool"]
	    Setpoint item=NestTStatDownstairs_target_temperature_high_f label="Maximum Temperature [%.1f °F]" minValue=50 maxValue=80 step=1 visibility=[NestTStatDownstairs_hvac_mode=="heat-cool"]
	    Text item=NestTStatDownstairs_last_connection
	  } 
  }  
  }

I nested the sitemap under a Text type. All you have to do is something like:

  Frame label="Hue Lights" {
    Text label="Hue Light Group" icon="house" {
    Frame label="Room 1 Hue lights" {
      _Put your individual item entries with color pickers here_
    }
       }
  }

From the sitemap it looks just like a group, but it relies on you formatting each light in the group with colorpicker and so on as you would a typical sitemap.