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
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’) }}”