Display another items state in title

Good morning

Haven’t been able to find an answer to my simple problem (o;

I have a toggle list item to switch on/off a device which can also supply current power draw and want to display in the title the name of the device attached (Here an En-der-3 printer) and the actual power it consumes.

The item for the on/off state is “MyStrom03_state” and its power consumption is “MyStrom03_myStromPower”

But I failed so far with something like:

title: items[props.MyStrom03_myStromPower].displayState)

thanks in advance

Ah got it now…took a while as there is almost no documentation available for how to configure things in UI:

Bildschirmfoto 2022-10-16 um 14.05.17

component: oh-toggle-item
  icon: iconify:mdi:printer-3d-nozzle
  item: MyStrom03_state
  title: ="Ender-3 (" + (items.MyStrom03_myStromPower.state) + "W)"

There’s an entire section on dynamic expressions including using item states:

If there’s something about this section that didn’t work for you or you feel needs more information then please help make it better for others and click the link at the bottom of that page that says “Edit this page on GitHub” to submit the changes you would like to see to make it more clear.