Skip to content

Commit 62dadac

Browse files
Add summary example
1 parent 7255871 commit 62dadac

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

docs/community.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,37 @@ actions:
189189
data: {}
190190
```
191191
192+
### Battery Low daily summary
193+
194+
If you want a single message sent to your email or other notification service you can use the Check battery low action response to build a summary.
195+
196+
```yaml
197+
alias: Battery Notes - Low Battery Summary
198+
description: Send a single summary of all low batteries daily
199+
triggers:
200+
- trigger: time
201+
at: "09:00:00"
202+
conditions: []
203+
actions:
204+
- action: battery_notes.check_battery_low
205+
metadata: {}
206+
data:
207+
raise_events: false
208+
response_variable: battery_check
209+
- variables:
210+
battery_summary_message: |
211+
{%- for item in battery_check.check_battery_battery_low | sort(attribute='battery_level') %}
212+
• {{ item.device_name }} - {{ item.battery_level }}% - {{ item.battery_quantity }}× {{ item.battery_type }}
213+
{%- endfor %}
214+
- action: notify.send_email
215+
metadata: {}
216+
data:
217+
message: "{{ battery_summary_message }}"
218+
title: Low battery summary report
219+
target: you@youremail.com
220+
mode: single
221+
```
222+
192223
### Battery Replaced
193224
194225
Mark a battery as replaced when there is an increase in battery level.

0 commit comments

Comments
 (0)