This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Dynamically change the Scheduled program time parameters from visualization
#20
(29.02.2024, 19:26)Amelie Wrote: I have a  scheduled script which changes the value of a group address to 0 and then I have a second scheduled script which puts the value back to 1. The first script has ID=112 and the second 113.

Now, I want to change the time that both scripts are performed, using a script. I want that the first script is performed at 23 o'clock and the second script at 24h. I changed the code to:

Code:
id = 112 -- scheduled script id
value = event.getvalue()
params = string.format('00 23 * * *', value.minute, value.hour)
db:update('scripting', { params = params }, { id = id })
script.reloadsingle({ type = 'scheduled' })
--
id = 113 -- scheduled script id
value = event.getvalue()
params = string.format('00 24 * * *', value.minute, value.hour)
db:update('scripting', { params = params }, { id = id })
script.reloadsingle({ type = 'scheduled' })

But, nothing is changing. What am I doing wrong?

I think you use it on a wrong way.
Go to scripting and then Scheduled, create a new script here, fill in when it has to run.
* = every minutes/hours
not forget to activate.
click on editor (green note on the right side) and put there the script you want to run, what you want to set to 0 and set to 1, not the script of above here.
not sure what you want but 0 and 1 are not allowed for a Boolean, so maybe you have to change it in true or false, but this you can try when you run the script manual.

the script in this topic is for changing a scheduled script, for when it has to run. (the time).
Reply


Messages In This Thread
RE: Dynamically change the Scheduled program time parameters from visualization - by Dré - 29.02.2024, 20:13

Forum Jump: