File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -156,4 +156,42 @@ action:
156
156
trigger.event.data.battery_type }}
157
157
mode: queued
158
158
max: 30
159
+ ` ` `
160
+
161
+ # # Battery Replaced (BETA ONLY)
162
+ ` battery_notes_battery_replaced`
163
+
164
+ This is fired when the battery is replaced, either by a button press or the action.
165
+
166
+ This can be useful for adding batteries to a shopping list or inventory system.
167
+
168
+ | Attribute | Type | Description |
169
+ |-----------|------|-------------|
170
+ | `device_id` | `string` | The device id of the device. |
171
+ | `source_entity_id` | `string` | The entity id of the sensor associated with the battery note. |
172
+ | `device_name` | `string` | The device name (or associated sensor name if no device). |
173
+ | `battery_type_and_quantity` | `string` | Battery type & quantity. |
174
+ | `battery_type` | `string` | Battery type. |
175
+ | `battery_quantity` | `int` | Battery quantity. |
176
+
177
+ # ## Automation Example
178
+
179
+ Note this cannot be run manually as it examines event triggers.
180
+
181
+ ` ` ` yaml
182
+ alias: Battery Replaced
183
+ description: Battery replaced
184
+ trigger:
185
+ - platform: event
186
+ event_type: battery_notes_battery_replaced
187
+ condition: []
188
+ action:
189
+ - service: persistent_notification.create
190
+ data:
191
+ title: |
192
+ {{ trigger.event.data.device_name }} Battery Replaced
193
+ message: >
194
+ You just used {{trigger.event.data.battery_type_and_quantity }} batteries
195
+ mode: queued
196
+ max: 30
159
197
` ` `
You can’t perform that action at this time.
0 commit comments