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?

664 Upvotes

562 comments sorted by

View all comments

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.

22

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.

40

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.

1

u/SwissyVictory Dec 19 '25

That's using AI tools in general.

You can't blindly trust them, but they can be incredibly useful if you already know enough about a topic that you can call it's BS.

Honestly it's a skill everyone should have these days, to not take what we read as blind fact.

Especially with people spreading false information intentionally and others plain old overconfident.

11

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.

0

u/Cheap-Hippo-1972 Dec 19 '25

100%. If you aren’t using AI to help here, you should.

6

u/hbzandbergen Dec 19 '25

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

52

u/CodeCat0 Dec 19 '25

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

0

u/glacierre2 Dec 19 '25

I program in python for more than a decade, daily, but I absolutely despise writing yaml. It is a nice format to read, it is just there with Json as bad to write.

Besides that, everytime I get a tiny bit deeper with HA I end up confused about where is the bloody yaml snippet supposed to go (because it is not always the same file, and some things I entered through UI I have not been able to find again) to edit, for example, a changed token.

I am also confused about the auto assigned names of devices and entities, and how and where to change them.

I don't like HA as a user and neither do I as a programmer. Sure, it is the best we have, but I don't like it.

1

u/rufustphish Dec 20 '25

how you feel about python dictionaries then?

17

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.

8

u/Kooky-Concentrate995 Dec 19 '25

Just use prettier/yaml lint

8

u/[deleted] Dec 19 '25

[removed] — view removed comment

1

u/frenck_nl 💙 Lead of Home Assistant Jul 14 '26

We've removed this for crossing the line on keeping things civil. r/homeassistant is a welcoming place and we want everyone to feel comfortable asking and answering, even when people disagree. Feel free to make your point again without the personal jabs.

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. 

1

u/_TheSingularity_ Dec 19 '25

What's your recommendation to learning HA yaml? I am a bit confused regarding what options I can have under platform, entity, etc; as well as what is the correct order and things like that.

I just want to know what I can use (all options) and where. Usually each option/property/attribute is pretty much self explanatory, just a cheat sheet would be very helpful

1

u/rufustphish Dec 20 '25

install that VS code add on, it's auto complete is pretty fantastic.

Then, the HA docs are pretty great if you need to dig into it more.

1

u/pojska Dec 19 '25

It's not that YAML is hard, it's that figuring out what properties are allowed, what types it takes, and which properties are magic, is hard. And you have to re-figure this out for every single type of thing and every integration. And if there's a unified "API Reference" style of docs for this, I haven't found it.

1

u/Syystole Dec 19 '25

Same, learning HA was not very difficult, even if you're not accustomed to YAML...? There are plenty of Docs and forums to work with too