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.