Metadata "options" -> oh-repeater

The only way I know of to accomplish this is with a proxy item. In the PAGE yaml you can set the visibility of an entire custom widget.

config:
  layoutType: responsive
blocks: []
masonry:
  - component: oh-masonry
    slots:
      default:
        - component: widget:widget_sonos
          config:
            visibility: '=items["ProxyItem"].state=="ON"'
grid: []

So if you use a proxy item that is toggled by the first widget (or if you already have some item that is keyed to the event that you want), then the visibility of the secondary widget will be dynamic.

Something Yannick wrote a while back (I don’t remember where) made me think that it might be possible to have a vars object in the page scope, but I’ve never managed to make it work and proxy items work just as well.

Thank you.

Hey @JustinG

I would want to feed a oh-repeater automatically from the semantic model and group/filter the items, whereas the grouping/filtering is the challenge I have.

Example for “Lights” based on “Point_Control_Switch” and “Property_Light”:

          - component: oh-repeater
            config:
              sourceType: itemsWithTags
              itemTags: Light,Switch
              for: item
              fragment: true
            slots:
              default:
                - component: oh-button
                  config:
                    class:
                      - padding-top-half
                      - display-flex
                      - flex-direction-column
                    icon-material: lightbulb
                    iconSize: 15
                    text: =loop.item.label
                    action: toggle
                    actionItem: =loop.item.name
                    actionCommand: ON
                    actionCommandAlt: OFF
                    fill: "=(items[loop.item.name].state === 'ON') ? true : false"
                    outline: true
                    style:
                      --f7-button-border-color: var(--f7-card-outline-border-color)
                      height: auto

This adds all lights to the repeater irrespective of its location.

I’d wish to group the lights based on location. e.g all light in groundfloor or all lights in a certain room.
I thought that I could just add the tag “GroundFloor” to “itemTags”. But this doesn’t work.

I can see there is “itemsInGroup” as well… maybe using “itemsInGroup” could be used an then filter with “itemTags” - but how to apply such a filter …

What would be the best way to group “Lights” by its location?

I have several groups in a hierarchy:
gLightsLiving
gLightsDining
gLightsKitchen

All the above are members of gLightsGroundfloor.

I hoped to avoid creating lots of manual group items, since the location information is already there by the semantic model in exactly that hirarchy.

But maybe I misunderstood something along the line…

I think it would make life a lot easier, if there was a way to combine “itemTags” with “location”.
Can this be done by expressions? How?

One way would be to automatically populate the tags of an item with the tags for its specific location hirarchy in which the item is residing in.

This direct capability doesn’t exist. There’s just too much complexity (layer’s of hierarchy between higher model locations and points) and variability in the semantic model to make this easy, and the repeater’s collection of objects via itemsInGroup or itemsWithTags depends on the data returned via the api which doesn’t have any semantic filtering.

You can either create your own groups as suggested by hmerk or, if your semantic model is consistent enough, stack repeaters together. If I were to do something like this I would start with one repeater that is a hard coded array of the rooms I’m interested in:

- component: oh-repeater
  config:
    for: room
    in:
      - name: loc_DiningRoom
      - name: loc_Kitchen
      - name: loc_LivingRoom

This isn’t too problematic from a maintenance standpoint because the physical structure of the house isn’t likely to change too often. Then inside this repeater a second repeater with sourceType: itemsInGroup and groupItem: =loop.room.name which then filters for the equipment tags you are interested in (Or the other way around: gets the source list by tags and then filters by group membership). This repeater then populates the widget items accessing the actual points via a consistent nomenclature (e.g., loop.childItem.name + '_Switch' or whatever your nomenclature is).

Thank you both @JustinG and @hmerk !
Will go with your suggestion to group the items reflecting their location hirarchy.

I am trying to modify your actionFeedback area to suit my needs. I try to make it stay active longer or show a button to close it. I can’t get any of it, do you know where I can find allowed parameters?