From 839fc419537df418abfbb78d87423aaeec0599fc Mon Sep 17 00:00:00 2001 From: KGS501 <83352171+KGS501@users.noreply.github.com> Date: Sun, 8 Jan 2023 20:56:29 +0100 Subject: [PATCH] Added feature Added window counter --- .../README.md | 36 +++++++++++++++---- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/custom_cards/custom_card_yagrasdemonde_lights_count/README.md b/custom_cards/custom_card_yagrasdemonde_lights_count/README.md index d9af52391..ba83ff1f2 100644 --- a/custom_cards/custom_card_yagrasdemonde_lights_count/README.md +++ b/custom_cards/custom_card_yagrasdemonde_lights_count/README.md @@ -1,5 +1,5 @@ --- -title: Counter Lights/Covers Card Custom-card +title: Counter Lights/Covers/Windows Card Custom-card hide: - toc --- @@ -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
-1.0.0 -Initial release. +1.0.1 +Feature improvements.
## Requirements -This card needs sensor counting lights/covers you want: +This card needs sensor counting lights/covers/windows you want: ```yaml template: @@ -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 @@ -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