Check if an entity attribute exists (search by partial name)

Hi, I am trying to get the number of notifications that are still active in HA app in my smartphone. For that I am using the “Active notifications count” sensor, which includes the total number of notifications (including other apps) as value and in the attributes the notifications list.

This is a partial example of the sensor attributes I get in the sensor.sm_g991b_v_active_notification_count:

android.appInfo_android_34: ApplicationInfo{fd530c4 android}
android.appInfo_aplicacion.tiempo_2147483647: ApplicationInfo{e39abad aplicacion.tiempo}
android.appInfo_aplicacion.tiempo_33: ApplicationInfo{7255a9 aplicacion.tiempo}
android.appInfo_aplicacion.tiempo_666: ApplicationInfo{3569530 aplicacion.tiempo}
android.appInfo_aplicacion.tiempo_6868: ApplicationInfo{8439273 aplicacion.tiempo}
android.appInfo_aplicacion.tiempo_6969: ApplicationInfo{5aafee2 aplicacion.tiempo}
android.appInfo_com.google.android.apps.maps_0: ApplicationInfo{671a365 com.google.android.apps.maps}
android.appInfo_com.google.android.apps.photos_0: ApplicationInfo{cd343df com.google.android.apps.photos}
android.appInfo_com.google.android.googlequicksearchbox_0: ApplicationInfo{349883a com.google.android.googlequicksearchbox}
android.appInfo_com.whatsapp_1: ApplicationInfo{e7512f5 com.whatsapp}
android.appInfo_com.wssyncmldm_3: ApplicationInfo{247d45c com.wssyncmldm}
android.appInfo_io.homeassistant.companion.android_921304600: ApplicationInfo{13ae2cf io.homeassistant.companion.android}
android.appInfo_io.homeassistant.companion.android_921308474: ApplicationInfo{7e272e io.homeassistant.companion.android}
android.bigText_io.homeassistant.companion.android_921304600: Se ha alcanzado un pico de 219.19 kW
android.bigText_io.homeassistant.companion.android_921308474: Se ha alcanzado un pico de 219.19 kW
(....)
unit_of_measurement: notifications
icon: mdi:bell-ring
friendly_name: SM-G991B-V Active notification count

I was wondering if there is some way to “count” the times the attributes starting with “android.appInfo_io.homeassistant.companion.android_” appears in the sensor attributes and assign this value to another HA sensor (by using templates?). This way I will know the count of active HA notifications. If the count is not possible, at least to know if an attribute starting by “android.appInfo_io.homeassistant.companion.android_” does exist.

Thanks!

{{ states.sensor.YOUR_DEVICE_active_notification_count.attributes
| select('search','android.appInfo_io.homeassistant.companion.android_')
| list | count }}