Writing Home Assistant automations using Genservers in Elixir ★

submited by
Style Pass
2024-10-08 05:30:05

I’ve been a fan of Home Assistant a while now; it’s a great platform for home automation with its beginner friendly and feature rich UI, support for a ton of different devices and integrations, and there’s a bunch of ways to create automations.

While I’ll try to be as detailed as possible I’ve made some simplifications and I won’t provide the complete source code for everything in this post. If you want to follow along I encourage you to fill in the blanks and make adjustments where applicable.

Ever since I started with home automation I’ve thought that it would be a great match for the concurrency model that Elixir uses. You’ll have all sorts of automations running concurrently, reacting to different triggers, waiting for different actions, and interacting with each other; something I think Elixir excels at.

Now, there are many options for writing automations for Home Assistant that already work well, the biggest reason I wanted to use Elixir is because I like it. That Elixir happens to be a good fit for home automation is just a bonus.

Leave a Comment