Conditional expressions in MainUI expressions

what sort of expressions can you use on Labels or anywhere in YAML for MainUI widgets?
eg =Math.round(items.Power_Mains_Consumption.state.split(’ ‘)[0]/100)/10 + ’ kW’
can I use IIF or conditional expressions to show values based on item values?
eg

component: oh-gauge-card
config:
  item: Power_EV_Consumption
  max: 9000
  title: =items.Power_Mains_Consumption.state>10?"charging","evse";
  type: semicircle
slots: null

Yes, you can use conditional operator in your expressions in form of:

title: =(condition) ? 'when true' : 'otherwise'

Here in documentation you can check what else you can use in expressions.

1 Like