My first pyscript automation! #561
Unanswered
magnushacker
asked this question in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I just recently discovered pyscript, and it seems to be exactly what I've been looking for. I never liked the HA automation GUI so I tried using AppDaemon but I felt it was a bit too verbose. I then tried Node-Red which is an excellent package in itself, but the integration to HA is sometimes a bit flaky, requiring restarts now and then which of course renders it somewhat useless (plus. it's javascript which I hate).
Pyscript seems to fill the gap between all these technologies, perfect for me.
Here is one useful automation for my bedroom bed lamps. These are zigbee bulbs (integrated via z2m) where I have one remote on each side which is bound to the lamp on that side (this makes it possible to operate the lamps even if HA is down). If you press "on" on the remote and the lamps is already on for at least 20 milliseconds (meaning that we did not just turn it on using this remote press), then it checks the state of the other lamp. If it is off, it will turn it on with the same brightness as this lamp, and if it is already on, it will set the brightness of both lamps to 255.
Similarly, if I press "off" on the remote and the lamp is already off, it will instead turn off the other lamp.
This kind of automation would be fairly messy to implement in the normal HA automation engine.
Beta Was this translation helpful? Give feedback.
All reactions