Expected Reading Time: 7 minutes

Have you ever lost track of the batteries in your smart home devices? Don't worry, you're not alone. Fortunately, there's a simple solution: Home Assistant and the practical Battery Notes add-on. In this blog article, I'll show you how you can easily track batteries and always keep a perfect overview.

For detailed instructions and an explanation of all configuration options, I recommend the YouTube video linked below. In this video, every single setting is explained in detail so that you receive comprehensive instructions for the exact setup. You can find any code from the video in this article so that you can use it directly without having to type it in.

Why is battery tracking important?

Monitoring the battery status in your smart home devices is very important for several reasons:

  1. SecurityImagine your smoke alarm beeping in the middle of the night because the battery is almost flat. Such situations can not only be annoying, but also dangerous. A working smoke alarm can save lives in an emergency.
  2. ComfortImagine your smart doorbell doesn't work when a visitor is at the door. Without battery monitoring, you could miss important visits or parcel deliveries.
  3. Cost efficiencyBatteries that are fully discharged can sometimes cause more serious damage to devices or need to be replaced more frequently. Regular checks and timely replacement will save you money in the long term.
  4. SustainabilityBy changing the batteries in good time, you can make the most of their service life and avoid unnecessary battery waste. In this way, you contribute to a more sustainable use of your devices.

Features of Battery Notes

Battery Notes offers a variety of useful functions:

  • Automatic device integrationThe add-on has a constantly growing library of device profiles that are automatically recognized and integrated. This saves you having to manually configure many common devices.
  • Detailed battery managementYou can record the battery type, the date of the last battery change and the remaining service life for each device. In addition, events are triggered when a battery is low or has not been reported for a long time.
  • User-defined automationsBattery Notes allows you to create your own automations. You can set up notifications when the battery level falls below a certain value or when the battery needs to be replaced. Templates and blueprints help you get started quickly (GitHub Battery Notes) (Documentation of Battery Notes).

What is Home Assistant?

Home Assistant is an open source platform for home automation that aims to connect and centrally control all devices in the home. It is designed to provide a unified user interface and simple, flexible control for a variety of smart home devices from different ecosystems. Here are some points in favor of Home Assistant:

  1. CompatibilityHome Assistant supports thousands of devices and services from various manufacturers, including lighting, air conditioning, heating, cameras, weather sensors, voice assistants and more.
  2. Local controlUnlike many commercial smart home platforms that rely on cloud services, Home Assistant runs locally on your network. This means increased privacy and reliability, as your smart home devices work even without an active internet connection.
  3. Automation and scenesOne of the main features of Home Assistant is the ability to create complex automations and scenarios. For example, you can have lights switch on automatically when it gets dark or turn on the heating when the temperature falls below a certain level.
  4. Simple user interfaceHome Assistant offers a user-friendly interface that makes it easy to monitor and control devices. This interface is fully customizable.
  5. Integration with voice assistantsHome Assistant can be integrated with voice assistants such as Amazon Alexa or Google Assistant to enable voice-controlled control of your smart home devices.
  6. Open source and community-drivenSince Home Assistant is open source, it is supported by an active community that is constantly developing new integrations and improving existing ones.
  7. Data protection and securityAs a locally running platform, Home Assistant has the advantage that the data remains within its own network. This protects privacy and increases security compared to cloud-based solutions.

In summary, Home Assistant is a powerful and flexible solution for those who want to design their own smart home and control their devices centrally, regardless of the manufacturer or ecosystem.

Installation of HACS and integration of Battery Notes in Home Assistant

Step 1: Installing HACS in Home Assistant

Home Assistant Community Store (HACS) is a custom add-on for Home Assistant that provides access to a variety of custom integrations and plugins developed by the community. How to install HACS:

  1. Check requirements: Make sure that your Home Assistant is ideally up to date.
  2. Download Execute script: Open a terminal for the Docker container version or the core version.
    • Docker: Dial into the container with: docker exec -it homeassistant bash or (similar)
    • Core: Switch to the user who is running Home Assistant
    • Execute the following command for both variants:
      wget -O - https://get.hacs.xyz | bash -
  3. Restarting the Home Assistant: After the files have been copied, restart Home Assistant.
  4. Integrate HACS into Home AssistantGo to "Configuration" > "Integrations" > "Add" in the Home Assistant interface and search for HACS. Add it and enter your GitHub token if prompted.

For the supervised version, please refer to the Documentation of HACS itself to read about the installation.

Step 2: Add Battery Notes integration via HACS

Once HACS is installed, you can simply add Battery Notes:

  1. Open HACS: Go to HACS in the Home Assistant interface.
  2. Search for integrationClick on "Integrations" and use the search function to search for "Battery Notes".
  3. Install Battery NotesFind Battery Notes in the list and click on "Install". This will add the integration to your Home Assistant.
  4. Restarting the Home Assistant: Start Home Assistant again to apply the changes.
  5. Configure battery notesAfter restarting, you can set up and customize Battery Notes via "Configuration" > "Integrations" in Home Assistant.

Conclusion

With these steps, you have successfully installed HACS in your Home Assistant and added the Battery Notes integration. This powerful combination opens up a world of additional features and customizations that have been and are being developed by the Home Assistant community. More blog posts and videos on useful integrations to follow. If you don't want to miss it, subscribe to my YouTube channel!

Replace automation for battery

alias: Battery replaced
description: ""
use_blueprint:
  path: andrew-codechimp/battery_notes_battery_replaced.yaml
  input:
    on_replaced_actions:
      - service: notify.smartphones
        metadata: {}
        data:
          message: Battery changed for "{{ trigger.event.data.source_entity_id }}"
          title: Battery changed

YouTube video implementation

Conclusion

With Home Assistant and the Battery Notes add-on, you always have an overview of the battery status of your devices. This way, you avoid nasty surprises and ensure that your smart home always works smoothly. Try it out and experience how easy battery tracking can be!

Now it's your turn: install Home Assistant and Battery Notes and experience how easy it can be to manage your batteries. You'll be amazed at how much comfort and safety you can gain from this small change.


5 Comments

Manuel · 23. July 2024 at 14:01

Hi Sascha, really great video, but I'm somehow missing the complete program code for the notification output (for which device the battery is empty [below the threshold]) at minute 5:27. I have added it as follows: "{{ trigger.event.data.source_entity_id }}" -> Is this correct? If not, could you maybe post yours here?
Thank you very much 😉

    Sascha Brockel · 24. July 2024 at 00:01

    Hey Manuel, sorry I didn't even notice when I was editing and didn't think the bit of code was too relevant at the time. I've added it now. You can copy everything and adapt the devices accordingly 🙂

      Manuel · 8. August 2024 at 08:09

      Hello Sascha,
      Thank you for the correction and addition. However, I have the following error: When it sends the message to my device, it always says: " " (so no content) and I don't know which device the battery was replaced on. Do you have any idea what the problem could be? I have implemented it 1:1 as you did.

        Sascha Brockel · 8. August 2024 at 15:43

        Phew, to be honest, not really. So something arrives on your smartphone, but without a message? It should at least say battery changed.

Tom · 8. October 2024 at 09:15

Hello Sascha ,
Thanks to your helpful tutorial, I have installed the blueprint "Low battery level detection & notification for all battery sensors".
Super job and many thanks !!!

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

en_US