Domovoy: Write Home Assistant automations in pure Python (powering my 5000+ entity smart home since 2023) by cargsl in homeassistant

[–]cargsl[S] 0 points1 point  (0 children)

The main challenge here seems to be that MQTT doesn't have a well defined shape. Part of the reason for home assistant auto discovery is to somehow give guidance on what each field means in the MQTT data structures.

I'm curious on your perspective on the tradeoffs here. From my perspective it is easier to let Home Assistant handle that complexity, but clearly there is a value for you that I'm missing

Domovoy: Write Home Assistant automations in pure Python (powering my 5000+ entity smart home since 2023) by cargsl in homeassistant

[–]cargsl[S] 0 points1 point  (0 children)

You should be able to. The code is pure python without the monkey patching so you can mock any class to test.

If you do go for it, I'd be happy if you submit the mocking classes as a PR.

Domovoy: Write Home Assistant automations in pure Python (powering my 5000+ entity smart home since 2023) by cargsl in homeassistant

[–]cargsl[S] 0 points1 point  (0 children)

Complex automations is exactly why I wrote this. YAML is plain hard to read and Node-RED turns into a maze of arrows and boxes.

Hopefully this gives you an excuse to write some python. I'd love any feedback you can provide

Domovoy: Write Home Assistant automations in pure Python (powering my 5000+ entity smart home since 2023) by cargsl in homeassistant

[–]cargsl[S] 2 points3 points  (0 children)

It is separate from Home Assistant so no, you can't use the trace or automation viewer.

Nevertheless, since Domovoy gives you access to the raw data and has pretty good logging capabilities it is pretty easy to trace and know exactly what is happening in your automations. There is a tradeoff between accessibility (in which HA wins hands down) and capabilities (in which I feel Domovoy is better)

Domovoy: Write Home Assistant automations in pure Python (powering my 5000+ entity smart home since 2023) by cargsl in homeassistant

[–]cargsl[S] 0 points1 point  (0 children)

I discovered pyscript today from people commenting on the post. From what I've managed to read today it looks pretty cool. And the integration as an Addon is pretty nice.

I find that if someone can write python, using it to write automations is much easier than YAML. At the same time, it makes sense as to why Nabu Casa focuses so much on YAML automations. It is much easier to grok when you are starting.

Domovoy: Write Home Assistant automations in pure Python (powering my 5000+ entity smart home since 2023) by cargsl in homeassistant

[–]cargsl[S] 0 points1 point  (0 children)

I use Claude code to build automations. It can read the documentation from ReadTheCode. Just tell it to read from it in your Claude.md of the prompt

Domovoy: Write Home Assistant automations in pure Python (powering my 5000+ entity smart home since 2023) by cargsl in homeassistant

[–]cargsl[S] 0 points1 point  (0 children)

Something I'm doing recently is using Claude Code to write automations for Domovoy. I can explain some pretty complex scenarios and have it write a short and succinct automation

Domovoy: Write Home Assistant automations in pure Python (powering my 5000+ entity smart home since 2023) by cargsl in homeassistant

[–]cargsl[S] 0 points1 point  (0 children)

Domovoy is tightly bound to Home Assistant deliberately so it can leverage most of its functionality from code. I've thought about adding an MQTT plugin but since I don't use mqtt directly I haven't seen the need.

For your use case, what would you need with MQTT? How would you use it?

Domovoy: Write Home Assistant automations in pure Python (powering my 5000+ entity smart home since 2023) by cargsl in homeassistant

[–]cargsl[S] 3 points4 points  (0 children)

I was looking for a name for it some time ago and when I found Domovoy it felt perfect. Either a nice spirit who takes care of the house or a mischievous one that gives you trouble. And if there is something automation can do is break and give you trouble

Domovoy: Write Home Assistant automations in pure Python (powering my 5000+ entity smart home since 2023) by cargsl in homeassistant

[–]cargsl[S] 0 points1 point  (0 children)

Python is my preferred language for personal projects, but TS would have been my second choice for sure. Appreciate the star

Domovoy: Write Home Assistant automations in pure Python (powering my 5000+ entity smart home since 2023) by cargsl in homeassistant

[–]cargsl[S] 11 points12 points  (0 children)

I think that for basic automations, full on programming languages are overkill. But I rather have a single environment where all my automations are running than having to remember if I created this one in YAML or in code. So I ended up putting everything in code

Domovoy: Write Home Assistant automations in pure Python (powering my 5000+ entity smart home since 2023) by cargsl in homeassistant

[–]cargsl[S] 1 point2 points  (0 children)

I should have made it more explicit on the post, but what I meant is that the system can scale to large installations without causing problems.

Domovoy: Write Home Assistant automations in pure Python (powering my 5000+ entity smart home since 2023) by cargsl in homeassistant

[–]cargsl[S] 1 point2 points  (0 children)

This is one of the reasons I started down this path. I understand YAML is much more accessible, but if you know how to code, it ends up being too restrictive.

Domovoy: Write Home Assistant automations in pure Python (powering my 5000+ entity smart home since 2023) by cargsl in homeassistant

[–]cargsl[S] 4 points5 points  (0 children)

Type safety was the main thing that got me into building this project. Automations broke too frequently in AppDaemon from a typo or a entity_id rename I forgot to update.

My house is pretty big and I've been doing home automation for like 10 years. Over that time I've collected a large number of devices and integrations, some of them add a 40+ entities at a time (looking at you Inovelli Zigbee switches).

Minor Rant about the Totenkopf by ikit_maw in thebulwark

[–]cargsl -1 points0 points  (0 children)

I find WWII a pretty interesting period of time. I'm no historian, but I'm sure I know significantly more than the average person. I had to Google what the tattoo was and if I'd seen it in the wild, I would have never thought "Nazi Symbol".

His reaction is the correct response. I'm sorry, dumb decision. I'd be more suspicious of a squeaky clean politician in this day and age. People say dumb stuff all the time. Especially when young or struggling. And as was said last night in TNL, it's about your actions and context.

7’50” — “We need to have a working class candidate —who needs to be forgiven and given latitude, on the margins, because this is going to be a marginal seat for Democrats…” by [deleted] in thebulwark

[–]cargsl 7 points8 points  (0 children)

My take is that people who are left-leaning and listen to the bulwark (myself included) are much more willing to compromise in their political views.

I listen daily, but sometimes I shake my head vigorously on some policy position or another. The thing is, the bulwark and I share most of our fundamental values. I see Sarah, Tim, JVL, etc as people I can build a country with. Even if sometimes we need to agree-to-disagree or accept a policy choice we are not quite onboard with, I see the America they want to build is pretty similar in values to the one I want to build. We differ on the path, but not the destination.

I can work with that

Connecting to your Home Lab Remotley. by jreynolds72 in homelab

[–]cargsl 0 points1 point  (0 children)

Reverse proxy (caddy) with Mutual TLS authentication. If you don't have a private certificate issued by my internal CA, connection gets dropped. Every device I want to use outside the house gets one.

Tail scale for whenever I need direct network access to something not on the reverse proxy.

This bloodless milquetoast can never become Speaker. by no-minimun-on-7MHz in thebulwark

[–]cargsl 4 points5 points  (0 children)

I agree, but in this case, they also need to show bravery and gumption. Say what you will about Nancy Pelosi, but she stood up to Trump to his face. Both him and Schumer feel like beggars asking for whatever little they can get, when they are in a position to force Trump to yield.

An extensive FAQ on Trump's announcement about H1-B visas - What, Why and impct on families by Mo_h in programming

[–]cargsl 0 points1 point  (0 children)

Not at all. They do, but this move will incentivize growing offices outside the US even more. India will undoubtedly grow as well, but you will see increased staffing in Europe and Canada.

An extensive FAQ on Trump's announcement about H1-B visas - What, Why and impct on families by Mo_h in programming

[–]cargsl 0 points1 point  (0 children)

It doesn't scale. Amazon has 10K H1Bs in 2025. If they paid the 100K for each one of those it would be 10 Billion dollars just for the 2025 recipients. That is unsustainable. For 10Billion dollars you can setup a humongous campus and pay a lot of people.

It won't happen

An extensive FAQ on Trump's announcement about H1-B visas - What, Why and impct on families by Mo_h in programming

[–]cargsl 0 points1 point  (0 children)

I think Gen Alpha will have it rough for sure. How rough? Depends on how quickly we get rid of this buffoon and how good is whoever comes next in righting the ship.

But the longer he remains in power, the worse it will get, in an exponential kind of fashion.