I'm getting extremely fed up with doing stuff in Home Assistant and I can't be the only one to be maddened by everything in it. It's such a dogshit system under the hood, I just don't understand how anybody thought any of this was a good idea.
It uses three completely different, incompatible and all terrible programming languages to achieve stuff. You can do stuff with YAML, Jinja3 Templates and Python. But none of it is straightforward, no no no. YAML isn't hard, right? How hard could it be? Well, it gets a whole lot harder if you use completely random, nonsensical names for your interfaces. An interface is not an interface, it is a platform. An API isn't an API, it's a platform. Wait, what? Multiple different things are named the same?
Want to set up multiple actions in yaml? Guess how you enumerate them? Do you use an array? Do you just use dashes for each item? No, no, noo.... you put an 's' after the platform name. Just setting up a single automation across all of your home assistant?
automation:
[put your stuff here]
Need to have more than one?
automations:
- automation 1:
[stuff 1]
- automation 2:
[stuff 2]
Oh and you thought this was universal? Nooooo no no no no no why the fuck do you even think any of this is consistent. Only 3 out of like two dozen default platforms support this syntax. The rest uses an entirely differently named platform to enumerate multiple actions. Because of course.
But hey, now you need to do some math or formatting in your automations? You usually do. There's a native python engine in... wait a second, no, we can't have nice things in HA. Why use a fully functional, debuggable, logically consistent programming language most people already know if you can use Jinja! A templating engine. What's a templating engine? Well, it's a dogshit fucking horrible way to do anything that nobody should ever use and should die in a fire, that's what it is. Sometimes it's sort of like python if you squint. But most of the time it's just the weirdest shit in the world. It supports variables you can set! But oh wait, you don't just want a number or string? You need an array? What in the world should anybody need arrays for? No, let's just not support that. It supports for loops. Well, only a very tiny subset of for loops, it doesn't do foreach or really any true iteration. There are no while loops. Oh but despite requiring a separate keyword to assign values, it still requires a double == for comparisons even though there is no contextual confusion. The best thing? Even though nobody uses templates and it's arcane, incomplete and inscrutable bullshit, there is no debugger! There is nothing to check your work. Made a mistake, or even not a mistake but you're just ingesting data that isn't formatted the way you expected or anything like that? Enjoy getting TemplateSyntaxError: expected token 'end of statement block'. Where? Somewhere in all of your code. Line number: start of your code. No position. No hints. Just write your code 100% perfectly the first time.
But Python does exist! You can write what is called an integration in Home Assistant. Integrations do not integrate into home assistant. Obviously. They're apps. Written in Python! That should be easy to do oh no wait, why make things obvious if you can require literally 5kB of boilerplate across multiple files, including a yaml file which definitely isn't python, just to start? And then have no IDE, no autocomplete, no debugging in test (yes, we're debugging in production, people!), no deployment framework, nothing.
Did I mention Home Assistant itself is web-based and runs, obviously, on javascript and CSS for its frontend? You think you can access any of that? No of course not, because why should you make things easy. Enjoy your misaligned visual elements! Try fiddling with yaml and python to somehow propagate all of that to fix UI bugs!
Anyway, I'm going to build some LEGO now. Anybody else need to vent?
It uses three completely different, incompatible and all terrible programming languages to achieve stuff. You can do stuff with YAML, Jinja3 Templates and Python. But none of it is straightforward, no no no. YAML isn't hard, right? How hard could it be? Well, it gets a whole lot harder if you use completely random, nonsensical names for your interfaces. An interface is not an interface, it is a platform. An API isn't an API, it's a platform. Wait, what? Multiple different things are named the same?
Want to set up multiple actions in yaml? Guess how you enumerate them? Do you use an array? Do you just use dashes for each item? No, no, noo.... you put an 's' after the platform name. Just setting up a single automation across all of your home assistant?
automation:
[put your stuff here]
Need to have more than one?
automations:
- automation 1:
[stuff 1]
- automation 2:
[stuff 2]
Oh and you thought this was universal? Nooooo no no no no no why the fuck do you even think any of this is consistent. Only 3 out of like two dozen default platforms support this syntax. The rest uses an entirely differently named platform to enumerate multiple actions. Because of course.
But hey, now you need to do some math or formatting in your automations? You usually do. There's a native python engine in... wait a second, no, we can't have nice things in HA. Why use a fully functional, debuggable, logically consistent programming language most people already know if you can use Jinja! A templating engine. What's a templating engine? Well, it's a dogshit fucking horrible way to do anything that nobody should ever use and should die in a fire, that's what it is. Sometimes it's sort of like python if you squint. But most of the time it's just the weirdest shit in the world. It supports variables you can set! But oh wait, you don't just want a number or string? You need an array? What in the world should anybody need arrays for? No, let's just not support that. It supports for loops. Well, only a very tiny subset of for loops, it doesn't do foreach or really any true iteration. There are no while loops. Oh but despite requiring a separate keyword to assign values, it still requires a double == for comparisons even though there is no contextual confusion. The best thing? Even though nobody uses templates and it's arcane, incomplete and inscrutable bullshit, there is no debugger! There is nothing to check your work. Made a mistake, or even not a mistake but you're just ingesting data that isn't formatted the way you expected or anything like that? Enjoy getting TemplateSyntaxError: expected token 'end of statement block'. Where? Somewhere in all of your code. Line number: start of your code. No position. No hints. Just write your code 100% perfectly the first time.
But Python does exist! You can write what is called an integration in Home Assistant. Integrations do not integrate into home assistant. Obviously. They're apps. Written in Python! That should be easy to do oh no wait, why make things obvious if you can require literally 5kB of boilerplate across multiple files, including a yaml file which definitely isn't python, just to start? And then have no IDE, no autocomplete, no debugging in test (yes, we're debugging in production, people!), no deployment framework, nothing.
Did I mention Home Assistant itself is web-based and runs, obviously, on javascript and CSS for its frontend? You think you can access any of that? No of course not, because why should you make things easy. Enjoy your misaligned visual elements! Try fiddling with yaml and python to somehow propagate all of that to fix UI bugs!
Anyway, I'm going to build some LEGO now. Anybody else need to vent?

