Not sure if this what you are looking for. But i think, you can tweak and customize it to suit your requirement.
This Alarm counter template can filter any string in the "Template properties/Displaypath" filter and can display the filtered alarms count. This is case insensitive. You can cross check by filtering Alarms in the "Alarm status table/Display Path Filter" and copy/paste the same string into this template's filter.
Note: "Alarm status table/Display Path Filter" is case sensitive.
Github -- AreawiseAlarmsCounter.proj