You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,8 +6,8 @@
6
6
[![License][license-shield]](LICENSE)
7
7
[![hacs][hacsbadge]][hacs]
8
8
9
-
Integration to add battery notes to a device, with automatic discovery via a growing [battery library](library.md) for devices.
10
-
Track the battery type, when the battery was replaced, when a battery is low based on device or global thresholds and also when a device hasn't reported a battery for a while.
9
+
Integration to add battery notes to a device or entity, with automatic discovery via a growing [battery library](library.md) for devices.
10
+
Track the battery type, when the battery was replaced, when a battery is low based on device or global thresholds and also when a battery hasn't been reported for a while.
11
11
12
12
A battery+ sensor provides useful attributes for easy use in dashboards, the standard battery can optionally be hidden.
@@ -226,4 +227,4 @@ It is extended from the example Battery Not Reported automation yaml above for t
226
227
You must trigger the check_battery_not_reported service via an automation to raise events, see [Check Battery Last Reported Daily](community.md/#check-battery-last-reported-daily) above.
227
228
228
229
## Contributing
229
-
If you want to contribute then [fork the repository](https://github.com/andrew-codechimp/HA-Battery-Notes), edit this page which is in the docs folder and submit a pull request.
230
+
If you want to contribute then [fork the repository](https://github.com/andrew-codechimp/HA-Battery-Notes), edit this page which is in the docs folder and submit a pull request.
Copy file name to clipboardExpand all lines: docs/events.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@ You can use this to send notifications in your preferred method. An example aut
12
12
| Attribute | Type | Description |
13
13
|-----------|------|-------------|
14
14
|`device_id`|`string`| The device id of the device. |
15
+
|`source_entity_id`|`string`| The entity id of the sensor associated with the battery note. |
15
16
|`device_name`|`string`| The device name (or associated sensor name if no device). |
16
17
|`battery_low`|`bool`| Returns true if the battery has gone below the threshold, false when the battery has returned above the threshold. **Your automations will almost certainly want to examine this value and set/clear notifications or other indicators.**|
17
18
|`battery_type_and_quantity`|`string`| Battery type & quantity. |
Copy file name to clipboardExpand all lines: docs/index.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# Battery Notes for Home Assistant
2
2
3
-
Integration to add battery notes to a device, with automatic discovery via a growing [battery library](https://github.com/andrew-codechimp/HA-Battery-Notes/blob/main/library.md) for devices.
4
-
Track the battery type, when the battery was replaced, when a battery is low based on device or global thresholds and also when a device hasn't reported a battery for a while.
3
+
Integration to add battery notes to a device or entity, with automatic discovery via a growing [battery library](library.md) for devices.
4
+
Track the battery type, when the battery was replaced, when a battery is low based on device or global thresholds and also when a battery hasn't been reported for a while.
5
5
Battery low, replaced and not reported are all via events and services, you have the option of creating your own automations for these or using the predefined ones in [community](./community.md).
6
6
7
7
*Please :star: this repo on [GitHub](https://github.com/andrew-codechimp/HA-Battery-Notes) if you find it useful*
@@ -28,7 +28,8 @@ Once you have [installed the integration](https://github.com/andrew-codechimp/HA
28
28
## To add a battery note manually
29
29
* Go to Settings/Integrations and click Add Integration.
30
30
* Select Battery Notes.
31
-
* Choose your device from the drop down and click next.
31
+
* Choose Device or Entity and click next. Device will automatically detect a battery and will work for most common devices, you should use entity if your device has multiple batteries or when an entity does not have a device.
32
+
* Choose your device or entity from the drop down and click next.
32
33
* Enter the battery type and quantity and optionally a battery low threshold and click submit.
|`data.device_id`|`yes`| The device id that you want to change the battery replaced date for. |
12
+
|`data.source_entity_id`|`yes`| The entity id that you want to change the battery replaced date for. |
12
13
|`data.datetime_replaced`|`yes`| The optional datetime that you want to set the battery replaced to, if omitted the current date/time will be used. |
13
14
14
15
You must specify either a device_id or entity_id, entity_id will be used in preference if both are specified. This allows the service to work with battery notes associated with both a device and also an individual entity, whether it is part of a device or not.
@@ -36,4 +37,3 @@ The service will raise a seperate [battery_threshold](./events.md/#battery_thres
36
37
You can use this service call as a reminder that is convenient to you, e.g. when you wake up, once a week etc. The event has a boolean data item `reminder` to determine if the event was raised by this service or the device battery going to a low state.
37
38
38
39
See how to use this service in the [community contributions](./community.md)
0 commit comments