How to find the correct wording for the needed control/ element ( or whatever wording should be used in this context), for example a list from which an element could be selected.
How to dynamically fill such list (with items).
I was struggling to find this one as well, Yannick to the rescue! You have to do it via an action, specifically the “options” action. I used a label card and linked the label and action to the same item. The options are pulled automatically from commandDescription metadata or can be provided in the widget properties.
I’m having an item with state ‘9999,32 Wh’ and want to output it on a label card to ‘9,99 kWh’ - so converting using units of measurement and formating the number.
I’ve had no success using as expression ‘=format("%,.02f kWh", item.state)’
I’m not positive on this but I think there is both a .displayState and a .state on the item. I would expect that you can define displayState either from the item label or the state description metadata. I’ve not played with that though. so I could be easy off.
As for the rest i think I need to suggest and get this out some. But over all your version of the chromecast widget looks exactly like what I was going for. I agree that in the beginners tutorial we want to stick as much as possible to what can be done without editing the code by hand. More to follow after I play with it a bit…
Not much to add besides @RGroll has already said here.
Yes it’s an object but it can have either only state or both state and displayState, depending on whether you have a pattern/transformation applied or not.
To be on the safe side in your expressions you can use this syntax:
=items.MyItem.displayState || items.MyItem.state
It will use displayState and fall back to state if it’s not truthy.
These are all the CSS variables that you have in Framework7, some at the root level, some for a particular component, you can also override them or reference them in CSS like so:
--f7-text-color: red // override
color: var( --f7-text-color) // reference
This illustrates quite nicely how to make “Flexbox” layouts in CSS:
Or http://materialdesignicons.com since that’s the library used by home assistant it gets regular home automation related updates. What would be cool is to be able to reference them in f7-icons. That remains to be seen.
I like the fork you linked! It’s a drop-in replacement, no need to bother doing some automated stuff to keep it current, the latest release will go into OH3.0. https://github.com/openhab/openhab-webui/pull/604
Do you mean you want to type in the configuration of the widget such formula?
I don’t think it is possible to use formula outside the yaml.
I don’t know any possible combination of your widget you are planning but a solution could be to include 4 variable in the prop, for instance:
prop:
text1,item1,text2,item2
in the yaml: text = prop.text1 + [prop.item1].state + …
Not sure for the syntax, I have not checked … let’s try
Regards
Lorenzo
Yes, instead of defining items as props, i wanted to ask for the expression itself in the widget config. You’re right its not working. But it works in config of standard widgets like oh-label-cell.
The only alternate is to define seperate items in props and then use those in the yaml
Thanks for trying to break it down into smaller chunks to understand, however when I try to recreate it, it fails to work. Here is the code after I paste it all back together, done in the widget editor. Any tips why a simple paste together fails to give a working widget?