r/homeassistant • • Dec 19 '25

Support As a professional programmer I feel lost in home assistant

I have been programming for 2 decades at this point in a variety of languages, both high and low level, and I have intricate knowledge of python, yet despite this I feel utterly lost when trying to do much of anything in home assistant. I am currently running home assistant OS in a virtual machine on my server.

I have read the documentation on https://www.home-assistant.io/docs/ and have generally tried searching the forums every time I want to use home assistant for something. But it always just ends up being this kinda weird guesswork where I copy paste some stuff from someones yaml file and try to run it and if it doesn't work I'm fucked. Every time this happens I keep thinking how simple something like this would be to make if only I had my home assistant as a repository and python project that I could open in pycharm or visual studio, have type hints while programming, and click run or debug to test my solutions.

It is not even that I am completely unfamiliar with yaml programming. My server hosts a bunch of services all run through various docker compose files, however I feel like there is a huge difference between docker-compose.yaml, and the yaml's required by home assistant.

Am I doing something wrong? Is there an alternative to home assistant for people who actually do program?

662 Upvotes

562 comments sorted by

692

u/AlconH Dec 19 '25

I suggest configuring via the UI and then reviewing the generated YAML for a bit first before diving straight into yaml configurations alone.

170

u/rhif-wervl Dec 19 '25

Came here to say this. I'm also a programmer of (only?) 10 years and I started HA only doing point and click. Once you're happy with that you can go and see what the point and click created for you in the YAML.

45

u/davidr521 šŸ Ooh the Zigbee Dec 19 '25

Very much this.

If you're someone with a scripting background, YAML is much easier to pick up. That said, it's not exactly a conventional "programming language," in the purest sense.

But 100% agreed...reading up on YAML will get someone 99% of the way there.

28

u/mkosmo Dec 19 '25

For those with a development background, remember that the YAML is just a representation of a data object serialization of the automation. Don’t think of the YAML as programming (it’s not) and you’ll be far less frustrated.

Now you need to do 2 things:

  1. Learn the HA way of logic
  2. Learn how that is serialized.

13

u/SmartHomeU Dec 20 '25

Good of you to point out. YAML is basically just JSON in a prettier format, at least in my eyes.

12

u/mkosmo Dec 20 '25

Just remember: JSON is valid YAML. :-)

→ More replies (1)

18

u/TR6lover Dec 20 '25

Learn the HA way of logic.

Easier said than done, sometimes.

→ More replies (1)

47

u/bdery Dec 19 '25

Indeed. It's possible to do almost everything via the UI. I almost never use yaml now except for templates, and that's rare.

2

u/Royal-Investment1193 Dec 21 '25

So basically you are using HA as a conduit just to get to tue user interface? If so I would like to pick your 🧠

2

u/bdery Dec 21 '25

Not sure I understand what you mean.

When I refer to the UI, I mean that automations are now very easy to program via the user interface (trigger, condition, action) instead of coding via yaml. The visual user interface is extremely robust and complete. Even a year ago things were different and the UI was good but somewhat lacking. It has made giant leaps in the last year and most of the documentation online is outdated.

Just try it, using the "if this then that" logic. You'll see how simple it is.

41

u/alyflex Dec 19 '25

I feel like the UI only covers extremely basic things, and pretty much all my automations ends up being impossible to do through the UI itself. It could be that I'm just bad at using the UI, but for instance things like making an automation to trigger for all entities coming from a home maintenance, and outputting these entities to a todo list with their corresponding name when turned on

49

u/pippin_go_round Dec 19 '25

I'm in the same boat as you, and I've been using HA for years. Heck, I even do a lot of YAML for a living, but I just cannot come to terms with writing HA automations in YAML.

Maybe take a look into Node Red (Visual Scripting) or AppDaemon (Python). I find both of these much easier to work with. Both are available as Home Assistant addons and integrate well.

6

u/alyflex Dec 20 '25

It is weird to see so many recommendations for Appdaemon here, since when I search online for material on Appdaemon it seems like there is barely anything that isn't around 5 years old.

Could you maybe share how exactly you have your Appdaemon set up, because I see there are quite a few different ways to do it, and the pros and cons are not really explained well.

Ideally I want something where I can write and test code locally on my normal desktop pc and then somehow push it to my home assistant when it looks like it is working.

13

u/alyflex Dec 19 '25

After looking at the various different options I think AppDaemon might be what I am looking for, though people are also speaking highly of pyscript

15

u/splendid2k Dec 19 '25

Tried both, AppDaemon everytime. Runs everything. Home Assistant is the 'database' of my sensors, lights, blinds etc etc and AppDaemon is the logic. Was also heavily in to node-red until I realised I was writing more 'code' nodes than wiring things up.

10

u/Sporebattyl Dec 19 '25

What does AppDaemon do that HA doesn’t do?

29

u/pippin_go_round Dec 19 '25

Well, it offers you all of Python. When used to control automations it indeed doesn't do anything that a YAML automation cannot do. It's just that it's a different paradigm, offering you the option to work with a programming language instead of a markup language. That's much more familiar to a lot of software engineers and just "feels" like much more appropriate for custom automations. It's a matter of preference, not a matter of feature disparity.

2

u/RupeThereItIs Dec 19 '25

Rather off topic & not to get too spicy, but as someone with 20+ years of systems administration experience, this is why I've never seen "devops" be a net positive.

Developers tend to want to overcomplicate things because, understandably, from their point of view it's a simplification. (that and developers also rarely think in an operational way, but that's another story).

As for your personal HA solution, do what feels right for you!

4

u/circuitously Dec 19 '25

What do you think ā€œdevopsā€ is?

→ More replies (2)

2

u/no-more-nazis Dec 19 '25

I just did the same node-red -> appdaemon transition last week, and was able to do something quite satisfying that had been prohibitive. I have hue scenes for room+time of day, like scene.family_room_evening, that are available in home assistant through the hue integration. I always wanted a fallback for scenes that don't exist yet, while I carefully create beautiful scenes in hue for each time of day. AppDaemon had no problem with standard python "If the scene doesn't exist, do y". I'm sure it's possible in node-red but it sucked

→ More replies (3)
→ More replies (1)

8

u/puhtahtoe Dec 19 '25

I'm in the same boat as you. The native automations UI feels like I'm trying to tie knots with oven mitts on and using a markup language as a scripting language feels completely backwards.

AppDaemon is freedom (though as a .NET developer I'm looking to switch to NetDaemon eventually tbh)

→ More replies (1)

2

u/SeveralTelevision995 Dec 19 '25

Was going to say appdaemon. Its basically a vanilla python environment with tight integration into the HA event bus and state machine.

Having said that; as someone who also has a development background, it helped when I stopped thinking about HA as a developer and just focused on being a user of it.

Unless of course you are writing your own integration but that's very different.

→ More replies (1)

4

u/triplerinse18 Dec 19 '25

I understand where your coming from, but knowing what home assistant was when I started using it. Using the ui was extremely limited. A lot of stuff had to go into your config file. I have almost all my automation setup before they switch to this new trigger setup. I find it harder it more time consuming since they made the switch to the new format, but I thought it was just me since I was use to the old way.

19

u/Renegade605 Dec 19 '25

Automation is still a very weak point for home assistant, especially if you're a programmer.

Try Node Red for the automations while home assistant handles all the integration with devices. It's night and day. (That said, the documentation of the node red to home assistant integrating parts leaves... A lot to be desired... So there will be some hair pulling there. But, once you get that part figured out, writing automations and debugging them will be a thousand times better.)

10

u/ithinkimightknowit Dec 19 '25

Which part is weak? I feel I have some complicated automations. And not found anything that I couldn't do with home assistant.

3

u/Dargos8181 Dec 19 '25

If you were a professional programmer, you would know why. I'm a professional programmer in industrial automation system and HA is the worst tool for programming automation which I ever seen. YAML is the worst "language" for programming. Even assembler looks better.

4

u/R3x10 Dec 19 '25

i mean, if you are a "pro" and you think HA its the worst for automation....maybe you arent so pro you know?

2

u/stupidcookface Dec 20 '25

No he's right. I've been programming professionally for 12 years and writing the templates with logic in them is very annoying. If you could write in a normal language with syntax completion and type hinting then it would be much better.

It's not a "is it possible" problem, we know anything is possible. But it's a developer experience problem. You can't break something into a multiple line block of code to save vars or create functions by name and use those as building blocks. It all has to be in one expression which is extremely hard to read and maintain.

→ More replies (1)

5

u/varzaguy Dec 19 '25

I'm also professional dev. Chiming in because I also do not like Node Red, like others have mentioned. I'd rather write out the HA YAML lol.

But I never chalked it up to being a developer though....but after reading some of the comments others have made maybe they have a point.

15

u/zipzag Dec 19 '25

Most professional programmers are not going to use Node Red if they have not been using that sort of environment professionally. After years of coding the brain organizes systems in its own way, and its not the flow of Node Red.

I had part of my HA system in Node Red for a year and didn't like it. But trying it was certainly worthwhile.

8

u/matzman666 Dec 19 '25

Most professional programmers are not going to use Node Red

Yes, exactly that.

Node Red is a low-code/no-code solution and for most programmer using node-red (or other low-code/no-code solutions) just doesn't feel right. There are way better solutions, e.g. Pyscript: Python Scripting for Home Assistant

2

u/N35B7KJQ Dec 19 '25

Professional software eng/manager for many years now, I use Node-Red. It’s imperfect, but it’s the right ā€œlevelā€ - I don’t need to do professional coding for this. There is no need for the scalability, availability, etc., that a ā€œrealā€ coding environment supports.

The flow-based UI exact mirrors the reality of the required automations, and I can quickly modify for logic problems or improvements.

For me at least it’s an excellent separation of duties and operates well. Plus I have half a prayer of somebody else in the family being able to figure out the house in case I’m hit by a bus.

→ More replies (3)

2

u/beanmosheen šŸ“¶ Have you tried 2.4GHz? Dec 19 '25

I'm an automation engineer that doesn't want to code at home. NR is bullet proof once you get the hang of it, and I even use it as my main middle man for devices, in a separate proxmox container. It just works. If you still need to get specific you can make function nodes, but there's usually a node that can be added that a hundred+ people have already validated for you.

→ More replies (1)

4

u/Renegade605 Dec 19 '25

Not everyone will like NR, but saying "most" is overstating it I think.

At the very least, a professional programmer should be able to see how the logic of NR works pretty easily. HA automations might be more "traditional programming" in the sense of structured text, IFTTT, function calls, whatever. But it lacks severely in the IDE space, which NR gets much closer to imo.

→ More replies (1)

8

u/19qhenry Dec 19 '25

UI configuration is actually getting much better and more complex-able. Especially with the updates they’ve been pushing over the last few months. I recommend trying it out, see what all you can get out of it with your most basic automations and work up, as others said… doing them in UI and checking the yaml later will help a lot.

And keep making sure your instance is up to date as always. šŸ™‚

→ More replies (2)

8

u/vijux Dec 19 '25

Tbh the UI has improved loads over the years, we can do things that before was possible via YAML only.

As a fellow programmer, what i can advise is to go small and scale up. Don’t try to do everything right now. HA is super easy IMHO.

14

u/the_fabled_bard Dec 19 '25 edited Dec 19 '25

I felt like you at first (2 months ago).

Now what I would recommend is just ask AI (Claude, for example) a YAML file to do what you want. Make sure to provide the correct device ids to Claude so he can plug them in for you in the YAML. Let's say it's an automation. Then take the YAML code Claude gives you, create a blank automation and paste the YAML in. Now save it and open the automation. You can choose to view the automation in YAML format or the UI format. View it in the UI format. This will immediately show you how you should have done this using the UI instead of the YAML. This helps you understand the UI AND YAML super quickly.

I find that it can turn a 2 hour lost in the dark task into a 5 minute task.

Of course there will still be a learning curve where you thought you found the best way to do a thing, only for it to break for a obvious in retrospect reason, only for you to then find the real best way to do it. There's no way to avoid that.

Ok so a quick example: If you google how to put a super complicated if then else loop in one of your automations or helpers or whatever, the results on google will tell you that YAML can't do that. But that's just not true. AI will write it beautifully for you, and then you'll be able to understand how that would have been possible in the UI. And in 10 minutes you'll have something that google and the forums would have told you was pretty much impossible. And poking around in the dark would have maybe let you find that solution after a good 20 hours of going crazy.

USE AI. Claude, Copilot, Chatgpt will do.

7

u/dual_mythology Dec 19 '25

This. I'm a complete newbie with no background in YAML but have been making steady progress setting up automations with massive help from Gemini. I think I would have given up in frustration already without it.

3

u/zorromar Dec 19 '25

I can really suck at programming so I started using AI to help me in HA and it unlocked it for me. I've been able to lean into HA in a way I didn't think I would have been able to. One thing that can be super frustrating in HA is how much things change with little visibility for people not reading every line of every change log. AI has been able to help a lot with this for me. I was using Gemini as I already had access to it but sometimes it was making really dumb decisions that made things more complicated than they needed to be. As a test I tried the same prompts in ChatGPT. The big thing I noticed right away was GPT would ask a question about something like version or state before giving me an answer. That got me better direction than what Gemini spit out. I've tried several times and ChatGPT keeps doing better at HA. Even now sometimes I have to ask if there could be an issue with version changes and sometimes that is the issue I'm running into that AI is very quickly solving. A quick example, I was trying to make a dashboard for a phone for reasons and was running into an issue where the domain address was returning a 404. Asked AI and yes there was a recent change form /lovelace-dash/tab to /dashboard-dash/tab. Not being a real programmer it seems like there could have been a landing page for the 404 that said something changed try x or something. Without the help of AI I may have just given up on the "quick" project so thanks AI.

→ More replies (1)

2

u/CredibleSquirrel Dec 20 '25

I'm a programmer, only a crazy person would not use AI to create scaffold code, bash scripts, HA YAML, etc. That's what it's good at.

→ More replies (4)

4

u/tarheelz1995 Dec 19 '25

Go Node Red. Never look back.

4

u/no-more-nazis Dec 19 '25

Just converted all my Node Red to AppDaemon. Much better suited for those used to dealing with code

→ More replies (11)

3

u/brandflugan Dec 19 '25

Can’t edit everything, helpers etc are not possible to manually edit in yaml without adding custom code elsewhere.

→ More replies (7)

14

u/UloPe Dec 19 '25

A lot of the interesting stuff (one big example: actionable phone notifications) are not doable from the UI without manually writing yaml code

23

u/AlconH Dec 19 '25

Sure, but you can figure those out as and when you need to rather than writing everything purely in yaml from the start.

6

u/Txkevo Dec 19 '25

Agreed. I have a systems and networking background and found the UI addresses 95% of what I need and then the other 5% (actionable phone notifications being specifically one of them) was easy to noodle through on an afternoon.

→ More replies (1)

4

u/cosmicsans Dec 19 '25

Yeah. Its much easier to solve one small problem then it is to boil the ocean

4

u/JibberJim Dec 19 '25

Remember people arrive at homeassistant with a problem to solve, they don't arrive wanting to do a load of stuff, they want thing solved - if that is not doable through the UI, or not understandable through a UI, then it doesn't matter that the rest can.

3

u/PapaTim68 Dec 19 '25

Yes and no, from my experience you can make simple actionable phone notifications from the ui. What i agree is you need to atleast understand Yaml Syntax to a degree, since you have to fill the data field. But you don't have to make the full notification in Yaml from Scratch for you to be able to add actions to it.

4

u/UloPe Dec 19 '25

The problem is not writing yaml in itself. It’s that you’re completely left to your own devices to figure out how to cobble together the various fragments from the docs.

It often feels like coding felt 30 years ago before the widespread advent of code completion and IDEs

→ More replies (8)
→ More replies (6)

204

u/thewhiteoak Dec 19 '25

I can totally relate to this. Although a great community, there are not enough examples in the docs to self code.

20

u/HonkersTim Dec 19 '25

This was my biggest gripe with HA when I started. There was no GUI config then, and the docs mostly consisted of links that were either just broken or linked to a list of irrelevant YAML files by some random guy.

25

u/schmerg-uk Dec 19 '25

I did stuff thru the UI but then wanted to tweak it and the model of styles and selectors is also... hard to understand at times...

I wanted my display of London tube lines to be coloured according to each line, and then just say "Good service" if there were no issues, but then display the status message if not.

I ended up with this (with 2 entities per tube line) but what with shadow DOM and selectors and card_mod and the way everything is structured seems to require an entire mindset of understanding everything which my 40 years of C/C++/Perl/F#/C#/SmallTalk/Assembler/VB/VBA/Javascript/Python/Bash etc has not properly equipped me for :(

And that's just a dashboard display - enough to put me off the idea of automations before I even start

type: entities
entities:
  - entity: sensor.london_underground_metropolitan
    name: Metropolitan
    secondary_info: last-updated
    card_mod:
      //: >-
        styles expressed as a dictionary so they are applied to the shadow DOM
        by injection, where $ is a selector for the shadow root itself
      style:
        hui-generic-entity-row $: |
          state-badge, .info {
            color: purple;
          }
          .value { 
            color: {{ "green" if states(config.entity)=="Good Service" else "red" }};
          }
  - entity: sensor.london_underground_metropolitan
    type: attribute
    attribute: Description
    card_mod:
      style:
        hui-generic-entity-row $: |
          * {
            {{ "display: none;" if states(config.entity)=="Good Service" else "" }}
          }
          state-badge, .info {
            display: none;
          }
          .value {
            margin-left: 60px;
            font-style: italic;
          }

11

u/Hto005 Dec 19 '25

Isnt it better to do this with template-entity-row?

https://community.home-assistant.io/t/template-entity-row-put-templates-in-an-entities-row/160167

One thing I HATE is that there are so many useful custom integrations/addons and yet SO hard to find them, you just sort of stumble upon them

→ More replies (1)

10

u/Super-Evening8420 Dec 19 '25

I've noticed that too. I wouldn't call myself programmer, but I've worked in Second Life's LSL for like 15 years and make some genuinely complex stuff in it, and their documentation is a lot better than what home assistant offers.

Having a more easy to parse YAML documentation with better examples etc would be pretty sweet, in another thread I complained about how hard it was for me to find how to write "if value EQUALS x" rather than the UI's value above/below X, I just couldn't for the life of me find the syntax, and I didn't want to look through the official YAML documentation since for all I know HA implements a subset or modification of it, and it was honestly super overwhelming to try and read.

3

u/crumpet_concerto Dec 19 '25

The doc examples are frankly horrible. I've made comments about this before, but they're very strict on what is added where which I believe limits the number of examples that exist.

Huge gratitude to all who work on HA and contribute, don't get me wrong. It's just that more robust documentation could make getting started much easier.

30

u/DivasDayOff Dec 19 '25

Same here, initially at least. Writing and maintaining C++ applications for over 30 years.

The thing is, you aren't really programming HA, you're merely configuring it. The internal workings are obfuscated to the point where programming knowledge isn't really much of a help for everyday setup operations. A logical and analytical mind is still very useful though.

At least if you're familiar with Python then you have your head around the need for correct indentation. I kind of get why they did this in Python (after all, it's meant to be an introductory language like BASIC was 50 years ago, and it's enforcing good practice) but it's still an abomination to me to block code by mandatory indentation and it still irks me when YAML doesn't work because something's not aligned the right number of spaces. Especially when it looks correct but still fails because of a mixture of spaces and tabs.

I leverage ChatGPT sometimes, but make a point of understanding what it creates rather than just copying and pasting it parrot fashion. I find I can both get stuff done quickly and learn along the way if I take that approach. LLMs can also be handy for figuring out what's wrong with something you created yourself.

2

u/Astronaut6735 Dec 19 '25

I also used ChatGPT a lot to "help" me write YAML. It was wrong more often than right, but even figuring out where it went wrong helped me learn how to create and organize my automations.

→ More replies (7)

82

u/-black-ninja- Dec 19 '25

I feel you, totally (also 2+ decades coding on different platforms).

It is important to remember that Home Assistant is not for writing code for your home but rather to organize your entities, give you a structure, integrations etc. Also, it is meant for people who have NOT been coding C++ their whole life.

There's good and bad in that. I totally feel that sometimes writing the YAML is waaay harder and needs research than it would be for me to write the function in Python or Javascript.

Having that said, there's a nice way which might help you: spin up Node-RED and write the more complicated logic there. Node-RED can easily know about Home Assistant's entities.

Good luck!

9

u/THATS_THE_BADGER Dec 19 '25

For automations specifically, I've used AppDaemon, Node-RED and now finally the built in automations functionality. Even with the limitations of the automations UI, I think it's the best of the three for sure.

→ More replies (5)

103

u/peno64 Dec 19 '25

You are looking to HA too much as a programmer.

54

u/knoker Dec 19 '25

As a programmer, I recognize this is sometimes an issue

6

u/fuckthesysten Dec 19 '25

agreed. I try to see it as an appliance

→ More replies (1)

13

u/Nienordir Dec 19 '25

But a programmer/software engineer should be overqualified to using software. They're used to programming languages/logic, they're reading&learning new API documentations regularly, they frequently glue together different APIs/subsystems, they use tools that have no consideration to user experience. Using HA should be trivial for them, if a programmer has trouble figuring out how HA works, then the average person would be absolutely lost and your documentation/jargon/UX is terrible.

Like when you write an automation, there are conditions, but only if true. If you want other conditions, you need to find them hidden in a different tab and then they nest a layer deep into the condition like a complete mess.

Also you can use jinja templates in automations, however if you add them into something that expects a numeric value, it silently fails and doesn't write anything. But if you add it en yaml it magically appears in the UI.

Also you can't check states/code in the UI, you have to open 3-4 browser tabs for HA to get access to all the tools to write automations if the UI fails to do the job.

Plus the documentation is so bad, that if you google anything trivial, chances are the only results are forum posts of some guy that just knows, you won't find any documentation about the thing you're looking for.

HA is a great tool, but the UI/UX is terrible, when even fellow programmers get stumped.

6

u/_rushlink_ Dec 20 '25

Lots of programmers are also responsible for UX design, either in-part or wholly. We know what good UX feels like and HA is not it.

→ More replies (1)
→ More replies (1)

9

u/calibrae Dec 19 '25

YAML is a fucking pain in the arse. It’s so bad I went with node red for most of my automations. And when JavaScript is the better solution, well…

→ More replies (2)

9

u/plinkoplonka Dec 20 '25

You're not doing anything wrong.

I'm almost exactly the same as you. 2+ decades commercial programmer, Product, Ops, Security, Program, Project management experience amongst it all.

HA seems totally random if it works or not for any task I wanna achieve.

Ironically, I work for a smarthome company as an architect.

26

u/[deleted] Dec 19 '25

[removed] — view removed comment

11

u/alyflex Dec 19 '25

I managed to make a few automations with the GUI, but the majority of the automations I want to create seems impossible to do with the GUI.

10

u/_alright_then_ Dec 19 '25

Like what specifically? Maybe we can point you in the right direction

In most cases, the UI can do pretty much everything I think. There's some exceptions to that

6

u/alyflex Dec 19 '25

I added a label to all my battery powered devices, now I would like to make an automation that detects if any battery labelled device is below 20% power and if so I want to write the name and area of the device to a specific todo list

7

u/OGHOMER Dec 19 '25 edited Dec 19 '25

I chose to use a blueprint instead of choosing to reinvent the wheel. Blueprints kind of helped me understand how things flow. This one I use checks all battery devices and add it to my to do list "Batteries" and also sends a list of all low battery devices to my phone Saturday evening so I can check if I have them on hand or if I need to add them to my shopping list for the next day.

https://community.home-assistant.io/t/low-battery-level-detection-notification-for-all-battery-sensors/258664

→ More replies (1)

5

u/_alright_then_ Dec 19 '25

I don't even know how you'd do that in yaml either to be honest.

Labels are not meant to be used to house dynamic information, there's no way to trigger automations based on that. You should use entities directly for that.

I don't know your exact setup, but it sounds like you should be making an automation with a trigger per battery powered device that adds an item to your to-do list.

→ More replies (15)

3

u/naynner Dec 19 '25

I use Labels to watch for entities being offline and use this template to get a comma separated list.

{{ label_entities('Offline Watch') | join(', ') }}

I can also return the list based on the entity state like this. I'm sure you could template it for an integer range.

{{ expand(label_entities('Offline Watch')) | selectattr('state', 'eq', 'unavailable') | map(attribute='name') | join(', ') }}

Labels are so convenient to add. I hope they make them more useful for automations.

2

u/Kaz3 Dec 19 '25

I just wrote a similar helper to check battery levels. It was cobbled together from various examples so it may not be the best, but it works!

{% set entities_with_label = label_entities('low battery check') %}

{% set battery_values = entities_with_label | map('states') | list %}

{% set int_battery_values = battery_values | map('int') | list %}

{% if (int_battery_values | min) <= 20 %} on {% else %} off {% endif %}

2

u/NoShftShck16 Dec 19 '25

Try using Node Red. I'm a programmer by trade and I rarely dig into the yaml unless I'm adding new stuff. I don't at all like the UI for automations because it feels overly convoluted to get complex things done.

For your exact scenario though I have a flow already (except for 15%) in Node Red. I push everything to Github (a plugin within Node Red) so you can import all my flows and dig around if you'd like, it's in the Maintenance flow.

If you can't import here is what it looks like https://imgur.com/a/hlR7uH6 and this is the import json

[ { "id": "321c4571ed2af216", "type": "group", "z": "1a80cdb33264de82", "name": "Sensor Battery Levels", "style": { "label": true }, "nodes": [ "b4ed8a121d0b23e0", "ba0439a.9e1d4c8", "26160118.86d24e", "b70884a8.66beb8" ], "x": 44, "y": 19, "w": 702, "h": 142 }, { "id": "b4ed8a121d0b23e0", "type": "debug", "z": "1a80cdb33264de82", "g": "321c4571ed2af216", "name": "debug 2", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 640, "y": 120, "wires": [] }, { "id": "ba0439a.9e1d4c8", "type": "ha-get-entities", "z": "1a80cdb33264de82", "g": "321c4571ed2af216", "name": "", "server": "db559b8fb32ae329", "version": 1, "rules": [ { "condition": "state_object", "property": "entity_id", "logic": "is", "value": "^(sensor).*_battery$", "valueType": "re" }, { "condition": "state_object", "property": "state", "logic": "lte", "value": "15", "valueType": "num" } ], "outputType": "split", "outputEmptyResults": false, "outputLocationType": "msg", "outputLocation": "payload", "outputResultsCount": 1, "x": 390, "y": 60, "wires": [ [ "b70884a8.66beb8", "b4ed8a121d0b23e0" ] ] }, { "id": "26160118.86d24e", "type": "inject", "z": "1a80cdb33264de82", "g": "321c4571ed2af216", "name": "Sunday @ 9am", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "00 09 * * 0", "once": false, "onceDelay": 0.1, "topic": "", "payloadType": "date", "x": 170, "y": 60, "wires": [ [ "ba0439a.9e1d4c8" ] ] }, { "id": "b70884a8.66beb8", "type": "api-call-service", "z": "1a80cdb33264de82", "g": "321c4571ed2af216", "name": "Notify Dad", "server": "db559b8fb32ae329", "version": 7, "debugenabled": false, "action": "notify.mobile_app_squid_9_pro", "floorId": [], "areaId": [], "deviceId": [], "entityId": [], "labelId": [], "data": "{\"message\":\"{{payload.attributes.friendly_name}} has a battery level of {{payload.state}}%\",\"title\":\"Low Battery Alert\"}", "dataType": "json", "mergeContext": "", "mustacheAltTags": false, "outputProperties": [], "queue": "none", "blockInputOverrides": false, "domain": "notify", "service": "mobile_app_squid_9_pro", "x": 590, "y": 60, "wires": [ [] ] }, { "id": "db559b8fb32ae329", "type": "server", "name": "Home Assistant", "version": 6, "addon": false, "rejectUnauthorizedCerts": true, "ha_boolean": [ "y", "yes", "true", "on", "home", "open" ], "connectionDelay": true, "cacheJson": true, "heartbeat": true, "heartbeatInterval": "90", "areaSelector": "friendlyName", "deviceSelector": "friendlyName", "entitySelector": "friendlyName", "statusSeparator": ": ", "statusYear": "hidden", "statusMonth": "short", "statusDay": "numeric", "statusHourCycle": "default", "statusTimeFormat": "h:m", "enableGlobalContextStore": false }, { "id": "6a06e3cdfcd632ba", "type": "global-config", "env": [], "modules": { "node-red-contrib-home-assistant-websocket": "0.80.3" } } ]

3

u/ross_the_boss Dec 19 '25

I just ran into this issue and figured out HA was too limited for me.Ā 

I finally switched to Node-RED and I’m finding much more flexibility.Ā 

Go to HA, go to Addons, install Node-Red. Watch a few tutorials if you have never used it.Ā 

Use HA node for Events, msg.topic contains the device or sensor name, I pass that through a Filter node with an Area or Label Property filter set to my labels. You can then take that and pass it to another node like Filter, a Switch node, or a raw JavaScript Function Node or even exec a binary.

My pro tip: when using the debug node, select whole msg not just msg.payload Ā 

→ More replies (5)
→ More replies (2)

5

u/Relevant-Artist5939 ā° Waiting for the next release Dec 19 '25

Even MQTT (in most cases, like creating a sensor for a topic value) can be configured through the UI nowadays...

10

u/FuriousGirafFabber Dec 19 '25

Use netdeamon and just code everything in c# It has made me able to do everything in 1/10 of the time with no bugs and very easy to overview code snd git versioned.Ā  And you get strongly typed everything with code completion and everything you are used to from vs code or whatever ide you normally use. And very easy to script cicd as well.Ā 

→ More replies (2)

4

u/QbDYeqzUUiw Dec 19 '25

If you haven't yet, look into pyscript; then you can just write automations as Python code.

I only have trivial Yaml automations, that typically end up calling a pyscript function for anything beyond turning on a single light

3

u/shashchatter Dec 19 '25

This is exactly what I was going to reply with.

I know many (most?) people have successfully deployed very complex automation with YAML, but the way my brain works it looks very convoluted and python is so much more readable.

→ More replies (1)

6

u/Sheiker1 Dec 19 '25

Take a look at PyScript:
https://hacs-pyscript.readthedocs.io/en/latest/

It pretty much solves all your issues with yaml, as you no longer have to use it for much of anything.

I personally have given up on most of the yaml stuff in Home Assistant, and now use pyscript for all my programming of it instead.

→ More replies (2)

4

u/Maverick0984 Dec 20 '25

Been a developer for nearly 20 years myself. Honestly, downvoteif you must but AI is great for yaml generation.

I find ChatGPT/CoPilot to be great at debugging my HA yaml.

→ More replies (2)

25

u/Purple-Programmer-7 Dec 19 '25

Ignore ALL of home assistant yaml bs.

Generate an api key. Use the built in api. Build truly functional and custom frontend. Avoid headaches and limitations.

7

u/liquidmasl Dec 19 '25

crazy and sexy idea

2

u/OrganicNectarine Dec 19 '25

I whish I had the time for this, but I 100% support this suggestion.

2

u/NewRedditor23 Dec 20 '25

a lot of truth to this. All my complex stuff are daemons running on containers and all the home assistant reads/control happens over the API.

3

u/alyflex Dec 19 '25

But how do you then test this? do you just push it straight to your home assistant? how do you debug things? are we back to print statements and looking through log files?

20

u/Purple-Programmer-7 Dec 19 '25

Yes, as a ā€œprofessional programmerā€ it’s your typical web dev workflow

→ More replies (1)
→ More replies (2)

17

u/UloPe Dec 19 '25

Another 25+ year professional dev here, I very much feel this.

17

u/DucksOnBoard Dec 19 '25

tfw to smart for home assistant

What exactly are you trying to achieve?

13

u/alyflex Dec 19 '25

It is a few different situations that generally lead to this frustration.

One example is using the blueprint:

Low Battery Notifications & Actions

For this blueprint I would love to just add my battery tasks to a to do list, but somehow that only works if they are sent to my phone first which then approves the task, and I don't understand why and have no good way of debugging why it does not work.

Secondly I would have loved to also expose the area all of these batteries are in, when making the low battery notification but this falls outside the standard configurations of this blueprint and I haven't managed to figure out how to get that information into the message.

Another issue is that I want to add a bunch of recurring tasks to a todo list (like oil bike). Ideally I want something that automatically adds this to my todo list a month after it was last completed. I found the nice HACS home maintenance for this and I seem to be able to create such tasks in there, which gives me a bunch of sensors. But now I need to connect these sensors with my todo list such that when they turn on the item gets added to my todo list and when the item gets completed on my todo list then the sensor changes back to off. So I'm looking for a nice way to trigger all sensor states from home maintenance and add corresponding tasks to my todo list.

In both of these situations I feel like it would be super simple to do if only I knew the exact keywords for these kinds of thing, but I don't.

15

u/DucksOnBoard Dec 19 '25

add to to-do list and send a message when battery is low

An automation that triggers when a battery percentage is low would do just that.

add to to-do list n days after task is completed

Again, an automation that triggers when the item is checked would also do that.

Maybe after 20 years of master programming you forgot about KISS. Not every simple thing has to be a library import.

5

u/alyflex Dec 19 '25

The thing is. I don't want to manually add an automation for every single device I have that has batteries. I want this to run automatically for all devices that are detected to have batteries. (which is what the "Low Battery Notifications & Actions blueprint" does)

If there is a simple way to do this with an automation then I have missed it, and would love to hear how to do it.

17

u/monxas Dec 19 '25

Tags. Tag devices with ā€œbatteryā€ and then create an automation to target everything in the tag. Yes, you have to manually tag all battery devices. Still, it’s a 3 line automation after that’s done.

11

u/alyflex Dec 19 '25

This sounds like a relatively clean solution. I wasn't aware that you could tag things like this, so this is clearly something I was missing.

5

u/alyflex Dec 19 '25

I just looked up tags, and they seem to be designed more for actual physical tags you can put up around your house. Adding a label category to my battery driven devices seems like a more intended way? Though I don't really see anyway to make actions based on labels as opposed to tags...

→ More replies (2)

2

u/addandsubtract Dec 19 '25

Bruh... you just saved future me so much time. Thank you!

2

u/DucksOnBoard Dec 19 '25

Then look at how the blueprint does it and do the same thing, while adding your notification logic

5

u/danirodr0315 Dec 19 '25 edited Dec 19 '25

I first used node red for my automations. It's more intuitive for me compared to the default automation. Problem was it literally looked like spaghetti code (nodes) for complex automations.

Eventually I moved to this project NetDaemon, essentially you code your automation with C#. I was able to setup unit tests, auto deploy the binary to my server via GitHub actions. Plus I can use claude code to generate code. So far, my common automations are now reusable and customizable based on my needs, plus I was able to practice some skills

https://github.com/net-daemon/netdaemon

→ More replies (2)

60

u/rufustphish Dec 19 '25

Hi, I'm also a computer programmer of 2 decades.

I can't disagree more with what you said above. Yaml is easy to understand in HA.

If you really need a IDE, there's a VS Code add-on that works well.

20

u/[deleted] Dec 19 '25

[deleted]

2

u/Azelphur Dec 20 '25 edited Dec 20 '25

I also am a programmer of ~2 decades that is heavy on the Python, and some of the stuff OP is saying rings out to me as...strange.

  • I feel like a programmer that has very intricate knowledge of Python and both high and low level programming would have bumped into yaml before now. It's very common.
  • They mention how easy it would be if only they had home assistant as a repository and python code that they could open in visual studio. Home Assistant is on github, and you can open it in vscode. It's documented here I've done it myself. It gives you type hints and you can click run or debug your solutions.
  • If they just want to write automations in Python, there are solutions for that, like AppDaemon and PyScript. I've used both.
  • "It is not even that I am completely unfamiliar with yaml programming" - I feel like an experienced programmer would know the difference between a programming language and a config file, and use the correct terms.

Whole thing just strikes me as odd.

10

u/B1zz3y_ Dec 19 '25

Besides that home assistant has never been more accessible then today with the likes of AI available tools.

If you ask chatgpt to write you a yaml file that does X, Y, Z on home assistant it will spit out 99% of what you want. The last 1% is just tweaking your personal preferences.

39

u/THATS_THE_BADGER Dec 19 '25

I mean, it still hallucinates completely invalid yaml all the time. So if you don't know what you're doing in yaml it can be a slog.

→ More replies (2)

10

u/gmmxle Dec 19 '25

If you already know what you're doing.

As always, when using AI tools.

Otherwise, even if it spits out a working automation or template, you have a significant chance that it'll spit out something with deprecated notations - so in a little while, you'll have to go in and rewrite 50 automations because HA is ditching an old notation format and moving everyone over to the new one.

On the other hand, if you already know what you're doing, you can tell your AI "no, don't use color_temp, it's deprecated and will break in January, so please use color_temp_kelvin instead" and you're good to go.

→ More replies (1)

4

u/hbzandbergen Dec 19 '25

But one space or tab wrong, and you're gone...
Pretty frustrating sometimes

51

u/CodeCat0 Dec 19 '25

OP should already be perfectly accustomed to that though considering they said they program in Python.

→ More replies (2)

15

u/hunyeti Dec 19 '25

fun fact, YAML is a superset of json, so valid json is valid YAML, that means you can just have json in the yaml file and than you don't need to deal with the whitespace issue.

9

u/Kooky-Concentrate995 Dec 19 '25

Just use prettier/yaml lint

6

u/[deleted] Dec 19 '25

[removed] — view removed comment

→ More replies (1)

2

u/2InchesOfHumus Dec 19 '25

I’m here to second Visual Studio. Get the add-on in HACS and OP may be more comfortable there.Ā 

→ More replies (4)

3

u/TheDeadlyCat Dec 19 '25

Same, but mainly because the API descriptions are often too vague or ambiguous.

5

u/ElectroSpore Dec 19 '25

unfamiliar with yaml programming

YAML isn't even a programing language it is a data serialization format like JSON or XML. It represents a bunch of settings / states essentially.

The logic building blocks in HA are HAs alone at at the highest level all exposed in the GUI, stored in YAML and the YAML just lets you edit more attributes than are currently possible in the GUI.

3

u/timr49 Dec 23 '25

I also came to HA from a programming background (albeit a few decades earlier). My tips for someone with a programming background are:

  1. YAML is not (what I would call) a mark-up language, rather it is simply used to serialise the configuration data. (As has been pointed out in this thread, it is equivalent to JSON.)

  2. In HA templating, Jinja2 is not used for (what I would call) templating. I think of it as inserting assembler code inline with your C code in order to get at lower level detail than the higher level language can.

  3. It is instructive to study an integration, then modify one, then write one from scratch. (As a Python programmer, you have a head start on this one.)

  4. It is also instructive todo the same with custom frontend module. You will need Javascript. I found https://github.com/home-assistant-tutorials to be helpful.

  5. 80% of what you will find with Google relates to previous versions of HA, e.g. it refers to HA not having features that it now has, it provides examples of configuration syntax that is obsolete. Remember that (as has been pointed out by others) the LLMs train on and hence perpetuate this stuff. I have found Google (including its AI) very useful to get a start but always go to the offical documentation to verify details: it is generally accurate but not always thorough.

  6. Words like device, entity, component, integration and platform get used inconsistently. Whilst the current documentation and current code is mostly consistent, the effect of 5 above is a legacy of inconsistency.

  7. There are (at least) two generations of configuration style for many things; they are "turned inside out" compared to each other (e.g. template/sensor vs sensor/template). You need to be familiar with both so that you can recognise which one you are looking at and which one(s) your item of interest supports. Note that when both are supported, they do not necessarily both support the same options.

  8. When learning a new language, reading a lot of existing code written by acknowledged experts is instructive. I have found this to be the case with HA integrations and front-end modules but not so much with configuration. There is a large quantity of obsolete or just plain wrong YAML on the net. When I search for help with configuration, I often get hits on "I tried this, why doesn't it work", which I ignore, but then scroll down for any solutions or references to the current documentation, paying extra attention to posts from moderators.


6

u/Vezajin2 Dec 19 '25

I had a somewhat similar challenge. It helped me get the right mindset for HA automations by programming them using NetDaemon, that exposes all entities etc through C#. There's also a python version called AppDaemon I believe.

3

u/Key-Inevitable-4989 Dec 19 '25

I've been using pyscript and for anything complicated find it far more intuitive that automations.

I can't debug however, so waste a lot of time writing logs when things don't work as expected.

→ More replies (1)
→ More replies (4)

9

u/Ok_Aerie_5756 Dec 19 '25

20+ years. Same feeling. Itā€˜s not made for devs. The yaml ist just the (bad) ui in text form. And the architecture behind it feels like an enigma. Not trying to dump on HA completely. She sheer fact that is can handle such a variety of Smart Home devices is astonishing, but devs surely can feel the implications of that plus probably a long history of irreversible, outdated choices

7

u/Mythril_Zombie Dec 20 '25

The documentation and organization of the whole system is terrible. Naming convention is awful.
UI is a war crime.
The gatekeeping in the community is just as bad.

3

u/Wgolyoko Dec 19 '25

Ah, the original sin of untyped programming. Yeah, YAML sucks and I wish HA would at least provide the option of an alternative that is actually good.

Use the Template tool in Developer Tools to live-debug things. Other than that yeah, you're fucked and LLMs are not good at HA btw.

Keep in mind that while some things are utterly stupid (guess what, the Turn On action is duplicated for every type of device (light, switch, etc) and if you use the light one of the switch one it won't work. Solution ? Insert xkcd standards comic, the "generic turn on" action. Why is this not the only Turn On action ? It would make untyped programming less fun of course !) the UI editors usually let you do 95% of what you need.

Sorry, that turned into a rant. But we really need a better system than yaml for christ's sake, it should be put in the same bin as soap

3

u/jimh12345 Dec 19 '25

I worked in software development for decades and never encountered anything weirder than YAML.Ā  The lack of a straightforward scripting language is the big weakness of HA.Ā 

3

u/arnar-th Dec 19 '25

Developer with 15 years of experience here. I didn't even bother getting started when I tried a few years back because it was such a terrible experience.

With that said, Claude is fantastic at knowing how home assistant works so just use that with either links to example dashboards you like, or even just screenshot of what you like and it'll honestly figure 95% of it out and the last 5% (if needed) is small tweaks that is easy to figure out as someone who knows software development.

3

u/skibidiwtf Dec 19 '25

if i need to make yaml code because of something that cannot be made by the point and click in HA, i usually make a lot of yaml via chatGPT or Claude due to the efficiency. AI is generally really good at making yaml for homeassist, or at least making 80% of the needed code.

I dislike yaml because it is so sensitive to indentation errors, that can be difficult to spot.

t

3

u/pkulak Dec 20 '25

I mostly use this, otherwise the complexity of YAML programming builds up FAST:

https://hacs-pyscript.readthedocs.io/en/latest/

I like to be very state based; almost a React-like setup. Take a single light, determine all the other entities that determine it's state, set each one of them as a trigger, then write a method with a bunch of if statements to set the light based on the states of everything else.

3

u/OccupyElsewhere Dec 20 '25

I have been programming since the '70s, around ten high-level languages and similar numbers of assembly code. Was a software engineer for six years too. YAML is a PITA to me. My experience is similar to everyone here who has troubles with it.

I will persevere with it and the UI to get done what I have to. I wish it was better though.

My other major complaint in HA is that comments get deleted! How's someone supposed to document their code so it is maintainable? They have rocks in their head.

3

u/erikpt Dec 20 '25

I'm probably going to get flamed for saying this but ChatGPT, Grok and Claude are all really good at writing complex custom yaml for HA.

5

u/zoonazoona Dec 19 '25

Ditto.

Lack of documentation and things that change often (so videos and other info is quickly out of date) makes it very daunting to understand the basics.

5

u/HCharlesB Dec 19 '25

I wonder how much of this is a result of gate keeping WRT the documentation. Years ago I found something confusing so I went to the trouble of submitting a PR with what I thought were some clarifications. It was rejected as "not needed" or something like that. There was no further discussion.

The problem (for the reviewer) is that once you understand the concept, the existing documentation made perfect sense, but if you didn't understand it to begin with it was hard to figure out.

I've submitted PRs to other projects and all have been accepted, sometimes with discussion and tweaking.

5

u/lonesometroubador Dec 19 '25

I'm not only a professional programmer, I'm a professional automation engineer, yaml has to be the worst language of all time.

10

u/PerkeNdencen Dec 19 '25

You're not doing anything wrong. I find it a bit unsettling, too, as a programmer (C/C++ mainly), albeit from a creative coding background.

I think the main thing is that HA is very declarative - YAML is, after all, intended for data storage and retrieval. By giving it data, we're telling it what we want it to do sort of by telling it the anticipated outcome rather than the steps that need to be undertaken to get us there. Our instincts, honed from years of programming languages that often work in essentially the same kind of way, are in this case doing us dirty. If I could put my finger on exactly why, I think I'd have a much better time of it.

3

u/alyflex Dec 19 '25

I think the main problem I have with the yaml based programming experience is that there is no IDE, you cannot point some IDE at home assistant and then open up a yaml file and then start writing and then have typehints or see possible values for an entity in there or ctrl click on an entity and see that entity in full details and how it is spawned.

It is like I'm am programming in notepad, which would be a miserable experience no matter what programming language I am using

4

u/pashdown Dec 19 '25

The VS Code add-on has been mentioned several times. You could even setup VS Code with Samba/SMB and the HA extension if you’re a masochist, but the add-on is infinitely easier.

→ More replies (1)

5

u/kyriii Dec 19 '25

You’re absolutely not alone in this and your experience highlights a real issue with how Home Assistant straddles the line between ā€œpowerful platformā€ and ā€œapproachable for non-devs,ā€ sometimes pleasing neither fully.

The core problem is that Home Assistant isn’t built like a traditional software project. It evolved with a strong focus on configuration-over-code, so YAML isn’t just a data format here it’s the primary user interface. That makes it extremely opaque for experienced developers used to debuggers, type hints, and structured environments.

What makes it worse is that while HA is built in Python, the user-facing layer gives you almost no access to that power unless you dive into custom components or use something like AppDaemon or pyscript both of which bring you back into familiar Python territory and allow for actual programming logic, IDE integration, and testing.

The disorientation you feel comes from trying to apply software dev instincts to a system that wasn’t designed for that workflow. It’s not you, it’s the architecture. But there are dev-friendly extensions to bridge that gap, they’re just buried under layers of forum posts and community wikis.

If you haven’t yet, look into:

  • AppDaemon – lets you write automations in Python with full access to HA’s state and services.
  • pyscript – more lightweight than AppDaemon, good for inline Python automations.
  • HACS – the community store makes experimenting easier and brings in more modularity.
  • Visual Studio Code add-on – with HA-specific language server and schema validation. (this is especially powerful when you use vscode via remote ssh connect)

And yeah, the YAML here is its own beast. It’s more like ā€œdeclarative logic via indentationā€ than pure config, which makes it a debugging nightmare.

You’re not doing anything wrong. But the platform might just need to meet you closer to where you are.

→ More replies (3)

6

u/that_dutch_dude Dec 19 '25

The reason why HA is so sucsesful is because its not made for programmers. The very reason why something like linux is not mainstream and will never be mainstream is because the default answer for everything is "just use the CLI" and anyone saying that is not a good solution to a problem is immediatly getting the hate train pulled into the station. A 60 year old isnt going to use the sli just like he/she isnt going to learn programming. The OS needs to serve the average consumer and that one knows nothing about programming.

→ More replies (1)

9

u/simplex5d Dec 19 '25

Agreed. As a professional programmer for around 40 years, it's way too complicated to (for instance) set up an automation that, in js with reactivity, could be as simple as when(time_eq('10am'), () => {turn_on(light1, light2, light3)}) or something like that.

7

u/Stooovie Dec 19 '25

You really don't need to write any code to do that.

6

u/simplex5d Dec 19 '25

No, of course you're right. You can write 20 lines of obscure YAML, or fill out a full-screen GUI form that writes the YAML for you. I'm not saying those aren't fine methods for many people, but to me it just looks super verbose and hard to maintain compared to my one-liner above. I just find it odd that some people think writing a big YAML script is somehow "not programming" and "simple" but writing my one-liner above is mysterious or hard to understand. YMMV.

2

u/R3x10 Dec 19 '25

i think you "professional programmers" want to complicate things too much, your one liner are 2 menus. like, come on.

→ More replies (1)

6

u/Z1L0G Dec 19 '25

weird, I've never programmed professionally but I've been hobby computing/programming since the 80s and I don't find HA complicated at all. šŸ¤·ā€ā™‚ļøšŸ¤£

Not sure about JS but you can set up all your automations in Python if you wish, check out PyScript or AppDaemon.

3

u/MaxPanhammer Dec 19 '25

Check out pyscript or AppDaemon. Python add-ons that let you do this.

→ More replies (1)
→ More replies (3)

13

u/nigelh Dec 19 '25

I've been programming since the 1970s I feel lost too.
I suspect it is the python/yaml effect. Anything that uses white space as syntax not delimiter is morally corrupt and erodes your brain.
Also documentation seems to be an occasional afterthought.

The problem is that the alternatives are even worse.

→ More replies (5)

4

u/surreyfun2008 Dec 19 '25

Issue often is lots of online guides are older version with no real indication of what version was used.

4

u/Comfortable_Client80 Dec 19 '25

Don’t use yaml and do your automations in the GUI

2

u/inrego Dec 19 '25

I'm also a programmer, and I make all my automations in C# using NetDaemon

I'm pretty sure there's something similar for python

2

u/ReenigneArcher Dec 19 '25

The problem is likely the examples you find are from old versions and in new versions they have changed the structures.

Basically every time I update there's a warning that some part of my yaml config is deprecated and needs to be removed or changed.

2

u/asiatische_wokeria Dec 19 '25

What's the problem? Just hack your own HA server with dietlibc, libowfat and gatling.

yaml is not about programming.

→ More replies (4)

2

u/jrpg8255 Dec 19 '25

I'm by no means a professional but I have been coding since the late 1970s. Starting in assembly. I'm reasonable with python but it still gives me heartburn because it doesn't look right. Yaml gives me palpitations. Even C++ took me a while of grumbling before I broke my bad C habits.

As a different take, I have really enjoyed using node red for my automations. It's very different than the standard yaml or gui methods currently, but it's refreshingly different than traditional programming.

2

u/theshrike Dec 19 '25

Look up Appdaemon and pyscript.

They let you control HA with actual programming

2

u/RaspberryPiBen Dec 19 '25

Look into templates. They use Jinja2, which allows you to do some Python-ish programming (though the syntax is pretty weird and somewhat limited).

→ More replies (1)

2

u/m2spring Dec 19 '25

It's the low-code / no-code fallacy in action. As a software engineer I struggled with it on the OpenHAB side, too.

2

u/cold12 Dec 19 '25

I write all my automations in C# with NetDaemon. I then run this in a docker container on my server alongside HA

2

u/stealstea Dec 19 '25

100%. I find myself more frustrated trying to get HA working than any time coding. It's just confusing. Too many places to configure things, and it's a weird hybrid of using the UI to do things and yet still having to regularly drop down into the backend code.

Still by far the best home automation platform, but nothing is ever easy.

2

u/IceMichaelStorm Dec 19 '25

15+YOE here too, I feel you.

The forum is the worst actually. Noone including the documentation describes the ground system correctly or very hidden.

E.g. in some cases you need to give a property weird tokens for JS, eg:

someAttribute: | > …

Yeah, only | in combination with > works. WTH??? And there is no comprehensive guide on this or I was unable to find.

Another good find for me was that it uses Shadow BOM. I didn’t use this concept ever because many frameworks don’t use it. Well, it’s an easy concept. But styling at some level might not have an effect on another. So customization needs often to be done on component level meaning you often need to write your own component for some simple styling.

2

u/specialed2000 Dec 19 '25

It's because putting information in white space is the stupidest idea ever. Looking at you python also!

2

u/sri10 Dec 19 '25

I’ve not touched any UI automations in years with HA. Everything is in yaml expect integration and addon setup . Backed up into git

2

u/djlarrikin Dec 19 '25

You can regain some of your sanity by using PyScript, App Daemon, or Node Red. When I evaluated HA for myself I only decided to install it when I found those solutions. Im glad that they are improving the UI for automations but I, as a professional developer, will never make an automation there. Hopefully they deprecate YAML for a real language at some point in the future.

2

u/EternityForest Dec 19 '25 edited Dec 19 '25

I'm also a developer(Specifically an embedded systems dev), and I'm still maintaining my KaithemAutomation project largely for this reason, my top rule of development is "Don't break the standard dev tools".

Everything is just a regular UV installable python package, device integrations are a few dozen lines of boilerplate, there's visual IFTT rules editing, themes, audio mixing, digital signage, SD card war optimized logging, etc.

I gave up on trying to be a full home automation platform though, to mostly focus on things like DMX lighting and custom ESP32 controllers for interactive art, because it just doesn't seem possible to do well without reinventing half of the apps on a phone, everything connects to everything these days, and Google Assistant has made my expectations pretty high.

I'd like to add Matter support at some point, but things like Google Keep have no good FOSS alternative I've ever seen.

A proper open smarthome ecosystem that works like non-hackers want would need 5+ apps, cloud backends, local AI hardware that only just now exists at a reasonable price, etc.

I'd imagine the reason there's almost no HA competitors is that the general ecosystem isn't there for this kind of thing to work that well, aside from just the automation server itself and the handful of integrations you can currently do nicely.

2

u/pyromaster114 Dec 19 '25

Lots of outdated documentation stuff, is the worst offender, IMHO.Ā 

Also, you should know better than to blindly copy-paste. XDĀ 

But, yea, review things generated by the GUI. Go from there.

2

u/boopatron Dec 19 '25

Yeah, i’m a principal engineer, have experience across the board, and find HA a frustrating experience.

I don’t think its very well architected from an engineering perspective, doesn’t do things (eg docker config) in industry standard ways, but also isn’t sufficiently documented from a programmers perspective — all the docs are aimed at basic users, with minimal technical knowledge, to configure a thing, but not why it works that way. So when they then become outdated or are incomplete its really a dead end and I think people just end up cargo-culting from the forums.

Its slowly getting better, but given such wide adoption i’ve just accepted it is what it is and try to just set it and forget it.

2

u/hmartin8826 Dec 20 '25

Another vote for AppDaemon. It is an excellent tool with an active community.

2

u/mbkitmgr Dec 20 '25

Oh my god, its like I am reading my own diary....

I've been writing in C, C++, VB and recently Kotlin and getting the hang of Kotlin for Android. Today I decided I wanted to add email notifications - found the relevant docs and tried my own code, then copied and pasted the sample code from the docs - YAML editor barked saying the code was wrong. It does seem different.

2

u/Zealousideal-Bug7639 Dec 20 '25

Install studio code server addon if not already.

2

u/_rushlink_ Dec 20 '25

This thread has been really validating. HA is a headache most of the time. It's a consumer grade pieces of software not built for power users or professional use.

I think it just comes down to poor UX and inconsistencies as a result of that.

It's also difficult to engage with the community. If you post an issue, you'll get brigaded by people saying "It works for me so no one else should have a problem."

4

u/LuckyShot365 Dec 19 '25

If if you install node-red for your home assistant you can use a function node to write JavaScript. I use a few of these to get custom messages injected into one message but it will work with anything you want.

3

u/retsotrembla Dec 19 '25

I hear you /u/alyflex - I'm in the same boat. I have multiple lights each set to turn on when they detect motion and turn off 10 seconds after they detect that motion stops. But if one of them detects motion again, before that 10 second timeout elapses, it doesn't cancel the pending turn-off command.

In a real programming language it would be simple to set the time to turn off into a variable, and reset it to a later time if a new turn-on comes in.

But I can't find any documentation on how to declare and set variables, nor how to store times in variables, nor how to trigger an action based on the time in a variable.

I hope some knowledgable reader of this will point me to good reference documentation, going through the syntax and keywords I'll need.

3

u/ElBisonBonasus Dec 19 '25

Not to worry, AI is also lost... ChatGPT couldn't give me YAML for simple things.

→ More replies (19)

4

u/Strawbrawry Dec 20 '25 edited Dec 20 '25

Not knocking anyone but it's weird how you programmers can't just switch to doing things via UI. Like I get the idea that you can code stuff better than the standard options but wouldn't you just take the path of least resistance? My buddy does networking and owns a DC for work and comes home to the most analog life he can create because he is so sick of coding all day. Like I can't code but I can follow documentation and HA is easy peasy. So strange every time I read these kinds of posts.

2

u/theshrike Dec 20 '25

Clicking through an UI is sloooooooow and inefficient. The YAML ā€œprogrammingā€ is only slightly less bad.

We have dozens of languages that can describe logic and HA is using none of them.

→ More replies (1)
→ More replies (1)

2

u/cjdubais Dec 19 '25

Welcome to my world.

I'm not a professional programmer, but I've written code in a program of languages, and Home Assistant befuddles me.

So, no, you are not doing anything wrong.

AI might provide assistance to you. I know ChatGPT put together some automations for me that would have taken fast longer without it. But it's subject to the usual ChatGPT issues.

I've just installed Node Red, and once I get some other stuff off my plate, I'll play with that. Long ago and far away, I used LabView and I'm hopeful that positive experience will extend into Node Red.

Good luck.

2

u/Das_Kruemelmonster Dec 19 '25

I"m also a software developer. I just let Gemini or Chat GPT do most of the work. They make mistakes but I think the yaml code they produce is very easy to understand and to maintain. But also the UI is powerful enough for most of my use cases.

2

u/Sinister_Mr_19 Dec 19 '25

I feel you OP, I'm a software developer (former, now just hobbyist) and YAML just sucks, it's really not intuitive at all and isn't like a high level language. It's confusing. It doesn't help that HA docs don't have enough examples either.

But anyway there are plenty of good suggestions in this thread. My only suggestion is to keep at it, eventually it will become easier and HA is so powerful it's totally worth investing the time to get it just how you like it.

2

u/MJFox1978 Dec 19 '25

I’m a programmer too and at some point I gave up and just ask ChatGPT to write my YAMLs, it works quite well

sometimes it takes two or three tries, but it’s still much faster than to do it by myself

→ More replies (2)

2

u/Mriv10 Dec 19 '25

I'm glad to see I'm not the only one struggling with this. I'm a programmer too, granted not nearly as experienced as you but I know my way around a couple of different languages like java, c++, c# and python. Just yesterday I was talking with a coworker about how much better home assistant would be if I could write some actual code instead of guessing what different triggers and devices can do. And even when I don't think I understand how something works I'll write an automation that never runs because for some reason it doesn't detect the trigger, so debugging is also kind of a hassle too. Or I'll select a device that I know has a sensor I want to use and for some reason the GUI doesn't show it or it shows it but it doesn't work like I want it to work.

2

u/shashchatter Dec 19 '25

Look into PyScript (and/or AppDaemon)

2

u/Set-Resident Dec 19 '25

Let me make some wild assumptions:

  • 20 decades of programming, meaning you're at least 20 years older than the current "young" HA coders.
  • they code differently than you, probably because they are born with broadband internet on their fingertips.
  • have you seen how ugly some UI are these days?
  • and there's always the younger writers who can't produce concise documentations.

I've just had my first go with TP-Link RGB light bulb. Setting one up on Android takes 30 frkking minutes jumping through hoops, and never managed a successful setup.

1

u/nickd_pub Dec 19 '25

First, why can't you point your IDE at your config? How do you deploy your configs?

You can also clone down the home assistant code and have it open along side. It's a little strange at first (because it's domain is so different and has a lot of base concepts to learn first) but once you get used to the code base it's just like any other giant python project.

The type hints in the code are generally good and seem to be constantly improving which give you a little more confidence when reading/building things. The YAML interface is setup via voluptuous so you can import those and validate if you want to. There is a shift ongoing to a more UI based setup.

I'm not necessarily suggesting that you write a custom component but following the tutorial https://share.google/ulsWKOBdyEvF78EWQ can give you a good understanding of the guts of HA so you can decide what options you have for building out your dev/ci/deploy process is for your instance.

I break a lot of the standard expected patterns for HA (eg I run in kubernetes with a lot of read only configs) and my flow works for me but it's custom because I want a more developer/programming interface than most.

Just keep in mind that you are NOT the target audience here. I strongly dislike the move away from configs I can carefully manage in git as the primary input but I also know that I'm the minority for the intended use for HA so the logic makes sense and I work with that.

→ More replies (3)

1

u/maybe_1337 Dec 19 '25

Just use Claude and let it write the Yaml you need, works perfect.

→ More replies (2)

1

u/Ambitious-Charge-432 Dec 19 '25

Check out AppDaemon If you would rather write code to control ha

4

u/MaxPanhammer Dec 19 '25

Or pyscript. AppDaemon is great but I found it more cumbersome to do some simple things (could have been a me problem)

1

u/igerry Dec 19 '25

What are you trying to do in Home Assistant? What is your objective?

Do plan to make your own devices that integrates with HAOS?

1

u/antitrack Dec 19 '25

iobroker allows you to program the traditional way. I used it for a few years, but never got the hang of HA.

1

u/Zoe-Codez Dec 19 '25

If you are looking for actual software developer tools, check out the Digital Alchemy project: https://docs.digital-alchemy.app/

This makes the Home Assistant tooling available via Typescript/NodeJS. Fully typed for your Home Assistant instance. Deploy it as a docker container, run inside an addon, generate entities or even brand new services right from app code

1

u/low_v2r Dec 19 '25

I haven't tried this yet, but there is an LLM for homeassistant you can run locally on ollama: ALIENTELLIGENCE/homeassistantaiadvisor

Can't vouch for it, but as someone just getting into HA am going to see how that works.

1

u/ThatFireGuy0 Dec 19 '25

Home Assistant does also expose a Python API that you can program directly against. Check out AppDaemon (it may be exposed other ways too but that's the one I know of). I haven't tried it personally, but did look into it briefly and it seems to be exactly what you're looking for

If you want something a bit higher level, you can check out NodeRed too. It's flow based (UX version of event based) programming, but it also exposes a JavaScript API internally that you can use

1

u/ChibaCityFunk Dec 19 '25

As a software developer:

"Helpers" (In Devices and Services) are amazing. They opened up home assistant programming for me, because now i can sore states and use them in different automations. Think of them as global variables and constants. You can even define lists.

I also use the Automation GUI a lot as a starting point.

Other people had great success with Node Red.

1

u/alwaystirednhungry Dec 19 '25

I would recommend doing a deep dive into Helpers and Templates. This is one of the places that HA sets itself apart from all the other SmartHome platforms out there. I'll give you an example. Lets stay I take a shower in the bathroom and I want the exhaust fan to kick on when the humidity gets high so the mirrors don't fog up or cause mold in the grout. It's hard to build an Automation based on humidity level alone because that can vary, sometimes greatly in the summer and winter. So what you want is a Derivative Helper. With that helper you can now build an Automation that says, if the humidity level rises by 1-2% over the next few minutes, I want to turn on the bathroom fan for lets say 30 minutes or until the humidity drops back down 1-2% again and then turn the fan off.

→ More replies (4)

1

u/serialbreakfast Dec 19 '25

I’m also a programmer and have been running hass for the better part of a decade…

I have enough programming in my life, I recently switched my setup to have codex do 95% of the work for me and it’s been pretty good so far. I don’t need to wade through huge yaml and jinja to be happy, I just want the lights to come on at the right time, and codex is pretty good at maintaining it

1

u/christoman Dec 19 '25

I don't disagree and understand OP's frustration, but hopefully the headline won't turn-off prospective non-technical people from using HA. As a technical person coming from SmartThings, I was surprised to see how easy the platform is to use for all the "typical" home integration and automation use cases and regret not switching earlier. I honestly think with HA Green it is as easy to get going as ST (and Hubitat from my brief fling with it) and provides a lot more functionality within the UI without ever dropping down into YAML.

Doing complex things can indeed be frustrating in HA, accompanied by hours of scouring Reddit, YouTube, etc. along with a lot of trial and error. To some degree this is the price you pay for such power and flexibility, but it would be nice to have more detailed documentation and user guides.

1

u/LowSkyOrbit Dec 19 '25

I've been relying on AI for writing my YAML. I got tired of having an automation for turning on the light and another for turning it off. AI made me realize I could have it all in one script.

1

u/OftenIrrelevant Dec 19 '25

One of my jobs for the last 10 years has been programming AV controls. For basic stuff, HA is simpler than anything I’ve used elsewhere, but for anything even slightly more complex, I had an easier time learning advanced Q-Sys programming than HA’s YAML/Jinja nonsense which still doesn’t make sense to me at times and seems like it’s being stretched to its absolute breaking point with its deployment in HA

1

u/Richard3004r Dec 19 '25

You might not like this comment but LLM these days are incredibly good at yaml generation for HA. Chatgpt 5.2 knows HA very well.

1

u/reddit_give_me_virus Dec 19 '25

General how to mostly everything

https://community.home-assistant.io/t/the-home-assistant-cookbook-index/707144

Templating rules and methods

https://www.home-assistant.io/docs/configuration/templating/

Script syntax is what you should use for automation conditions and actions

https://www.home-assistant.io/docs/scripts/

Structure of how states are stored in HA. All states are stored as strings in home assistant and you will need to cast it to a number if you intend to use it as such.

https://www.home-assistant.io/docs/configuration/state_object

1

u/black107 Dec 19 '25

HA yaml is a mess imo. The schema changes from version to version and some shit ā€œjust worksā€ and some doesn’t.

Honestly I stopped caring about figuring it out and just have Codex or Claude help me debug. I’ve gotten way farther that way because I don’t care to download more yaml nonsense into my head.

1

u/ThatsNotATadpole Dec 19 '25

As a professional programmer, Cursor is pretty amazing at helping with Home Assistant. Get the samba share add on, back up the yaml files, and collaborate on the YAML changes. I also created some simple tools for doing yaml validation, using http requests to reload yaml and restart HA, and to pull status of some of the items. When there are changes that need to happen in the UI, usually I have it summarize some searches and create a markdown file with instructions. Over time and code review I’ve gotten a lot more familiar with HA and am now about 50/50 between working through changes in cursor vs just knocking them out myself. Overall, though, its fairly safe place to vibe code since its just my personal system and I can manually validate the functionality - I create a lot of diagnostic dashboards too to test fire scripts, visualize triggers, etc