Transformation inside oh-label-card

Hey guys,

i have two questions:

  1. is it possible to transform an Itemstate inside a oh-label-card?
  2. Is it possible to do a linebreak inside a oh-label-card in the footer?

My current code looks like this: Imagine the Shelly_Licht_Hobbyraum is a Switch-Item. I would like to transform its output from “OFF, ON” to “AUS, AN”. I tried it with MAP-Transformations but i dont know how to implement the transformation into an oh-label-cell.

component: oh-label-card
config:
  action: popup
  actionModal: page:page_74dc25bdee
  title: Hobbyraum
  icon: iconify:ic:outline-living
  on: =items.Shelly_Licht_Hobbyraum.state == 100
  color: white
  footer: '="Temperatur: "+items.Shelly_Temperatur_Hobbyraum.state+"°C /
    Luftfeuchtigkeit: "+items.Shelly_Luftfeuchtigkeit_Hobbyraum.state+"%"'
  item: Shelly_Licht_Hobbyraum
  vertical: true
  trendItem: Shelly_Licht_Hobbyraum
  label: =items.Shelly_Licht_Hobbyraum.state+"%"
  trendSampling: "1"
slots: null

Inside the footer i would love to have a linebreak to show the two states underneath each other, than next to each other. Is this possible? I tried “\r” without any result.

  1. Not really. You can do stuff with expressions but that’s about it.

  2. I’ve no idea. You can try adding a \n and see what happens.

That’s because you don’t implement it there. Create a State Description metadata on the Item and put the MAP transform into that. In your widget use the displayState on the Item instead of just the state.