Smart Home Addict

Making your home smarter

AutomationHow To

Introduction to Blueprints in Home Assistant (low battery notifications)

In this guide we’ll introduce Blueprints in Home Assistant. Blueprints are pre-written automations that you are able to adapt to your situation in home assistant. They are normally written in a generic style, allowing you to customise devices and actions to your own situation.

To demonstrate blueprints, we’ll first create an automation in Home Assistant to notify of a low battery alert on a sensor in Home Assistant. We’ll create this as a normal automation. We’ll then do the same using a blueprint.

To start, go to Settings, Automations, then Create Automation. As you can see we can select a blueprint for this automation, but we’ll Start with an empty automation.

Give it a name. The trigger type is device, motion sensor. The trigger we select Motion Sensor battery low battery low.

There are no conditions. For the action, select Call Service. Then select a suitable notification – I selected a notification via a mobile phone. For the message, type an appropriate message to warn you of the low battery.

When this is enabled, you’ll then get a notification as soon as the battery falls below the low battery threshold (in this case it’s a binary sensor within the motion sensor).

You will need to do this for every sensor that you have in your installation. As you can imagine, this will get very tedious quickly. Thankfully a developer called Steven Barth has already written an automation that will monitor all of your sensors and created a blueprint so you can use it.

Lets disable our new automation and go to the Blueprints tab. Click on the Discover More Blueprints link. This will take you to a section of the Home Assistant forum where Blueprints are shared. Click on the search icon. We’ll search for low battery. Click on the ‘in blueprints exchange’ option. A number of results will come up, you want the first option here (your results may differ). Click on it.

As this is a forum there’s a lot of information and help here. Thankfully there’s a button you can use to import this directly into your Home Assistant, Import Blueprint. Click it.

The very first time you try this, it’ll ask you to confirm your Home Assistant URL. It’s fine to use the default if you’re on the same network. If you need to change this, click on the pencil icon to edit it. click Open Link.

It will ask you import and show you a link – click Preview Blueprint.

It will then show you details of the blueprint. You can expand Blueprint content if you wish to look at it further. Click Import Blueprint.

The blueprint is now saved in your Home Assistant instance and you can either click Create Automation here, or go back to the automation tab and click Create Automation. Click on the Select a Blueprint dropdown and select the new blueprint.

Give it a meaningful name. You can select a number of options – the battery level threshold, what time of day you want to run the test, the day of the week or every day. You can exclude sensors, it’s recommended to exclude smartphones and tablets or you’ll get warnings every day.

The action is left for you to add. To create a notification the action type is call service. For service, start to type notification. Select the device you want the notification to appear on. You can create multiple actions if you want to be notified on multiple devices.

Type in a message. If you use the {{sensors}} variable this will be replaced with the name of the sensor. Note if you use the variable, the action will change to YAML input, but carry on typing the message. Click Save.

If you run the action this will immediately check any sensor. This will also happen at the frequency you’ve selected – for instance every day at 10 am.

If this identifies batteries that need replacing, here are some links to popular batteries on Amazon.

CR2032
CR2450
123A
AA batteries
AAA batteries

As an Amazon affiliate we may receive commissions on any purchases that you make via these links, this does not affect the price that you pay.

This is an introduction to blueprints, we will cover these in greater detail in a future video and guide. For now, check out the Blueprint section of the home assistant forum for some great automations you can import. This is available at https://community.home-assistant.io/c/blueprints-exchange/53