UI for OpenClose window sensors

Hi,
I’m new to Home Assistant. I have a bunch of window sensors that post their status via MQTT. I’m interested in better ways to display it. I currently just have “binary_sensor” using MQTT. Like this:

binary_sensor:
  - platform: mqtt
    name: "Con956bbad"
    state_topic: "/+/+/c6f7fd00956b/mag/#"
    payload_on: "1"
    payload_off: "0"
    
  - platform: mqtt
    name: "Con3b74"
    state_topic: "/+/+/cbfbf2ca3b74/mag/#"
    payload_on: "1"
    payload_off: "0"

And it shows up like this on the main dash board:
home%20assistant%20dash%20open%20close

I’d much rather have only opened windows and doors show up. I don’t need to know about the closed ones. Is there a way to do that? I don’t necessarily need badges…maybe just a list of Open Contacts like list elements in Grafana?

This isn’t doable with the yaml configuraiton at the moment, but it would be doable with automations. Set the trigger to a change of state for the sensors, then add or remove it from a custom group.

It’s much easier to do in Lovelace (the new UI they’re working on). You can define a card so that it contains all elements of of a specific domain, with a filter to only include items in a specific state. As an example, here’s one of my cards in Lovelace.

      - type: "custom:monster-card"
        card:
          type: glance
          title: Alerts
        filter:
          include:
            - domain: switch
              state: 'on'
            - domain: light
              state: 'on'
            - domain: binary_sensor
              entity_id: "*door*"
              state: "on"
            - domain: lock
              state: 'unlocked'
            - entity_id: binary_sensor.fd_sensor
              state: 'on'
            - domain: cover
              state: 'on'
            - domain: binary_sensor
              entity_id: "*moisturev4*"
              state: 'on'
          exclude:
            - entity_id: switch.debug
            - entity_id: "*ding*"
            - entity_id: "*motion*"
1 Like