this post was submitted on 23 Mar 2026
1 points (100.0% liked)

Home Assistant

265 readers
2 users here now

Home Assistant is open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY...

founded 2 years ago
MODERATORS
 
This is an automated archive made by the Lemmit Bot.

The original was posted on /r/homeassistant by /u/jfriend99 on 2026-03-23 04:43:08+00:00.


I'm a retired software developer and new to Home Assistant.  I want to do some more complicated automations that involve conditional logic from multiple sensors (temperature sensor, vibration/accelerometer sensor, two switches that can be controlled manually or by HA and affect the automation state, time of day, timers and some WiFi presence information.  

In asking Gemini how to do that in Home Assistant YAML, I ended up with YAML with embedded Jinga2 that I consider complicated to read, understand and maintain (compared to how I would express the logic in a more traditional programming language) and it didn't even yet have all the logic in it.  So, after some more research I find that there are many ways to implement your more complicated automation logic in HA:

  • YAML + Jinga2 - still don't quite understand the rationale behind using Jinga2
  • Pyscript - somewhat limited python code internal to HA, but could probably cover all the logic flow I need
  • Full Python - external process, communicates with HA via API
  • Node-Red - external process, communicates with HA via API (webSocket and REST), has visual flow design + ability to code in Javascript
  • Full C#/.NET environment - external process, communicates with HA via API
  • And there are probably more ...

My developer experience is C++ and Javascript and I have some familiarity with Python from writing small scripts.  My leaning right now would be Node-Red, but I don't really know what the tradeoffs are for going with an external environment or that one in particular.

For those of you with more complicated automations, are you just figuring out how to express them in the UI or in YAML, going to Pyscript for some things or learning one of the external coding environments?

For the external environments, are there any drawbacks of using them.  Latency?  Memory Use?  Are any of the choices more popular than the others for any particular reason?  If it matters I'm running the Home Assistant Green hardware.

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here