That is the obvious solution to what I want to achieve. I just didn’t think of it because I tried to transfer your other tip (title colors) to this question, which wasn’t a good idea of mine. That just proves your first point that I should try to “understand what I do and how everything works together”
However, I think by now I achieved most of what I wanted in the area of UI; thanks to your great help!
My next topics are:
graphs (which I managed quite well so far),
the integration of Fritz-Phone-book. I’ll need to find a way to transform an expression like this ({“localNumber”:“4xxxxxxx34”,“remoteNumber”:“017xxxxx0”,“date”:“2021-03-25T09:01:00+01”,“type”:1,“duration”:3},) into a readable table. And it’d be nice to get the phonebook- caller name (might be a challenge because the thread TR-064 Thing Action phonebookLookup not working - #38 by cweitkamp confused me a little; but maybe I’ll understand it better when:
get more familiar with the OH-rules. At the moment I’m exporting things to node-red, work there and export the results back into OH. Probably not very efficient …
and by then maybe my ordered zzh (zigbee-adapter) might get delivered (it’s stuck at customs thanks to Brexit …) which will enable me to implement a few ideas …
Is it possible to us an expression to change the background colour based on an item state?
I tried this YAML code I know how to do, but it didn’t work
’ =(items.XXX.state == “ON”) ? “colour 1”: “colour 2” ’
And it is possible to use both colour AND image, then make the image transparent?
I’m trying to colourise a jpeg image with a conditional colour.
setting opacity: 50% will make the entire page transparent.
style:
background: center / cover no-repeat url("https://marmotamaps.com/de/fx/wallpaper/download/faszinationen/Marmotamaps_Wallpaper_Inntal_Desktop_1920x1080.jpg")
background-color: red
background-opacity: 50%
No. Still doesn’t work. Maybe something to do with the Page not accepting an expression?
I am trying to put this in the config of the page. I know I have it in the right place, because if I just choose a static colour without an expression it works.
add a space character before : (should work without also, but anyway…)
just for testing purpose, replace with this line: '=("1" == "1") ? "red" : "blue"'
background should now be red
and with this line: '=("1" == "2") ? "red" : "blue"'
should now be blue
i don´t think this is currently possible! See a post i had about a similar request. I have added a feature request, would be great if you comment in this feature request as well. THe more people want it, the better this is for priority for the great developers.
config:
label: Audio
style:
background: center / cover no-repeat url(IkeaSYMFONISKSpeakerZonePlayer_CurrentAlbumCoverArtURL.state)
The state in this item is http://10.0.0.32:1400/getaa?s=1&u=x-sonos-spotify%3aspotify%253atrack%253a2fXKyAyPrEa24c6PJyqznF%3fsid%3d9%26flags%3d8224%26sn%3d2
And this works if I paste this url directly in to the background url field.
Thanks. This works as an expression and does give me the correct string now.
But it won’t work in the config of a page. So same problem as before for using it as a background.
Just following up on a question that got lost in the flurry of the last issue.
Is it possible to use both colour AND image, then make the top layer transparent?
I’d like to colourise a jpeg image with a colour or gradient (and in the future, make these colours conditional when OpenHab allows).
setting opacity: 50% will make the entire page transparent.
Using rgba for the colour might be a clue to get transparancy, but no image shows underneath with anything I have tried.
Something like this??
style:
background-image: center / cover no-repeat url("https://marmotamaps.com/de/fx/wallpaper/download/faszinationen/Marmotamaps_Wallpaper_Inntal_Desktop_1920x1080.jpg")
background-color: red
background-opacity: 50%
I think we`re still talking about page-settings here?!
If the top-layer is the background-color, yes - you-can set it’s transparency with the use of linear-gradient rgba-values. This does not work the other way around for pages as you can’t use the workaround with css selectors on a page-level (which is mandatory here).
But I don’t think this matters for you as both variants lead to the same look (in this case).
It might be worth having a closer look at the css background-property - you can’t combine background-image with parameters like center (background-position), cover (background-size) or no-repeat (background-repeat).
Excellent! Thank you.
OpenHab is like the DaVinci code. Except actually hard to figure out.
While I have you, how do you change the colour and formatting of text in Title fields?
Again, I’m trying to style pages, so I sometimes need to change my text to white to work on dark backgrounds (and visa versa), and probably to override light and dark theme changes.
Although I’d like to know how to format all text items, I specifically want to know how to colour oh-block Titles
place the cursor to the correct position where you would add another config property and press ctrl-space. you get a dropdown menu where you find the required value.
in most cases it is either
color
fontColor
textColor