Open windows - hide card and badge with count

Hi team

Two questions - think they are a bit related, so will ask in same.

I have sensors at all windows and doors.

Question1:

I would like at the main door, at a tablet, be able to see if any windows/doors are open.

I have created an entity-filter card, and it works. Listing all 13 windows/doors. No open windows, no entity shown.

Now, I would like to hide the section if all windows are closed. This can be done using the visibility, and using an ‘or’ condition, and listing all 13 windows/doors again.

Can this be done in a smarter way ? - I had hoped to be able to use ‘labels’ (assign ‘Open window’ label to relevant windows/doors, and in the visibility be able to check on the label, but doesn’t seem like an option. Other ways ?

Question2:

I would like a badge at different tables that shows the number of open windows. How is that done ? Different colours when open/closed, icon, and number of windows…

And maybe even further - when clicking at the badge, it lists the open windows…

I haven’t been able to find similar thoughts from where to get inspiration - can some give an hint :wink:

Thanks.

Stock frontend doesn’t have much labels support yet, but many people use Auto-entities custom card for things like that, you could look into that.

For the badge, I would look at making a template sensor that counts the number of windows. Then you can display that template sensor in the badge.

You could set the click action of the badge to navigate to a subview which has a card which lists all the window states.