This article will be about what is new in the latest Home Assistant 2023.4 and it will be quick, dirty and to the point from start till the very end.
Table of Contents
Executive Summary
As summary, in Home Assistant 2023.4 release:
- There are some new dialogs,
- New features of the Tile card,
- Some advanced templating functions are also added,
- New Blueprint selectors,
- Last, but not least some Database optimizations,
- As well as bunch of Other noteworthy changes and a lot of small breaking changes.
Let’s see the details.
New Alarm & Cover Dialogs
The first new thing that I’m going to talk about are the new dialogs.
For example, the more info on local alarm card is now looking like a switch and it is way more cleaner than before with no visible keypad.
But don’t worry, the keypad will be automatically shown only when it is needed.
If you want to know more about how to make your own local Alarm System thanks to Home Assistant, please check my dedicated article about that topic – Protect Your Home or RV with a DIY Home Assistant Alarm System and Smart Sensors
Same switch-a-like facelift is also happened to the Cover cards. So if you have covers integrated into your Home Assistant like a garage doors or window shades or any other covers, you can now make them look like a switch and control them that way.
Tilting is also supported. In such a case, a second slider is shown. The first one will control the open and close position and the second one will show how much of a tilt has been applied.
Fans are also getting off this new look, so if you have fans you can test by yourself.
Tile Cards Updates
The same features that we saw so far are also added in the Tile cards, so you can have a nice consistent look on your whole Home Assistant dashboard. If you add an alarm tile card for example, it will look as a smaller copy of the normal cards.
You can also hide or show the alarm modes on the tile card which is also a nice feature.
In general I like these changes, especially if I look these cards on a mobile phone, but can you please share what is your opinion in the comments bellow do you like this new look or not?
Macros for Templates
Next feature in Home Assistant 2023.4 are Macros for Templates. Which means you can define your own function with your own logic and you can reuse that on multiple places in Home Assistant. A new folder for that purpose will be now dedicated. The folder is called custom_templates
and it should be located in the Home Assistant config
folder. Inside it, these macros will be stored. You have to create that folder manually in a similar fashion like the custom_components
, that is if you want to use that functionality of course.
The files inside needs to have a .jinja
extension and they have to have some logic written in Jinja template engine for Python. That is because Home Assistant is powered by the Jinja2 templating engine. In other words Home Assistant is using Jinja’s syntax for the templates.
So, once this macro is defined it can be called anywhere in Home Assistant.
Here is the code that I used and that I got it from the Home Assistant 2023.4 release notes. I created a file /config/custom_templates/tools.jinja
with the following content:
{% macro is_on(entity_id) %}
Is the {{ state_attr(entity_id, 'friendly_name') }} on?
{{ (states(entity_id) == 'on') | iif('Yes', 'No') }}!
{% endmacro %}
Then I pasted the following template in Developer Tools > Template and voila.
{% from 'tools.jinja' import is_on %}
{{ is_on('light.kitchen') }}
If you are an advanced Home Assistant user this feature should be quite interesting for you, otherwise you can freely skip it and continue using the Home Assistant the same way you did before.
If you are not a Home Assistant user?
And if you are not a Home Assistant user at all, what are you still waiting for? Go and get one and start playing.
If you are unsure how to get started, then register for my upcoming Webinar where I will talk about the official installation types of the Home Assistant and their pros and cons. And if you just want to test the waters, fast and safe there will be something for you as well on that webinar. I will show you how to run Home Assistant on a PC in under 5 minutes.
Reserve your spot for my Webinar on my other website – https://automatelike.pro/webinar
It is FREE!
More Templating
And now some more templating in Home Assistant 2023.4 starting with the new is_hidden_entity
function. Which can tell if an entity has been marked as hidden or not. And as shown in Home Assistant documentation this function can be applied to a whole Home Assistant area and can return all of the entities that are not hidden in this area.
For example, if you paste the following code in Template tab in your Developer Tools you should see all of the hidden entities in your Home Assistant bedroom area if there are any.
{{ area_entities('bedroom') | reject('is_hidden_entity') | list }}
And when we talk about areas, there is a new areas
() function which simply list all of the areas that you have configured in your Home Assistant installation.
For example, if you paste the following code in Template tab in your Developer Tools you should see the new areas()
function in action
{{ areas() | list }}
Something else interesting added in this latest release is break
and continue
for FOR
loops support. Which makes the FOR
loops more agile and this functionality is now quite the same as in any modern programming language.
{%- for v in range(10) %}
{%- if v == 1 -%}
{%- continue -%}
{%- elif v == 3 -%}
{%- continue -%}
{%- elif v == 5 -%}
{%- continue -%}
{%- elif v == 7 -%}
{%- break -%}
{%- endif -%}
{{ v }}
{%- endfor -%}
has_value
is the next new function added, and this can be used as a quick test if an entity has a valid value or it is unavailable
or in unknown
state. Below is a demo that will check if the sensor.downstairs_temperature
has a value or not.
{% if has_value('sensor.downstairs_temperature') %}
The Downstairs temperature is: {{ states('sensor.downstairs_temperature') }}
{% else %}
Something is wrong with the temperature Downstairs
{%- endif -%}
Database Optimizations
Next new things will probably stay hidden for most of us, because the changes are mainly done under the hood, or to be precise in the Home Assistant Database.
The biggest takeaway from all this work is that the Home Assistant database running on SQLite is now even more optimised and faster than ever before.
As a result we should experience quicker response times, faster startup, reduced CPU and disk IO usage all of that on less disk space, because deduplication is now enabled.
New Blueprint Selectors
For the Blueprints creators there is a new constant selector now that provides a fixed value or doesn’t provide anything at all. Also, you can now pass a list of filters in the selectors, and before Home Assistant 2023.4 you could only filter with a single set of conditions.
Smart Home Glossary for you
If some of the terms that I’m using are not so clear for you, make sure that you download my Smart Home Glossary available on my other website – https://automatelike.pro/glossary. It is totally free.
Thanks for reading, I’m Kiril, see you next week. Bye!