From 50e85b4959f9fa9b845a0641b2406ea8caadd254 Mon Sep 17 00:00:00 2001 From: Thibault Maekelbergh Date: Wed, 18 Oct 2023 10:52:02 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20(templ):=20Add=20lights=20on=20amou?= =?UTF-8?q?nt=20template?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- custom_templates/light.jinja | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/custom_templates/light.jinja b/custom_templates/light.jinja index ea353f3..a49d664 100644 --- a/custom_templates/light.jinja +++ b/custom_templates/light.jinja @@ -6,3 +6,13 @@ | list }} {% endmacro %} + +{% macro lights_on_in_area(area) %} +{{ + area_entities(area) + | select('match', 'light.') + | select('is_state', 'on') + | list + | count +}} +{% endmacro %}