Hi,
I have a script that triggers several scripts, sometime it works, sometime just part of the included scripts are triggered. I cannot find any logic to it.
The script are suppose to turn on Zone 1 and Zone 2 on my Denon reciever and also set the volume on both the Zones. Works on their own and sometimes all together. I tried with delays if it could have to do with the reciever having problems to cope with several commands at the same time - but still same result - works sometimes, and parts of the script sometimes.
Iâm fairly sure that all of your delays are doing nothing meaningful.
The turn_on service calls from the main script are non-blocking. That means that each sub-script is going to run at exactly the same time, perform their action, and then call for a delay. You are better off adding the delays to your main script. In fact, Iâm not even sure why you have sub-scripts.
If you show all of the scripts in the GUI and watch their state you should see them all flip on, and then off at different intervals based on your delays.
I canât find it now but I remember (and obey) not to use numbers in script names or at least not to start with numbers. Something like you have to format it different elsewhere.
It was here, I thought I had problem with script numbers but perhaps it was only entities in templating.
If your template uses an entity_id that begins with a number (example: states.device_tracker.2008_gmc) you must use a bracket syntax to avoid errors caused by rendering the entity_id improperly. In the example given, the correct syntax for the device tracker would be: states.device_tracker[â2008_gmcâ]
There is nothing wrong with your script names, otherwise you would be seeing errors in your log and it would probably throw errors on a card in the front end that it couldnât load the component. However, those are poor script names, since they donât convey meaning. Yes, they do âcause problemsâ in templates, but as pointed out also that can be solved with [], so they arenât a problem.
Anyways, try this since it is what I suggested (actual sequential calls with delays) and will probably work if you extend delays to fix anything that doesnât execute properly (I hope formatting is correct, it is based off of what you posted).