Template Badge Question - number of lights on

I saw in the lovelace mushroom update this month an example of a template badge that shows the number of lights on. I’d love to do this, but have no idea how to proceed. Any pointers from the experts out there?

{{ states.light | selectattr('state','eq','on') | list | count }}
1 Like

Thanks! Where do I put this code?

Nevermind, I figured it out. Pretty slick. Thanks man!

If you did figure it out, please tell us how. I was looking for that when I found this post.

1 Like