Skip to content

A Home Assistant integration to provide battery notes of devices

License

Notifications You must be signed in to change notification settings

dankarization/HA-Battery-Notes

 
 

Repository files navigation

Home Assistant Battery Notes

GitHub Release GitHub Activity License

hacs

Community Forum

Integration to add battery notes to a device.

Battery Notes

This integration will set up the following platforms.

Platform Description
sensor Show battery type.

Installation

HACS

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

Or
Search for Battery Notes in HACS and install it under the "Integrations" category.
Restart Home Assistant
In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Battery Notes"

Manual Installation

Show detailed instructions 1. Using the tool of choice open the directory (folder) for your HA configuration (where you find `configuration.yaml`). 1. If you do not have a `custom_components` directory (folder) there, you need to create it. 1. In the `custom_components` directory (folder) create a new folder called `battery_notes`. 1. Download _all_ the files from the `custom_components/battery_notes/` directory (folder) in this repository. 1. Place the files you downloaded in the new directory (folder) you created. 1. Restart Home Assistant 1. In the HA UI go to "Configuration" -> "Integrations" click "+" and search for "Battery Notes"

Configuration is done in the UI

On the "Configuration" -> "Integrations" -> "Battery Notes" screen add a new device, pick your device with a battery and add the battery type.
The battery type will then be displayed as a diagnotic sensor on the device.

Contributing to the Battery Library (COMING SOON!)

The battery library is a JSON document at custom_components/battery_notes/data/library.json
To contribute, fork the repository, add your device details to the JSON document and submit a pull request.
Please keep devices in alphabetical order by manufacturer/model.
The manufacturer and model should be exactly what is displayed on the Device screen within Home Assistant. The make & model names may be different between integrations such as Zigbee2MQTT and ZHA, if you see a similar device please duplicate the entry rather than changing it.

For the example image below your JSON entry will look like this

{
    "manufacturer": "Philips",
    "model": "Hue motion sensor (9290012607)",
    "battery_type": "AAA",
    "battery_quantity": 2
},

Note that the battery_quantity is numeric (no quotes) and optional, if a device only has one battery it should be omitted.
When specifying battery types please use the Most Common naming for general batteries and the IEC naming for battery cells according to Wikipedia

Device Details

Contributions are welcome!

If you want to contribute to this please read the Contribution guidelines

Acknowledgements

A lot of the inspiration for this integration came from the excellent PowerCalc by bramstroker, without adapting code from PowerCalc I'd never have worked out how to add additional sensors to a device.

About

A Home Assistant integration to provide battery notes of devices

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 95.9%
  • Shell 4.1%