Homex - A bridge between Elixir and Home Assistant

I am using Home Assistant and love that it gives me the freedom to mix and match almost any device in a unified platform. To open this amazing platform for Elixir and especially Nerves devices, I built Homex.

Homex uses MQTT and takes care of:

  • Autodiscovery
  • Supervision
  • Automatic Reconnection
  • Message deduplication
  • Timed measurements

Be it a temperature sensor, a light switch or just internal state. This makes it especially interesting for Nerves devices to integrate with some hardware directly but you can also use it to switch feature flags in your day to day Elixir application.

A simple example would be:

defmodule MySwitch do
  use Homex.Entity.Switch, name: "my-switch"

  def handle_on(entity) do
    IO.puts("Switch turned on")
    entity
  end

  def handle_off(entity) do
    IO.puts("Switch turned off")
    entity
  end
end

I’ve recently released the first 0.1.0 version and very interested in some brave testers and feedback. If you want to learn more how it’s build and the thoughts behind it, there’s a blog post in the links down below.

Links:

17 Likes