Card that shows open doors, windows, or lights on, or etc

Not sure how to say this exactly, but I am looking to make a card in my dashboard to show if any lights are on, and if so, if I click it, it will show the list of lights that are on. I would then make a card next to it that shows if any doors/windows are open. I know Dwains Dashboard does this, but I don’t like how limited you are in Dwains.

Thanks.

2 Likes

Advanced UI customization - happy fun times.

You’re going to want to look at custom button card…

There’s TONS of examples in this thread on what you can do with it:
Fun with custom:button-card - Share your Projects! / Lovelace & Frontend - Home Assistant Community (home-assistant.io)

You’ll also need to learn how to do Template Sensors, and groups to be successful.

How this plays out In my setup: I have a group for all my locks

Group - Home Assistant (home-assistant.io)

image

I have a custom button card that uses that group as its base entity - but depending on how things are - I change the color state, icon and actions that the card does. Green/blue and lock icon if all locks are locked (I have separate conditions whether the alarm is armed or not) Yellow, unlocked icon if any one is open, Soon I’m planning on adding Orange if any are unknown / jammed. etc.

Pressing on the button, brings up the more info card for the group

where i can see individual states, Long press on the button issues a lock command to the entire group - effectively lock all.

card code for reference:

type: custom:button-card
entity: group.all_locks
name: Locks
tap_action:
  action: more-info
hold_action:
  action: call-service
  service: lock.lock
  service_data:
    entity_id: entity
state:
  - value: unlocked
    color: Gold
    icon: mdi:lock-open
  - value: locked
    color: Green
    icon: mdi:lock
3 Likes

I use conditional cards to show stuff that’s turned on.

1 Like

Hi , I was using picture element but I think this looks way more fun , i will try this

1 Like

I’m using this for exactly the same reasons…

2 Likes

I think this is close to what I want. I am going to play with it. Thank you.

1 Like

this was really easy, but not quite it. This is great that it shows you the entities that are in the state. I might use this for something else. Thank you.

Actually, I wonder if I can use custom button cards and the auto entities together? That would work if I could.

I don’t suppose I could do this to make it just call all my lights and switches.

all_lights:
  name: All Lights
  entities: 
    - light.*
    - switch.*

Nope. Light group. Switch group.

so no way to make a group just show all from a domain?

Thats what the auto entities card points a few posts above does…

I’m trying my windows, as I only have two. I must be doing something wrong. Here is my group:

all_windows:
  name: Windows
  entities: 
    - binary_sensor.main_bathroom_window
    - binary_sensor.living_room_window

and here is my card config.

type: custom:button-card
entitity: group.all_windows
name: Windows
action: more-info
state:
  - value: 'off'
    color: white
    icon: mdi:window-closed
  - value: 'on'
    color: blue
    icon: mdi:window-open

Whats it actually doing whats developer tools say about the state of the entity of you check it? Also if you add the group to a simple entity card how does it show up? (basically make sure your group works right first)

if I add my group to an entity card it says off.

Here is what dev tools looks like.

If they are all closed, that’s correct…

Whats the card doing?

The card is big ol’ nothing


I tested if I opened a window. The single entity card says “on”. Nothing changes in the button card.

Then your group is working and its just the card. Its actually acting like the card isnt installed properly. Did you install with HACS? Did you reload the browser after installing custom button card? Try clearing the browser cache and restarting the browser. If that doesnt work, I’d raise an issue on the button card githib

I installed via HACS. I did not reload the browser. I will do that.

1 Like

still nothing. I am going to try it with a few lights just for a test.