I’m slowly converting my sitemap to the new UI, which I mostly use on my phone.
Is there any way to remove the 3 dots that appear on a oh-label-cell when you define an action that navigates to another page?
I’m slowly converting my sitemap to the new UI, which I mostly use on my phone.
Is there any way to remove the 3 dots that appear on a oh-label-cell when you define an action that navigates to another page?
Could you please post your YAML config for those cells.
Just checked, what about adding
expandable: false
in the config section of the cell ?
How do you format the date? I try this, it doesn’t work
=items.Box_CO2_Update.state.format("%1$tH:%1$tM %1$td.%1$tm")
You can define the pattern directly in your item and then use
=items.Box_CO2_Update.displayState
Thanks! It works.
Taking this opportunity, I will ask, forgive that offtopic,
color change doesn’t work:
=Number.parseInt(items.Box_CO2.state)<800 ? "green" : Number.parseInt(items.Box_CO2.state)<1200 ? "orange" : "red"
When the page is refreshed, the widget is painted in the desired color and again painted in white.
component: oh-label-cell
config:
item: Box_CO2
footer: =items.Box_CO2_Update.displayState
color: '=Number.parseInt(items.Box_CO2.state)<800 ? "green" :
Number.parseInt(items.Box_CO2.state)<1200 ? "orange" : "red"'
icon: oh:carbondioxide
action: analyzer
actionAnalyzerItems:
- Box_CO2
title: Бокс
subtitle: '=Number.parseInt(items.Box_CO2.state < 800) ? "green" :
Number.parseInt(items.Box_CO2.state) < 1200 ? "orange" : "red"'
Also, if you use a Trend Line Item, you can’t change the color of the widget?
Thanks!
Try:
color: '=(Number.parseInt(items.Box_CO2.state)<800) ? "green" :
((Number.parseInt(items.Box_CO2.state)<1200) ? "orange" : "red")'
Thanks expandable: false
did the trick.
Here’s the config with the fix applied:
component: oh-label-cell
config:
expandable: false
headerBadge: '=((items.loungeHarmonyActivity.state != "PowerOff" ? 1 : 0) +
(items.bedroomSky.state == "ON" ? 1 : 0) + (items.kitchenSky.state == "ON" ?
1 : 0)).toString()'
title: Entertainment
subtitle: '=((items.loungeHarmonyActivity.state != "PowerOff" ? "Lounge" : "") +
(items.kitchenSky.state == "ON" ? (items.loungeHarmonyActivity.state !=
"PowerOff" ? " | Kitchen" : "Kitchen") : "") + (items.bedroomSky.state ==
"ON" ? (items.loungeHarmonyActivity.state != "PowerOff" ||
items.kitchenSky.state == "ON" ? " | Bedroom" : "Bedroom") : ""))'
icon: f7:tv
color: '=((items.loungeHarmonyActivity.state != "PowerOff" ? 1 : 0) +
(items.bedroomSky.state == "ON" ? 1 : 0) + (items.kitchenSky.state == "ON" ?
1 : 0)) > 0 ? "blue" : var(--f7-theme-color)'
label: '=(items.loungeHarmonyActivity.state != "PowerOff" ?
items.loungeHarmonyActivity.state : ((items.kitchenSky.state == "ON" ||
items.bedroomSky.state == "ON") ? "Sky" : " "))'
item: loungeHarmonyActivity
action: navigate
actionPage: page:page_4cd90cd5df
actionPageTransition: f7-circle
Does not work. I’ve done a lot of tests, it looks like if the item name contains an underscore then the color doesn’t work.
Red widget:
component: oh-label-cell
config:
item: RoomCO2
color: = "red"
slots: null
The widget does not change color:
component: oh-label-cell
config:
item: Room_CO2
color: = "red"
slots: null
color: = "red"
Why should it with that expression?
Remember if you’re running snapshot #2008 or later, you have a brand new expression tester in the developer sidebar (invoke it with Shift+Alt+D or from the developer tools menu), and then on the 3rd tab you can quickly test any expression you want.
To minimize the test.
The expression itself works, I printed the result with a subtitle:
yaml:
component: oh-label-cell
config:
item: Box_CO2
footer: =items.Box_CO2_Update.displayState
color: '=Number.parseInt(items.Box_CO2.state)<800 ? "green" :
Number.parseInt(items.Box_CO2.state)<1200 ? "orange" : "red"'
icon: oh:carbondioxide
action: analyzer
actionAnalyzerItems:
- Box_CO2
title: Бокс
subtitle: '=Number.parseInt(items.Box_CO2.state) < 800 ? "green" :
Number.parseInt(items.Box_CO2.state) < 1200 ? "orange" : "red"'
slots: null
If there is an underscore in the name of the item ( item: Box_CO2), then the color does not change.
If there is no underscore in the name of the item, then it works:
yaml:
component: oh-label-cell
config:
item: BoxCO2
footer: =items.Box_CO2_Update.displayState
color: '=Number.parseInt(items.Box_CO2.state)<800 ? "green" :
Number.parseInt(items.Box_CO2.state)<1200 ? "orange" : "red"'
icon: oh:carbondioxide
action: analyzer
actionAnalyzerItems:
- Box_CO2
title: Бокс
subtitle: '=Number.parseInt(items.Box_CO2.state) < 800 ? "green" :
Number.parseInt(items.Box_CO2.state) < 1200 ? "orange" : "red"'
slots: null
I see. If you want to always apply the color, the best is to add:
on: true
Otherwise it’ll try to colorize the cell based on the state of the item, i.e. “ON” or a HSB value with the brightness > 0.
It works, thanks!
You need to practice to understand this clearly.
(I have very bad English, translation is not unambiguous)
I asked the question above, maybe I formulated it crookedly, I will ask again, if you use a Trend Line Item, can you then change the color?
Thanks!
Try if this works for you:
component: oh-cell
config:
title: Something
trendItem: ITEM
style:
--f7-theme-color-bg-color: "#ff3b30"
background: var(--f7-theme-color-bg-color)
filter: opacity(50%)
Thanks! It work!!!
Before you edited the post, the picture had hints in the yaml editor, how to show them?
There is for sure a keyboard-shortcut, which I don’t know, but normaly it shows up automatically if you begin to write a new component line (beginning with “-”). To show it in the config area, press backspace and space again.
You can trigger autocompletion with Ctrl+Space.
(it doesn’t work everywhere, mostly at the start of a key, at the start of a value if there are known options, or after =
or items.
@ysc on MacOS the autocompletion does not seem to work.
I have tried it in Safari with Ctrl + Space, and also with Command + Space, but both do not work. Any thoughts about this?
Thanks!
hello,
i tried this code
component: oh-label-cell
config:
title: Abwesenheit
color: ‘=Number.parseInt(items.dummyawayswitch.state) == OFF ? “green” :
Number.parseInt(items.dummyawayswitch.state) == ON ? “orange” : “red”’
item: dummyawayswitch
action: command
actionItem: dummyawayswitch
actionCommand: ON
slots: null
the problem is when the state of dummyawayswitch is OFF the label cell doesnt goes green, it went grey.
the value is OFF and ON not a Number, i tried
=parseInt(items.dummyawayswitch.state.toString) == OFF? “green” :
parseInt(items.dummyawayswitch.state.toString) == ON? “orange”: “red”
but wont works
any ideas?
thx