I can do the following to find a switch that is on:
{{ states.switch
| selectattr('entity_id', 'search', 'smartplug')
| selectattr('state','equalto','on')
| list
| length
}}
And I can do this to find switches with a given label and state:
{{
label_entities('normally off')
| select('is_state', 'on')
| select('match', 'switch.*smartplug')
| list
| length
}}
...but how can I find a switch without any label at all?
[edit: typos]