Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated lights/cover counter card #1146

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 30 additions & 6 deletions custom_cards/custom_card_yagrasdemonde_lights_count/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Counter Lights/Covers Card Custom-card
title: Counter Lights/Covers/Windows Card Custom-card
hide:
- toc
---
Expand All @@ -8,27 +8,31 @@ hide:

# Custom-card "Counter Lights/Cover Card"

This is a `custom-card` to display number of lights on or covers open.
This is a `custom-card` to display number of lights on or covers and windows open.

![Screenshot light mode](../../docs/assets/img/screenshot_light_count_lights.png)
![Screenshot light mode 2](https://user-images.githubusercontent.com/83352171/211215563-7a6db228-07dc-4ca2-995c-980afcf39d48.png)

![Screenshot dark mode](../../docs/assets/img/screenshot_dark_count_lights.png)
![Screenshot dark mode 2](https://user-images.githubusercontent.com/83352171/211215510-884a1013-44b5-49e4-9734-6c101b270f92.png)


## Credits

Author: yagrasdemonde - 04/2022

Version: 1.0.0
Version: 1.0.1

## Changelog

<details>
<summary>1.0.0</summary>
Initial release.
<summary>1.0.1</summary>
Feature improvements.
</details>

## Requirements

This card needs sensor counting lights/covers you want:
This card needs sensor counting lights/covers/windows you want:

```yaml
template:
Expand All @@ -54,6 +58,15 @@ template:
states.cover.livingroom2,
] %}
{{ covers | selectattr('state','eq','open') | list | count }}
- name: "windows open"
unique_id: windows_open
icon: mdi:window-open
state: >
{% set binary_sensors = [
states.binary_sensor.window1,
states.binary_sensor.window2,
] %}
{{ binary_sensors | selectattr('state','eq','on') | list | count }}
```

## Usage
Expand All @@ -78,6 +91,17 @@ For covers
ulm_custom_card_yagrasdemonde_lights_count_color: "blue"
```

For windows
```yaml
- type: "custom:button-card"
template: custom_card_yagrasdemonde_lights_count
entity: sensor.windows_open
variables:
ulm_custom_card_yagrasdemonde_lights_count_icon_off: "mdi:window-open"
ulm_custom_card_yagrasdemonde_lights_count_type: "cover"
ulm_custom_card_yagrasdemonde_lights_count_color: "blue"
```

## Variables

<table>
Expand Down
Loading