Widget for rollershutters in semantic model

Hi all.

I have some rollershutter items tagged as [“Blinds”] such that they show up as blinds in the semantic model:

However, there are currently two limitations.

First, the default control widget is the basic up/down widget that you see. Is there a way to replace this by a slider? I would actually find that a much better default anyway because it allows one to observe the current position.

Second, the shutter position is currently shown as an extra item. Is there no compound control (yet) that combines the two? I am still using knXpresso on the side, which has some rather intuitive widget for this:

You cannot replace the default, but you can replace the widget. That’s what the “Default List Item Widget” is for. Since you have more than one, I’d recommend creating a custom widget under Developer Tools and then you can choose that custom widget when you configure the Default List Item Widget.

Not by default. There is a one-Item-one-widget by default. However, you can reference and represent as many Items as you want in a single widget. For example the following widget shows the current temperature, has a slider to change the thermostat setpoint, and a button that can change the HVAC mode between heating, cooling, and off.

And a quick search shows someone has already published a standalone widget for this: Custom rollershutter widget with preset configuration. You might be able to take inspiration from that.

Thanks a lot! Is there a way to set the Default List Item Widget in the Item syntax? Or does this need to be done through the UI as defined here?

You can do it. It’s just Item metadata. But frankly, my opinion is if you are going to use the semantic model at all, you are far better off using managed Items instead of .items files. Any perceived advantages from using .items files get blown away by the way the Item metadata will explode the Item definition itself and time wasted hunting down how to do things and fixing syntax errors.

For the most part you’ll have to define it in MainUI anyway, look at the code tab and then translate that YAML syntax to Item metadata syntax.

Because Item metadata is stored separately from the Item I think you can keep the .items files and use the UI to define the metadata, but that is not guaranteed to work forever (there is some effort to have metadata automatically clean up when Items are deleted but every time a .items file is loaded, all those Items are deleted and recreated so you’d lose all that metadata). And if you change the name of your Item that metadata will not automatically follow and you’ll need to manually edit the JSONDB or redefine the metadata for the new Item (there really is no such thing as changing an Item’s name, there is just deleting the old Item and creating a new one with a different name).

Custom MainUI Widgets (i.e. those created through Developer Tools → UI Widgets) can only be defined through the UI.

Thanks for the advice. So if I understand you right then when I am seeking to use the semantic model I should stop using .item files altogether and just define the items through the UI, too?

That’s my recommendation.

You can import what you have so far using Settings → Items → + → Add items from textual definition and going forward the easiest way to create Items situated in the semantic model is to use “add equipment to model” from Settings → Things → Your Thing → Channels or from Settings → Model → Create Equipment from Thing.

1 Like

I will try that, thanks!