Question/help please- about updating my door template to include one other binary sensor of a different brand

Good evening all, i want to modify an existing doors open template in my yaml.congratulation. Right now part of that text includes searching the entity ID for “_eve_door’ because of all my doors contacts I want to monitor open we’re all Eve brand (copy of it below).

I found one other brand door contact I want monitor if its open from my badge thingy at the top of my mobile dashboard, its also binary_sensor but by another brand name (Aqara) & I’m having difficulty modifying the template to do it.

Below are two things, 1- my current configuration.yaml for my ‘doors open’ template (copied directly from my yaml.configuration) and 2- a screenshot from my developer tools of the Aqara door contact that I’d also like my ‘doors open’ template to monitor, its also a binary sensor, and device_class is a door too. just the name is different(its ends in “_aqara_contact”

In my current ‘doors open’ template I included a search for my majority door contacts (Eve)(with the huge help of this community), Can I add a 2nd search into the doors open template for the Aqara? If so, can you please kindly show me what text to add./change?

Please let me know if anyone needs any more information and or screenshots.

This is my exact ‘doors open’ template and screenshot of the door senior I want to also include in the template now.

thanks very much!

  - sensor:
    - name: "doors open"
      unique_id: doors_open
      icon: mdi:door-open
      state: "{{ states.binary_sensor |selectattr('attributes.device_class', 'defined') |selectattr('attributes.device_class', 'eq', 'door') |selectattr('state','eq','on') |selectattr('entity_id', 'search', '_eve_door') | map(attribute='entity_id') | list | length}}"

      state: >
        {{ states.binary_sensor
           | selectattr('attributes.device_class', 'defined')
           | selectattr('attributes.device_class', 'eq', 'door')
           | selectattr('state','eq', 'on')
           | selectattr('entity_id','search', '(_eve_door|_aqara_contact)') 
           | map(attribute='entity_id') 
           | list | count }}
1 Like

thank you very, Tom, THIS worked, much appreciated!!!