From 2d06a42a8cb5b8b5cf84d8294876428aea1576d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Grondek?= Date: Sat, 16 Dec 2023 01:48:00 +0100 Subject: [PATCH] Add info how to list batteries entities --- HELP.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/HELP.md b/HELP.md index 9c422cf..57517cd 100644 --- a/HELP.md +++ b/HELP.md @@ -19,3 +19,15 @@ You need to enable node_status for each device, and they need to have `node_stat {% endfor %} {{ ns.result }} ``` + +# List batteries entities + +``` +{% set ns = namespace(below=[]) %} +{% for s in states.sensor + if s.entity_id is search('battery') and s.state != 'unknown' + %} +{% set ns.below = ns.below + [s.entity_id] %} +{% endfor %} +{{ ns.below |sort| join(', ') }} +```