Parsing through the model in a widget,

Hi guys,

is there a way I can parse the model in my widgets?

e.g. I have hundreds of temperature items that shall get a “Default Standalone widget”.

It would be great if I didn’t have to configure each widget separately but instead use the value of the item the widget belongs to.

Even more ellaborate I would like to create widgets for equipment that takes the values of the respective point instead of having to configure for each equipment the items separately.

You can use the oh-repeater within your widget, but you need to have a consistent semantic model.
For example, check the main_widget project…

Thanks @hmerk I will have a look at this.
I was not aware of this yet.

There are more widget to be used in combination with that. To use the project, you need them all.
Documentation is still missing, but will hopefully come soon.

Hallo @hmerk having a quick look at the project - great idea by the way - seems to point that the second problem seems to be solved. I can parse through all items of an equipment and even have a great filtering for item types - e.g. seen in Light Card widget

But also here I have to configure the groupItem as the root for the oh-repeater.

What I’m also looking for is a way to get this “groupItem” automatically by a reference to the Item or equipment the widget is linked too.

Can I get this reference somehow?

E.g. in above picture I would like to get the reference to the item HeizungErker_ActualTemperature.

Yes and No :wink:

Within the FloorsAndRooms, there is a repeater function to find all light equipment groups and pass them to the LightCard.

Also by pure chance I found the answer to the other question in this post of @JustinG

The trick is to name the item “item” in the parameters list. Then is will automatically take the item the widget is attached to via Metadata.

1 Like