#Increasing counter helper by number of specified entities in off state

1 messages · Page 1 of 1 (latest)

languid gulch
#

I want to make an automation that when triggered causes a counter helper to increase its value (not set, but strictly increase) by the number of Boolean state entities along a given set of entities currently in an off state.

So if I have three Boolean entities, and two are off, and this automation is triggered, the counter helper should increase by two.

How can I achieve this?

queen burrow
#

Do you know how to write templates?

languid gulch
#

I've never done so, no

queen burrow
#

Depending on how many entities you have, you could brute force your way through with a bunch of condition / increment-by-1 actions, but writing a template that counts the number of entities, and increments by that count is probably the cleanest method.

languid gulch
#

I want it to be infinitely expandable, so it sounds like a template would be the right call. I'll look into that. Thanks.

Any particular things about templates I should look at for that purpose?

queen burrow
languid gulch
#

Thanks

fair narwhal