2023.4: Customized template macros, and plenty of extra new entity dialogs!

House Assistant Core 2023.4! 🎉

The spring (launch) is right here! And do now we have some wonderful new options for you
to play with this upcoming easter weekend! 🐰

I’m thrilled to see extra of these new entity dialogs coming on this launch.
They appear lovely and work exceptionally nicely from the cell app. There’s
even an added bonus of recent Tile card options! However…

Oh boy, do I really like the brand new skill to make your personal Jinja2 template macros in
this launch. It’s mind-blowing! The very best factor about them, it makes them
simply shareable as nicely! Can’t wait to see what you all provide you with!

Comfortable Easter! 🐣 and benefit from the launch!


Don’t overlook to join our release party live stream on YouTube
5 April 2023, at 12:00 PDT / 21:00 CEST!

New dialogs for alarm, cowl, and fan entities

The previous release
brought in new entity dialogs for lights, switches, and sirens; it seems
many of you really liked it!

So, this release @piitaya saved on trucking, implementing the designs
by @matthiasdebaat, bringing the identical new clear and neat UI in entity dialogs
for alarm management panels, covers, and followers!


First up, covers! For covers, there are a lot of variants, doorways, home windows, curtains,
blinds, shutters, and many others. Not simply that, some might be managed by how far they
are open/closed, and others can solely be opened and closed.

That is no drawback for the brand new dialogs. They’ll modify to the capabilities
your cowl has:

Screenshots showing the new cover entity information dialogs.

The one on the left is attention-grabbing, as the primary slider controls how far down
the blinds are. Discover the way it slides in from the highest! The slider instantly subsequent
to it controls the lean. Good!


Next up, the fan entities. The UI experience shown in the dialog will
automatically adjust to the capabilities of the fan you are controlling, just
like with covers.

Screenshots showing the new fan entity information dialogs.

Depending on the number of speed steps your fan has, the dialog will
automatically adjust the UI. In case it has four speed steps or less, it will
show the speed buttons as on the left screenshot. Otherwise, it will use the
slider shown on the most right screenshot.

Alarm control panels

Lastly, the alarm control panel entities. They are a bit different compared
to others as, more often, these require one to input a code to arm or disarm
the alarm.

Screenrecording showing the new alarm control panel entity information dialogs work with the pin-input.
This is how arming and disarming an alarm now looks like.

When needed, the pin-pad will pop up! A nice finishing touch is the neat little
animation is shown during the process of arming and disarming the alarm.

New features for the Tile card

The Tile card has two new features: Fan speed & Alarm mode.

Both look and feel similar to the new entity dialogs from above, making the look
and feel, nice and consistent. Take a look; aren’t they beautiful?

Screenshots the new fan speed feature for tile cards.

Like the new fan entity dialog, the fan speed feature will show buttons if there
are 4 speeds or less; in all other cases, it will use the slider. If the fan
can only be turned on/off, like the fan in the middle in the above screenshot,
the regular tile can be used.

The alarm mode feature allows quickly setting your alarm in a different state.
The feature provides the option to select which modes are shown as buttons in
the card.

Screenshots the new alarm mode feature for tile cards.

Just like with the new entity dialog, the pin pad will pop up once a code entry
is needed and even the nice little animation is there. 🤩

Macros for your templates

If you are an advanced Home Assistant user, you most likely will be familiar
with Home Assistant’s templating language: Jinja2. It allows you to do amazing
powerful things in your templates. However, if you have lots of them, you
often end up repeating similar logic everywhere!

@depoll to the rescue! He discovered a approach so as to add the flexibility to centrally outline
your personal Jinja2 macros and import and use them anyplace in House Assistant! 🤯

To help this, House Assistant now has a brand new custom_templates folder, the place
you’ll be able to retailer your macros. For instance, assume this file

% macro answer_question(entity_id) %

Is the  state_attr(entity_id, 'friendly_name')  on?
 (states(entity_id) == 'on') !

% endmacro %

This macro answer_question will ask and reply a query based mostly on a given
entity ID. Now you can import and use this macro anyplace in House Assistant.
For instance:

% from 'instruments.jinja' import answer_question %

Which is able to output:

Is the kitchen mild on?

An unbelievable contribution! Thanks, @depoll!

Reusing templates documentation

More new templating features

As if the reusability of your macros wasn’t good enough already, there
is much more templating goodness in this release!

Thanks, @depoll, @ehendrix23, @petro31, and @rokam, for these superb
additions down beneath! ❤️

Adjusted behavior of relative_time and today_at

@Petro31 modify the habits for template entities utilizing the relative_time
and today_at template capabilities to replace their state as soon as a minute. Good!

New is_hidden_entity function

The brand new is_hidden_entity function was added by @depoll, which may inform
if a given entity has been marked “hidden” or not. This operate additionally works
as a take a look at. Cool!

This instance returns an inventory of all entities within the kitchen space that aren’t


New areas function

Talking about areas, @rokam added an areas operate, which returns an inventory
of all areas you might have!

A simplistic instance:

Added break and continue for use in for loops

@depoll added help for break and proceed in for loops, which permits
short-circuiting these loops, permitting you to make them extra environment friendly.

%- for worth in vary(10) %
    %- if worth == 1 -%
        %- proceed -%
    %- elif worth == 3 -%
        %- break -%
    %- endif -%
%- endfor -%

New has_value function

Lastly, @ehendrix23 added a requested template operate from the Month of
“What the Heck?!”: has_value. The has_value operate may also be used as
take a look at and may filter out entities at present in an unavailable or unknown

You would use this conditionally, like so:

% if has_value('sensor.train_departure_time') %
  The prepare leaves at  states('sensor.train_departure_time') 
% endif %

Or, possibly checklist all entities from the lounge that at present haven’t any state


Database scalability

As your smart home grows and you add more devices, this means more data to keep
track of. This release includes significant advancements to the recorder
database design to help Home Assistant scale.

This version has a new database format that reduces the space needed to store
history for your devices. This change comes with a few benefits:

  • Smaller (deduplication), less disk usage
  • Reduced disk IO (SD-card lifetime improvements)
  • Reduced CPU-usage 📉
  • Quicker startup 🏎️
  • Faster history graphs and logbook
  • Reduced latency in the entire system which means less waiting from the time
    you hit a button until an action completes 🚀
  • Home Assistant now keeps history when renaming entities 🤘

If you are accessing the database directly, check out the Data Science Portal
and the SQL Integration for up to date instance queries.

It might take some time to finish background knowledge migration, relying on the scale
of your saved knowledge. To make sure House Assistant retains historical past when renaming an
entity, wait 24 hours after upgrading earlier than renaming.

New selector capabilities

Selectors are user inputs for the user interface
that drive things like Blueprints. A new selector for use
in Blueprints has been added by
@emontnemery and @piitaya: The fixed selector.

The fixed selector supplies an optionally available enter, which returns a set worth
(the fixed) when enabled, in any other case doesn’t present any worth in any respect.

Instance use in a Blueprint:

  title: Fixed selector instance
      label: Enabled
      worth: true

Which ends up in the next:

A screenshot showing the new constant selector.
When checked, the selector returns the set worth.

Additionally improved are the system and entity filters on the Space,
Entity, Gadget, and Goal selectors. Beforehand, you would filter with a
single set of circumstances; now, you’ll be able to move in an inventory of filters.

In case you are constructing Blueprints, this may be actually useful if a consumer ought to
have the ability to choose one in all a number of completely different units.

An instance, this selector lets you choose the battery sensor of
both a Philips Hue RWL020 (US) or RWL021 (EU) distant in your Blueprint.

    - integration: deconz
      producer: Philips
      mannequin: RWL020
    - integration: deconz
      producer: Philips
      mannequin: RWL021
    - area: sensor
      device_class: battery

Translating entities

Over the past releases, we’ve been slowly extending translation support in more
places in Home Assistant. This release completes support for translating

This includes the entities’ names, their attributes, and translations of
the attribute values. These translations will be visible on your dashboards,
dialogs, automation editors, etc. Pretty much all places displaying them.

Integrations have to explicitly add support for these. Quite a few integrations
have done so in this release, but we expect many to follow in the upcoming

Other noteworthy changes

There are much more easter bunnies in this release; here are some of the other
noteworthy changes this release:

  • @ArturoGuerra added help for locks to Matter! Good!
  • The brand new mild entity dialog (launched final launch) now higher helps
    white mode. Thanks, @piitaya!
  • @emontnemery added vitality storage and quantity storage system lessons; these
    will permit differentiating between, for instance, consumed vitality versus saved
    vitality in a battery.
  • @starkillerOG is rocking the Reolink integration. It now supplies button,
    change, siren, choose, quantity, and lightweight entities for all types of stuff you
    Reolink cameras and doorbells can do. Superior!
  • The Common Media Participant now helps shopping media! Thanks, @Drafteed!
  • The Supervisor integration now supplies sensors containing the
    House Assistant Core and Supervisor’s stats. Thanks, @ludeeus!
  • The Spotify integration now helps podcasts! Good @BTMorton!
  • LIVISI Sensible House now helps local weather units, switches (PSSO, ISS,
    and ISS2), and window sensors (WDS). Thanks @StefanIacobLivisi & @planbnet!
  • ESPHome now helps pairing Bluetooth units. Good work @bdraco & @jagheterfredrik!
  • @MarkGodwin prolonged the TP-Hyperlink Omada integration to help replace
    entities; superior!
  • All solar.solar entity attributes are actually additionally obtainable as sensors, a lot
    simpler to make use of, thanks @gjohansson-ST!
  • Covers with the door system class, now seem as precise doorways in HomeKit,
    good @Dexwell!
  • @loongyh did one thing related for Google Assistant. Covers with the
    window system class now present up as precise home windows. Thanks!
  • The SQL integration now helps settings system and state lessons, thanks @gjohansson-ST!
  • @teharris1 added help for the brand new Insteon i3 system, cool!

New Integrations

This launch has no new integrations, however does present a few new digital
integrations. Digital integrations are stubs dealt with by different (current)
integrations to assist with findability. These are new:

Integrations now available to set up from the UI

The following integrations are now available via the Home Assistant UI:

Release 2023.4.1 – April 6

Release 2023.4.2 – April 8

Need help? Join the community!

Home Assistant has a great community of users who are all more than willing
to help each other out. So, join us!

Our very active Discord chat server is an excellent place to be
at, and don’t forget to join our amazing

Discovered a bug or situation? Please report it in our issue tracker,
to get it mounted! Or, verify our assist web page for steerage for extra
locations you’ll be able to go.

Are you extra into e mail? Signal-up for our Constructing the Open House E-newsletter
to get the most recent information about options, issues taking place in our neighborhood and
different information about constructing an Open House; straight into your inbox.

Breaking Changes

In case you are a customized integration developer and wish to find out about breaking
modifications and new options obtainable on your integration: Be sure you comply with our
developer blog. The next are essentially the most notable for this launch:

Farewell to the following

The following integrations are also no longer available as of this release:

All modifications

In fact, there’s much more on this launch. You could find an inventory of
all modifications made right here: Full changelog for House Assistant Core 2023.4