If-then(-else) actions are finally coming to Home Assistant

Disclosure: This post contains affiliate links. If you click through and make a purchase, I will earn a commission, at no additional cost to you. Read my full disclosure here.

I can't claim to be an expert in programming, but when I started experimenting with BASIC and later C, it was all about the if-then-else conditionals. Throughout the last twenty years, this very basic conditional has stuck with me and after porting the majority of my automations from Node-RED to the Home Assistant Dashboard, it was something I sorely missed. While the Choose action does allow me to create anything from basic to advanced if-then-else structures, I always longed for a simpler and cleaner way of doing this.

A screenshot of a Home Assistant automation showing the new if-then-else function. This function is being used to turn on a light if a motion sensor detects any motion.
This is what the new if-then(-else) action looks like

As it turns out, I wasn't the only one yearning for such a function. With the release of Home Assistant Core 2022.5 our calls have been heard, as Home Assistant now finally supports an if-then(-else) action. This type of action won't allow you to do anything you couldn't do before, but it will make the creation of automations easier and faster.

A portrait photo oif Liam Alexander Colman, the author, creator, and owner of Home Assistant Guide wearing a suit.

About Liam Alexander Colman

is an experienced Home Assistant user who has been utilizing the platform for a variety of projects over an extended period. His journey began with a Raspberry Pi, which quickly grew to three Raspberry Pis and eventually a full-fledged server. Liam's current operating system of choice is Unraid, with Home Assistant comfortably running in a Docker container.
With a deep understanding of the intricacies of Home Assistant, Liam has an impressive setup, consisting of various Zigbee devices, and seamless integrations with existing products such as his Android TV box. For those interested in learning more about Liam's experience with Home Assistant, he shares his insights on how he first started using the platform and his subsequent journey.

Leave a comment

Share to...