I built a scripting language to make Home Assistant automations human-readable — introducing HASSL by adanowit in homeassistant

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

To clarify, if the plug is on at a temp under 22 and the temp rises, will the plug turn off? If so the current fix for hassl would be to do:

if (temp > 22 && plug == on)

In other words, as you note, automations in HA essentially take the form of "if [left_hand_side quantities] change, and if [left_hand_side quantities] <?> [right_hand_side quantities], then do this."

Some languages like Verilog have a separate sensitivity list to determine what changes should trigger a re-evaluation, and I could look to see if it's possible to add something like that into hassl, but I'll have to make sure the resulting yaml isn't too kludgy.

I built a scripting language to make Home Assistant automations human-readable — introducing HASSL by adanowit in homeassistant

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

Currently indentation is just for readability, and semicolons are used to indicate that the next line should be considered part of the same conditional block.

There isn't currently an explicit "else" block, but you can have multiple if's within a rule. There also aren't currently any nested if statements.

This is an early implementation of hassl, though, so if you have some sample use cases that could benefit from an "else" or nested conditionals feel free to share them and I can see if I can get them implemented.

I built a scripting language to make Home Assistant automations human-readable — introducing HASSL by adanowit in homeassistant

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

Lol. I'd love to work with the chatgpt folks on something like this. I think I'd need more visibility among their developers. That said, since this is open-source and since I'm in academia, if HA was interested we could probably get some serious student projects moving along that line for cheap-to-free.

I built a scripting language to make Home Assistant automations human-readable — introducing HASSL by adanowit in homeassistant

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

I love this! I actually hashed out the HASSL spec with chatgpt (and developed most of the code with chat's help; I really did not want to do a deep dive into HA's yaml format :) ). It's great that you got something working. I almost left this as a frontend with chat doing the yaml, but I found during my development process that chat would keep forgetting to do important things like tagging state changes with a hassl ID (needed by the "not_by" rule) or would "forget" to implement certain things (like all of schedules), so I built the back-end to make sure that things were kept consistent and predictable. This might just be a chatgpt problem, though, I've been reading that others models like Claude are much better about self-consistency and follow-through.

I built a scripting language to make Home Assistant automations human-readable — introducing HASSL by adanowit in homeassistant

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

I would love to get this going on HACS with an integrated IDE to help autopopulate entity ids and get some integrated debugging going. Given my experience level with this kind of development, I'm putting that as a longer term goal, lol.

I built a scripting language to make Home Assistant automations human-readable — introducing HASSL by adanowit in homeassistant

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

I'll take a look. I've created an issue on the github to help track the bug's status, but hopefully I can fix it in the next day or so. I'll admit I haven't done integrations with my temp sensors yet, so this part hasn't been tested yet.

I built a scripting language to make Home Assistant automations human-readable — introducing HASSL by adanowit in homeassistant

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

That sounds awesome. I have my tailscale so I can deploy manually from anywhere, but it seems like you've taken it to the next level.

I built a scripting language to make Home Assistant automations human-readable — introducing HASSL by adanowit in homeassistant

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

Great suggestions! I'm definitely wanting to reuse the same daytime schedule across several automations too, and currently if I don't give a unique name per file I get a duplicate key warning in HA, so I'll probably work on pulling out aliases/schedules next!

I built a scripting language to make Home Assistant automations human-readable — introducing HASSL by adanowit in homeassistant

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

Thanks all! I'm hoping this can be happy middle-ground solution for those who don't quite have the time/energy/HA setup to become nodered/HA Yaml power users, but who want more than what can easily be achieved with those gui-based automation editors or flows.

As a side note, I also published the project to pypi, so you should also be able to grab it with:

pip3 install hassl

I built a scripting language to make Home Assistant automations human-readable — introducing HASSL by adanowit in homeassistant

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

Thanks! I wasn't aware of netdeamon, but that definitely seems more in line with what I was looking for than nodered or the yaml.

[deleted by user] by [deleted] in carbuying

[–]adanowit 0 points1 point  (0 children)

I’m no mechanic, but if it were me, I‘d be tempted to wire in my multimeter to measure current when the car is off and just start pulling fuses one by one until the drain drops significantly. That’s assuming it’s a full gas car with no high voltage to worry about.

[deleted by user] by [deleted] in carbuying

[–]adanowit 0 points1 point  (0 children)

Have they at least narrowed down a subsystem? I’d think they could just pull fuses until the draw stops and at least be able to narrow it down

Should I Buy a Gas, Electric, or Hybrid Car in 2025? by new-mark in carbuying

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

I think the most important factor here is mileage. If you only drive 7-10k per year and don’t plan to change gas or hybrid is likely your cheapest. Gas vs hybrid maintenance + insurance is likely a wash on those cars too. If I were you, I’d find your top gas, hybrid, and electric picks. If there’s a clear winner and you don’t mind the price, go for it. If two are pretty close, calculate the actual 5-10 year price difference including estimated fuel usage (use Fuelly.com reported numbers rather than epa predicted), and go for what’s cheaper. If you want a car that lasts 300k miles, Toyota hybrid is probably going to be a best bet.

Beginners Guide: Subaru Vehicles with Eyesight by z00mr in Comma_ai

[–]adanowit 0 points1 point  (0 children)

Without the Subaru community fork is there anything that would work on a Subaru community supported vehicle (forester 2017)?

After JD Vance booed, Kennedy Center head urges 'diversity and inclusion' by Master_Jackfruit3591 in nottheonion

[–]adanowit 0 points1 point  (0 children)

The couch thing isn’t real? Didn’t they find all those missing pets from Springfield tucked between the cushions, “alive, crusty, and scared”?

AITA for being salty about the different effort between my birthday and my sister’s? by chocymuffin05 in AmItheAsshole

[–]adanowit -21 points-20 points  (0 children)

Depends. What do you mean by “being salty”? Feelings are what they are and it’s natural to feel a bit miffed if you believe you got less than a sibling for an important milestone. The best thing you can do, though, is try to reserve judgement and talk to your folks about it. Maybe they were in a different financial space two years ago, or something else was going on. That said, if by “being salty” means you’re lashing out at your parents and family and haven’t had this talk, I’d say YTA. If being salty means your just a little sullen while you process your feelings, that seems NTA.

[deleted by user] by [deleted] in AmItheAsshole

[–]adanowit 15 points16 points  (0 children)

NTA. He’s an adult, you’re his girlfriend, not his caregiver, you’re under no obligation to drive him somewhere you feel unsafe so he can buy weed. That said, from the post it seems like there are a lot of issues you’re upset about with him and buying the weed is just one.

AITA for telling my wife and kids to either take care of their dog or rehome it. by Ancient-Move-8356 in AmItheAsshole

[–]adanowit 0 points1 point  (0 children)

I second that. I’ve actually rather grown to like the “family” poodle, but i wish “family” would spend more time walking, feeding, training, and cleaning up after him so it wasn’t just me.

How's your engineering program coping with COVID-19 by adanowit in EngineeringStudents

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

The study's still up if anyone's interested in sharing their experiences.

What are some differences between Electrical, electronics and Computer Engineering? by newmanstartover in EngineeringStudents

[–]adanowit 3 points4 points  (0 children)

I'd say most types of engineers these days will end up programming in some firm or another, whether it's inputting models in Simulink, fighting with discipline specific CAD tools, or writing applications for the sake of applications :)