My goal: better scaling, less customized automation code
I want a layer on top of Automations (like Blueprints) where you can say “for this set of buttons and occupancy sensors, map them to the standard set of actions, and have them control the standard lighting scenes.” It’s almost like creating an application that can manage all my lighting-based controls.
I wrote a guide on how to improve your Home Assistant automations and how I use long-running scripts waiting on triggers with loops and cancellation to show you how complex I have to make it:
Even though the way I do it is overly complex, I think everyone should be using Home Assistant automations like that if they scale up to more than a few devices. Not that anyone can easily manage that stuff unless they live and breathe code all day like I do.
Scaling up Automations is awful
Something I’ve noticed after using Home Assistant for 3 years is how badly it scales the more devices you have.
With how they hide Trigger IDs in Automations and Fields in scripts, it’s like the Home Assistant dev team wants you to have hundreds (or thousands in my case) of nearly identical super simple automations rather than a standardized way of configuring devices for similar actions.
Visualizers may have advantages (side tangent)
I think Automations are the reason people like Homey, but I’ve never used it myself. It looks cool at least. I love the visualization. It’s just like the “Traces” view but better! Not sure if it gives you the power to scale up though. I bet you it doesn’t.
Since I brought up Homey, I’ll note I also tried the C.A.F.E. add-on for Home Assistant. It needs a ton of work and doesn’t seem ready for prime-time. It’s basically unusable without custom names on every task because it doesn’t auto-generate them like Home Assistant, and it doesn’t support Scripts… WHAT? That’s where the bulk of my logic lives! Being only a visualizer, I don’t think it helps you scale up either.
Button triggers are the worst
I added a ton of smart buttons (wall switches) that I need to add to each of my automations. Doing so is insanely annoying and not something I can do from my phone. That’s the worst part about all of this.
To add a new button, I need to:
- Go into an automation where I already configured a similar button.
- Go to YAML view and copy out all that button’s triggers.
- Paste those triggers into my existing room automation also in YAML mode.
- Go back to friendly view, duplicate one of the triggers, change the device to the new button (it resets that trigger “device offline”).
- Go to YAML, copy the device ID and paste onto all of the other triggers, then remove the “device offline” trigger you duplicated earlier.
Why is that so many steps to do? Why can’t I simplify that creation significantly? It’s super annoying and takes forever to do. With lights and occupancy sensors, I just add them to a Group helper. Not great to do repeatedly, but it works. Buttons don’t give you entities, so you need to manually set them up each time even if every single button or wall switch does the exact same function!
A better solution
I’d like to see a better solution in Home Assistant to manage higher-level automation groups with script-like configurations. I wanna associate a set of data properties, devices, light entities, etc and throw those into an automation 'n have it do all the heavy lifting.
I dunno why I have to manually do all this copy-paste work when it’d be better to create “script-like” entities for devices that fire events like buttons.