by nevi-me · 3y ago · 0 comments
There's a lot of home devices beyond ZigBee, with a large community supporting them. Beyond ZigBee, we will see Matter devices also cropping up over time.
I do like the idea of being in control of one's automation software. The risk that I've seen though is when one ends up spending more time on building the software than the automation, which can happen when one writes their own integrations from scratch (i.e. not using Z2MQTY, ESPHome, HA, etc).
With that all said, I like HA as the central programmable hub, but have come to dislike the proliferation of ecosystems that require add-ons I'm mostly looking at Sonoff devices that tie you to ewelink and phone home in opaque ways.
I'm personally probably going to go with Matter for store-purchased and DIY devices. I'm already nearly done with our first DIY devices at home. A light strip for the kitchen, that has some sensors for useful automation.
Not rolling my own solution makes it easier for me to build a few devices for friends later.
On the other hand, it's absolutely crap at doing complex automations. The Web UI gives me heartburn any time I need to make it do anything else than simple "if temperature is over 40 on this, do this" things.
The UI does make complex automations _possible_ for non-programmers. But for me, every time I click on the UI or attempt to "program" using the convoluted YAML syntax I keep thinking "this would've been like 5 lines in an actual language...".
Thus: I use Node RED for the more complex stuff paired with an external program I made that connects to the HA Mosquitto server and pokes stuff directly when needed.
An example script:
@state_trigger("security.rear_motion == '1' or security.side_motion == '1'")
@time_active("range(sunset - 20min, sunrise + 20min)")
def motion_light_rear():
"""Turn on rear light for 5 minutes when there is motion and it's dark"""
task.unique("motion_light_rear")
log.info(f"triggered; turning on the light")
if light.outside_rear != "on":
light.turn_on(entity_id="light.outside_rear", brightness=255)
task.sleep(300)
light.turn_off(entity_id="light.outside_rear")
It's what made me ditch node red after going down the same path.The Home Assistant community seems to have the entire gambit of people who can't code at all, the people who never coded professionally and make riduclously complex things like the fabled Excel accountants, to the professional developers doing stuff for fun, but nobody actually shares anything worthwhile outside of awful YAML and youtubes about awful YAML.
But i have a nagging feeling that i should probably use PyScript instead.. If anyone has a more thorough analysis i'm open to hear it..
Even if I use a UI for making a modification sometimes, I want to be able to commit a clean diff like:
sensorLightBackdoor:
- timeActive: range(sunset - 20min, sunrise + 20min)
+ timeActive: range(sunset, sunrise)
Or whatever. Which obviously I can do with python, as long as it's stored neatly in config in a .py file, or even if embedded in HA yaml or something?In a `pyscript/*.py` file, so you can open it with a full blown IDE and use all your usual comforts, and commit the results to git.
Personally, I gave in and installed HA in a VM, because it seemed like the least effort way to use HomeKit capable devices without purchasing Apple products, and I was able to connect the HomeKit things, but I can't figure out how to do what I want with them, so I not sure what I got. Ideally, I want to make my 'smart' thermostats a bit smarter ... better coordination between zones, different minimum fan runtime rules than I can get from the thermostat, loosen the setpoints when the tv is on or someone is on the phone, so the hvac noise is less bothersome, etc. But I can't figure out how to get HA to track the fan runtime, so all that complexity is like ugh, I'd be better off doing it myself, except the homekit stuff isn't sensible either.
In my case I wanted to play with sensors and the pico w. A pi with a sprinkling of c#, Nats, and influxdb connects, controls Ikea stuff, and reports all the things.
Micropython on the pico is not my favourite part of the process but it might have been faster for me than just writing in c.