From 6269c1a5e413d5617cf72855d68fa19c464153fb Mon Sep 17 00:00:00 2001 From: Przemek Grondek Date: Sat, 16 Dec 2023 15:38:36 +0100 Subject: [PATCH] Fix low battery automation --- templates/low-battery.yaml.j2 | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/templates/low-battery.yaml.j2 b/templates/low-battery.yaml.j2 index d77eb4f..c5a6af5 100644 --- a/templates/low-battery.yaml.j2 +++ b/templates/low-battery.yaml.j2 @@ -3,13 +3,21 @@ mode: single trigger: - platform: numeric_state - below: 20 + below: 15 + for: + hours: 0 + minutes: 1 + seconds: 0 entity_id: {% for entity in entities %} - {{ entity }} {% endfor %} - platform: numeric_state below: 10 + for: + hours: 0 + minutes: 1 + seconds: 0 entity_id: {% for entity in entities %} - {{ entity }} @@ -19,4 +27,4 @@ data: title: "Low battery" message: > - {% raw %}{{ state_attr(trigger.entity_id, 'name_by_user') }} has low battery {{ states(trigger.entity_id) }}% {% endraw %} + {% raw %}{{ device_attr(trigger.entity_id, 'name_by_user') }} has low battery {{ states(trigger.entity_id) }}% {% endraw %}