Considering a change of direction
I’ve been working on the next release of HASP for… well it feels like it’s been a long time. There’s a lot coming
After working out the HASP firmware updates I’ve dug into the Home Assistant automations and maybe have gotten a little carried away. Above you’ll find a demonstration of some of that effort. What I’m not showing you is the YAML that created it - that one page is now more than 700 lines of not-very-comprehensible YAML.
This is the result of an idea I had, where I could create much more complicated automations and then provide a Lovelace UI that simplifies the use of these automations. That experiment is working and after a few weeks of work I have several pages which have been modified in this way. It’s slow going, but the result is really nice. As a user, you have the ability to do things like select a scene to trigger from a list of scenes, a nice button to go edit those scenes, and it’s all right there in Lovelace. Cool!
… right up until you decide you want one of the scene buttons on Page 1 to be something that isn’t a scene button. Then you have 400 lines of YAML to wade into, all of it references some other part of the automations, and it isn’t at all clear which part you would need to disable in order to create your own automation.
In creating a very-easy-to-use interface for the first-time user, I’ve also created a system that is nearly impossible to modify past the default options. This is really bugging me, because I want all of y`all to be able to make HASP your own project instead of a copy of my project. This should do what you want, and I have no idea what you want, so I’m just making it do what I want and hoping that’s going to work for you.
That’s probably bad because, in the words of Operation Ivy, “all I know is that I don’t know nothing.”
So what now?
A while back back @cbrochar asked me to check out the new Home Assistant Blueprints feature. And I did, for like 5 minutes, and determined they wouldn’t work. Later I went and dug a little deeper, ran into the same problems in my own mental model of how HASP should work, and then again determined it wasn’t going to work.
Third time’s a charm I guess, because this weekend I’ve been digging deep into what might be possible and discovered the problem isn’t Blueprints, it’s my own brain, and fortunately I can fix that problem by being smart instead of being dumb
With blueprints I (or others) can publish an automation which does all the things one needs to do to populate and interact with a single button. As part of deploying that blueprint you are able to determine which blueprint will be applied to each button. So if you want page 1 to have a clock, a scene control, and a couple toggle switch buttons, no problem! Just deploy a clock blueprint, then a scene control blueprint, and then a couple toggle blueprints.
Here’s what deploying the “Trigger Scene” blueprint looks like:
One selects a blueprint to deploy and then fills in the required values: which HASP to use, which page, which button, which scene to trigger, what text to display on the button, and what font to use. Click save and now it’s deployed. If you want to make another button with similar settings (say, page one button 5 instead of button 4), you can copy the existing automation and just modify the parts you want changed.
This post is getting way longer than I intended so let’s cut to the chase.
Pros and Cons
- The existing method of packaging automations provides for the most flexibility if you’re an automation wizard. All features of Home Assistant are available, and you can use things like helper objects, Lovelace GUI interactions, or have a mess of spaghetti automations that all reference each other. Sky is the limit.
- The packaged automations all show up on day one. Run
deployhasp.sh
and boom you have a HASP that does the things I think someone wanted it to do. Flip through screens and they all have things on them.
- Packaged automations are challenging to modify, and with each release, I wind up changing some part which means any modifications you made now require wading through thousands of lines of YAML to figure out what’s new.
- Packaged automations all “do things” but those things are my things, not your things. Making it do your things brings you back to the problem above.
- Using blueprint automations means
deployhasp.sh
has less to do, and after it runs you are the proud owner of a HASP with nothing on it. You need to do more work at step one to get HASP to be useful.
- The current HASP UI has 58 buttons you can assign (excluding the page control buttons on the bottom). That means you need to roll out 58 blueprints, one by one, in order to populate all of them. This feels like a lot of work, but the default automations almost certainly didn’t do anything useful for most users, so instead you had thousands of lines of YAML code and far more than 58 automations to review to make use of those buttons.
- Blueprint automations can mean you have total control over how your HASP works. You can setup each button to do the things you want through a simple workflow.
- Blueprint automations should make it much easier for individuals to contribute their own HASP automations. Right now, that is pretty effin difficult. I think it’d be great if we had some easy way for people to contribute their own HASP hacks, and blueprints seem like a way to make that happen.
HOLY WALL OF TEXT BATMAN
Yeah OK sorry about that, I’ve been working on this a lot and wanted to check in with you folks before I spend another few weeks chasing down an idea that everyone hates. This is the part where I ask you, the person who for some reason decided to read all of this crazy stuff, to tell me what you think
So… what do you think?