Hello, just installed Home Assistant to a Pi I had laying around and have a quick question.
I have a standing desk that I have integrated with HomeKit succesfully. It is able to control my desk and it has several device action built that I can utlitize.
I am trying to learn how to write a script(s) that will do that following.
Ultimately, I want the desk to go to height preset 1 by starting a script, timer down for 30 minutes, then start the next script, which goes to a different precept for 10 minutes, and then call the original script…I’m sure there’s an elegant way to create a loop or some sort of for statement, but I’m not familiar with the syntax.
So I have created both scripts as follows:
Script 1:
Device action - Press preset button 1
Timer start on for 30 mintutes
Run script 2
Script 2: Device Action - Press preset button 2
2. Timer start on for 10 minutes
3. Call script 1
Both scripts run in Single mode.
I would like a button that starts one of the scripts. I would also like a button that either pauses this loop, or probably better on resources, ends the loop.
Can I do that with the provided script GUI, or do I need to do it with manual code?
I’m still learning. I’ve been reading tutorials and watching videos, but I still don’t understand a lot of the basics. For instance, many of the videos I see show the three-dot menu button on the Home-Overview screen, top right on the blue bar, I don’t have those.
Others show their scripts showing up automatically on the dashboard as well, but that hasn’t happened for me either.
I’m fine with writing code (copy/paste, adapt templates, etc), but I don’t know any languages per se.
So that I understand, items like “button 1” and button.abc, those are things I will need to create, and then get the name/ID for an put into this automation, correct?
Sorry if it came off that way, I would like buttons, I have been trying to figure out how to create/add them. But the tutorials and help/how-to’s I’ve been referencing seem to be outdated, with menu items and options I don’t have, or have been moved elsewhere (I’m guessing).
This is the most helpful response and one that I was able to accomplish after struggling with the YAML. I kept getting errors that were incredible vague, and that no amount of reading forum/reddit responses could help me resolve.
Also tried having Gemini write me some code, same types of errors.
I made 3 Automations, and the solution is quite elagant, when the height of my desk is above or below a defined threshhold, after time it will press a preset button, as long as my booelan is set to true.