Reusing widgets such as sliders


Is it possible to reuse widgets like the slider/coloritem etc in the app and bind them to the light’s corresponding states? If so, what would be the best way to approach this?

Any help is appreciated. Thank you

Welcome to the openHAB Forum!

Are you talking about the slider and colorpicker as discribed here? If yes, just put them on a sitemap.

Thank you. Sorry for the incredibly late reply. What I’m trying to do is create a new page where the last changed item is displayed. I was wondering how I could go about, displaying the required widgets (slider etc.) on this new page


Text label="click here" {
   Text label="This is a new page"
   Slider item=myItem

I think you need to give a bit more detail about this part.

If I understand correctly you want to dynamically display the item which was changed at last.
I don’t THINK you can do that. What you could do is display the name of the last changed item.
That would require to have all actual items in a group, create a new text item an update this items using a rule which is triggered on the changed Event of the group with the Name of ther triggeringItem.

If you had the name of last-changed in a string Item, you could build a sitemap list of all the possible candidates and control each one with visibility

Slider item=Dimmer98 visibility=[myLastItem=="Dimmer98"]
Slider item=Dimmer99 visibility=[myLastItem=="Dimmer99"]
1 Like

Great idea, lots of sitemap coding, but still fitting. If that is what the OP wanted.

I’m trying to extend the OpenHab app to display some additional functionality (from a seperate project). For this purpose, I’ve created a new page that displays recently recognized activities (please see the attached screenshot). It is still in its early stages. The sample text under the date/time shows the name, state and label of the lights that were set according to the recognition.

For the latest recognition, I would like to display the widgets for the relevant lights. for eg. a color picker widget for iris1 and go1 which is set to green (as it would appear in the main menu). The widget shown here must function exactly like the one in the main menu, i.e. changing the value from this recognitions page should automatically change it in the main menu page as well.

Is it possible to generate these widgets as standalone objects based on the label id?

I think you’re asking if you can have the widget without the text, icon etc?
Not in a sitemap driven UI.
See HABpanel which I would expect to be able to do that.

You will have to resolve your conflict about whether you want this widget to display the state at the time of the record or the current actual state.