Skip to content

Commit

Permalink
Add battery replaced example
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-codechimp committed Oct 20, 2024
1 parent 1ea2cad commit cee2ff1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions docs/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,3 +173,25 @@ This can be useful for adding batteries to a shopping list or inventory system.
| `battery_type_and_quantity` | `string` | Battery type & quantity. |
| `battery_type` | `string` | Battery type. |
| `battery_quantity` | `int` | Battery quantity. |

### Automation Example

Note this cannot be run manually as it examines event triggers.

```yaml
alias: Battery Replaced
description: Battery replaced
trigger:
- platform: event
event_type: battery_notes_battery_replaced
condition: []
action:
- service: persistent_notification.create
data:
title: |
{{ trigger.event.data.device_name }} Battery Replaced
message: >
You just used {{trigger.event.data.battery_type_and_quantity }} batteries
mode: queued
max: 30
```

0 comments on commit cee2ff1

Please sign in to comment.