I wrote a series of articles describing in detail how I define all my electronic devices and automate them entirely with Nix.
Defining your house in Nix is awesome and fun - before you know it, you’ll have forgotten about that other service that used to automate your home non-declaratively.
I would say it’s pretty beginner friendly - Have fun & enjoy!
This is pretty cool, very interesting ideas. From reading your tutorial however I get the impression that automation must be handled by the coordinator in your setup, do you support ZigBee bindings to avoid that dependency?
there are other ways to run your home than with a big locked pool of Python dependencies
Are you aware of the NixOS module for Home Assistant that actually does not use upstream’s mechanism of pulling in random packages from PyPI? Instead, it uses the usual python3Packages from Nixpkgs (except for a few overrides)
Using that has the advantage of integrating with many more devices than those using Zigbee.
It 100% is. Home Assistant automations can e.g. be specified in the list services.home-assistant.config.automation. You can easily translate the YAML code for existing automations into Nix.
I personally set
so that people in the household who want to automate stuff without touching Nix code can do so in the UI. The two can coexist.
Note that setting up most integrations nowadays requires clicking buttons in the UI though.
You asked about making it more declarative
I don’t like that they got rid of cofiguration via YAML but it’s not that big of a deal IMO since touching the Home Assistant UI is only required when setting up a new integration, so not even for adding Zigbee devices.
Yes I am aware. Can you give some examples of those other (non-Zigbee) devices?
Maybe I am not quite awake yet, but I think I don’t understand why I would need Home Assistant to control them?
For example - if I want to control my TV I use ADB, why on earth would I go HA > ADB? Seems redudant to me.
You might want to activate a specific lighting scene when the TV is turned on.
A great use for home automation is running energy-hungry devices only when solar power is available, which requires Home Assistant to connect to your inverter.
Or what if you already own e.g. Z-Wave devices but want to add Zigbee devices?
And don’t forget about the option to build DIY devices using ESPs.