I use a template sensor to show the number of lights on in custom button …but would also like to be able to add that template as a badge icon in a (mushroom) template card
this particular line of code
{{ states(‘sensor.number_lights_on’) }}
currently presents itself as this
so no number details at all…even though a number of lights are reported on this custom button card
and when I place the same template code into the Dev Tools template sections, it returns the correct number
So I am clearly not using the correct syntax but I am struggling to find out what it should be.
Can anyone please give the correct pointers?
I have other badges working fine but they are is is_states and they are pointing to a specific outcome…so I know it has to be different
TIA for anything you might be able to suggest