dniklas1
(Daniel)
December 31, 2023, 1:25pm
1
Hi,
i’ve not yet finished the migration from openHAB 2 to openHAB 4. In openHAB 2 i used the state of rollershutter items in the label, e.g:
Rollershutter Shutter_gf_living_west "Wohnen rechts [%d %%]"
How can i achieve that with mainUI in openHAB4?
This does not work:
label: Rolllade Mitte [%d %%]
type: Rollershutter
category: rollershutter
groupNames:
- rollershutterWohnzimmer
groupType: None
function: null
tags:
- Control
Best regards
Daniel
Matze0211
(Matthias)
December 31, 2023, 1:28pm
2
Statedescription metadata is what you are looking for
dniklas1
(Daniel)
December 31, 2023, 1:39pm
3
Thanks for your answer. I tried it this way:
But no percentage value is shown:
Can you provide some more details?
hmerk
(Hans-Jörg Merk)
December 31, 2023, 1:55pm
4
Isn‘t this the sitemap you are showing?
You then have to add this to your Sitemap definition and not directly to the Item.
dniklas1
(Daniel)
December 31, 2023, 1:59pm
5
no, this is mainUI from the locations tab.
Lolodomo
(Lolodomo)
December 31, 2023, 2:00pm
6
For sitemap: if no label defined on sitemap element then will use the label set on item
JensHauser
(Jens Hauser)
December 31, 2023, 2:04pm
7
A specific label could be written like this in the label card fields “label” or “header” or “footer”
=items.E3DC_HOME_Power_AvgInKW.state+" (im 5min ⌀)"
Just take your specific item with “.state” or “rawState” or “numericState”
dniklas1
(Daniel)
December 31, 2023, 2:19pm
8
In BasicUI in openHAB 2 it looks like this:
I want to achieve this in the auto generated equipment-view: overview → locations → “room”
JensHauser
(Jens Hauser)
December 31, 2023, 2:28pm
9
Like this?
When you´re editing a new page, this Rollershutter item will appear automatically then
overview page
hmerk
(Hans-Jörg Merk)
December 31, 2023, 2:35pm
10
AFAIK, this is not possible. The default widget does not include the state.
hmerk
(Hans-Jörg Merk)
December 31, 2023, 2:36pm
11
Not what op is asking for. He wants the state added to the controls.
Matze0211
(Matthias)
December 31, 2023, 4:27pm
12
It would be %d %% or %.0f %% for the state description, without the
However, as the others already mentioned: state description is only the first part, the second part is a widget that will use the state description to actually display the state.
The roller shutters control widget will never display any state by design. You would need to use another widget, like a label card to display the state within main UI.
dniklas1
(Daniel)
January 1, 2024, 12:30pm
13
ok, thanks for your answers. Perhaps this is an hint to use manually created pages and don’t use the autogenerated views.
What do you mean: is this possibly the right approach? I like the overview-cards with the images and the state information like temperature etc.
Matze0211
(Matthias)
January 1, 2024, 12:54pm
14
The auto generated views are a good fit for a lot of used, but of course custom pages are more precise to personal needs.
You can also look into the default widget metadata. By this you can continue with auto generated pages, but also adjust the widget to your needs