Using binary_sensor template as a glance and listing entities

I had trouble searching for this so please excuse me if this has been posted before. If it has please link the thread. I think the common terms gave me a lot of noisy hits that wasn’t what I was attempting to do.

First off, I don’t know the best way to achieve what I am trying to do. I tried messing with the binary_sensor template and the tap_action on the card. Mainly cause I don’t know how to achieve my goal.

So what am I trying to do?

2020-05-15_23h46_10

Here is a glance card. As you can see a window is open! But which one is open?

2020-05-15_23h36_48

Here is my YAML:

binary_sensor:
  - platform: template
    sensors:
      window_status:
        friendly_name: "Windows"
        entity_id:
          - binary_sensor.front_window_n_contact
          - binary_sensor.bedroom_window_2_contact
          - binary_sensor.dining_room_s_window_contact
          - binary_sensor.front_window_1_contact
          - binary_sensor.bedroom_window_wn_contact
          - binary_sensor.nursery_window_n_contact
          - binary_sensor.nursery_window_1_contact
          - binary_sensor.office_left_window_contact
          - binary_sensor.dining_room_n_window_contact
          - binary_sensor.bedroom_window_1_contact
          - binary_sensor.office_window_right_contact
        device_class: window
        value_template: "{{ expand('group.window_all_status') | selectattr('state','eq','on') | list | count > 0 }}"

When you click on the window icon, you get the above information, which is not helpful.

The window is a binary_sensor, which results in a pretty window icon that changes states when a windows out of the group of windows are open or not.

I can use my window group! So when you click on the window group, you get a lovely list of what windows are open or closed.

Here is my YAML:

window_all_status:
  entities:
    - binary_sensor.front_window_n_contact
    - binary_sensor.bedroom_window_2_contact
    - binary_sensor.dining_room_s_window_contact
    - binary_sensor.front_window_1_contact
    - binary_sensor.bedroom_window_wn_contact
    - binary_sensor.nursery_window_n_contact
    - binary_sensor.nursery_window_1_contact
    - binary_sensor.office_left_window_contact
    - binary_sensor.dining_room_n_window_contact
    - binary_sensor.bedroom_window_1_contact
    - binary_sensor.office_window_right_contact

But this info isn’t easy to tell at a glance what is going on. I don’t have an informative open/closed status to quickly assess the status of the windows unless I click on the group to see which ones are open.

I am not wanting to use both on my dashboard but I am willing to explore other options.

I would love to have the binary_sensor icon (with color change and showing the status) where clicking on the icon gives the full list of the windows in the group.

Can this be done?

Thanks for any help or direction!

Entity-filter card or auto-entities to make cards that only show the entities if they are in the state you are interested in:

Screenshot_2020-05-16 Overview - Home Assistant

Screenshot_2020-05-16 Overview - Home Assistant(2)

ok thanks for the suggestion!

I’ll be exploring it. Not exactly what I am looking for. I was hoping it could be some templating code change but unless there aren’t other ideas. I’ll be exploring your suggestion for now.

If you want it in a pop-up with only the active icons have a look at browser-mod

Thanks!

image

Now the entity whether a leak sensor, smoke/CO sensor or window gets listed when active. It hides when nothing is there.

Not how I envisioned it but it works! and I like that I don’t even need to press to see which sensor is active.

Thanks!