Mushroom Title Card - showing value of sensor

Hi!

I have a template sensor which gives me some text information (if my washing machine is on or off). I want this information as “secondary” in a mushroom title card.

This is working:

secondary: Status {{ states(‘sensor.washingmaschineinfo’) }}

Any other “combination” is not working. Like:

secondary: Status: {{ states(‘sensor.washingmaschineinfo’) }}
brings an error message

secondary: {{ states(‘sensor.washingmaschineinfo’) }}

is not showing anything

What is the correct syntax? I want the result to be: “Status: Aus”. Wherby "Status: " is static text and “Aus” comes from the sensor.

BR
Christoph

I’m confused, you say you have something that works, but want something else?

Anyhow, for the title card, I think it’s subtitle, rather than secondary.

subtitle: "Status: {{ states('sensor.yoursensor') }}"

I was hitting this and adding double quotes around the string allowed me to have the content I wanted.

This didn’t work:
primary: {{ state_attr(‘binary_sensor.foo’, ‘Count’) }}

This did:
primary: :{{ state_attr(‘binary_sensor.foo’, ‘Count’) }}
primary: T{{ state_attr(‘binary_sensor.foo’, ‘Count’) }}
Which was very odd (:2 and T2 respectively) but not what I wanted.

But this got me what I wanted:
primary: “{{ state_attr(‘binary_sensor.foo’, ‘Count’) }}”

1 Like