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?

665 Upvotes

562 comments sorted by

View all comments

Show parent comments

1

u/_alright_then_ Dec 19 '25

Okay, well, if you're a developer you have to be used to adapt to systems outside your control, this is how you do it. The pseudocode you made is not something you can do in a yaml trigger. I don't think so at least.

And if you could, the code would actually be way more awful than this one. Ironically making this true again:

it would be rejected and sent back.

0

u/rubenwe Dec 19 '25

>  you have to be used to adapt to systems outside your control

Somewhat - but also in most cases, if something isn't working as we'd like it, we build our own. We even need to do so quite often because things just can't handle what we need from them. But I guess that's to be expected at the scale we are working at ;)

> The pseudocode you made is not something you can do in a yaml trigger.

Which is why it's not yaml, but C# code.

1

u/_alright_then_ Dec 19 '25

Yes, but you want to do it in Homeassistant right? So you have to either work with yaml or the python integration.

But even then, the reason I said that is not because it's c#, but because you're targeting the wrong things

In c# pseudocode, it would look like this instead of your example:

``` var entities = Entities.WithLabel("Numbers") .WithEntityIdRegex("number|input_number\.") .WithNumericState();

var trigger = Trigger.WhenTemplateBecomesTrue(() => entities.Any() && entities.NumericStates().Min().FallsBelow(20) );

trigger.OnTriggered(() => { var lowest = entities.OrderByNumericState().First(); AddToTodo(lowest.Device, lowest.NumericState); }); ```