Goups to control visibility

You’re almost there :slight_smile:
You can not get the status from the name, you have to check if there are any members of your group in the wanted state, like so:
gEmptyBatteries.members.filter(s | s.state == ON).size > 0

An excellent source for information on Groups is here; really helped me to understand the concept:

HTH,
Regards,
-OLI