Door Open Count

Hi there,

I am setting up my dashboard and using a chip to show a count of lights on with this

{{ states.light
  |selectattr('state','equalto','on')
  |list
  |length
}}

How can I do the same with Windows and Doors?

I tried adjusting to states.light to state.door with no luck. Thanks!!

When you look at your contact sensors (assuming that’s what you have on your windows and doors) in Developer tools | States, what do you get there?

This one checks the device classes door, opening or window of binary sensors


        {{ states.binary_sensor
          |select('search', 'door|opening|window')
          |map(attribute='entity_id')
          |select('is_state', 'on')
          |list |length }}

4 Likes

Hello,