3 ms·
There's also PyScript, a custom component that allows you to write automations in Python. The docs have a bunch of nice examples that give you an idea how it lo
by piquadrat 6y ago
There's also PyScript, a custom component that allows you to write automations in Python. The docs have a bunch of nice examples that give you an idea how it looks.
https://github.com/custom-components/pyscript https://github.com/custom-components/pyscript
https://hacs-pyscript.readthedocs.io/en/stable/tutorial.html#an-example-using-triggers https://hacs-pyscript.readthedocs.io/en/stable/tutorial.html...
- BrandoElFollito 6y agoExcellent timing, thanks! I am looking at possibly replacing AppDaemon as we speak. This is a great software, bit it is really distinct from HA and simple automations require quite a bit of code anyway. I was thinking about having a mixed mode: the very simple automations (covers up at 9:00) would go into the YAML and more complicated would use the Python scripting described here: https://www.home-assistant.io/integrations/python_script/ https://www.home-assistant.io/integrations/python_script/ (also from automations, but the real work would be done in the script) Now I see with your comment that there is a HACS component as well - have you compared both and chose one of them for some specific reason?
- BrandoElFollito 6y agoOK, following up on my last comment - pyscript is teh way to go. One can import anything and the functions are very light, decorated etc. It looks like a very good solution for more complicated automation (and for simple ones as well, it is just two lines)
- piquadrat 6y agoExactly, that's what I like about pyscript: it is a great alternative for simple YAML automations, but it also allows for complex logic that would be impossible or very cumbersome with YAML.