I should be able to change the weekly scheduling data from Visu to be able to pilot scenarios, is this possible? I found an example in the forum but it refers only to one day, I would need a weekly schedule, is there the possibility to do it in visu without having to modify the scripts?
(14.10.2020, 13:57)Daniel. Wrote: Why don't you create event script and use normal scheduler to trigger it? This way you will have the editing sorted.
Hi
I have to use scripted switching at 4 different times of the day, I would like to give the user the possibility to change the times from view, placing them on virtual date / time objects in order to then set the times in the scheduled scripts but I don't know if it is possible.
You can change the running time for a scheduled script via db queries.
This event script is attached to the time/day object and you need to change 3 to your scheduled script id (see this: https://forum.logicmachine.net/showthrea...0#pid19070):
Code:
12345
id = 3-- scheduled script idvalue = event.getvalue()
params = string.format('%d %d * * *', value.minute, value.hour)
db:update('scripting', { params = params }, { id = id })
script.reloadsingle({ type = 'scheduled' })
(26.11.2020, 07:35)admin Wrote: You can change the running time for a scheduled script via db queries.
This event script is attached to the time/day object and you need to change 3 to your scheduled script id (see this: https://forum.logicmachine.net/showthrea...0#pid19070):
Code:
12345
id = 3-- scheduled script idvalue = event.getvalue()
params = string.format('%d %d * * *', value.minute, value.hour)
db:update('scripting', { params = params }, { id = id })
script.reloadsingle({ type = 'scheduled' })
04.01.2022, 16:00 (This post was last modified: 04.01.2022, 16:28 by Dré.)
(26.11.2020, 07:35)admin Wrote: You can change the running time for a scheduled script via db queries.
This event script is attached to the time/day object and you need to change 3 to your scheduled script id (see this: https://forum.logicmachine.net/showthrea...0#pid19070):
Code:
12345
id = 3-- scheduled script idvalue = event.getvalue()
params = string.format('%d %d * * *', value.minute, value.hour)
db:update('scripting', { params = params }, { id = id })
script.reloadsingle({ type = 'scheduled' })
Wow this looks very simple, is there a manual for things like this?
it is working for me, but im wondering how you know this.
i made next script with knowing how to use it.
Code:
1234567891011121314
Airco_status = event.getvalue()
ifAirco_status == truethenid = 110-- scheduled script idparams = string.format('5 * * * *') --starts every 5 minutesdb:update('scripting', { params = params }, { id = id })
script.reloadsingle({ type = 'scheduled' })
elseid = 110-- scheduled script idparams = string.format('* 1 * * *') --starts every hourdb:update('scripting', { params = params }, { id = id })
script.reloadsingle({ type = 'scheduled' })
end
oké i understand, thanks for the answer.
but it's communicate to some people, who have the knowledge how to work with a LM? or just to trail and error to find out?
just interesting how people know these things.
im just a beginner and curious
I'm looking for a script that turn on an off a schedule.
I know about the option with a groupadress to enable and disable it, but if it is possible i would do it with a script.
Map a virtual object to scheduler on/off an use grp.update. You can use object name like "Scheduler A on/off" instead of a group address to make the code more readable.
16.09.2022, 15:39 (This post was last modified: 18.09.2022, 12:32 by Dré.)
I'm afraid i was wrong.
I meant to asking if there a script like
Code:
12345
id = 3-- scheduled script idvalue = event.getvalue()
params = string.format('%d %d * * *', value.minute, value.hour)
db:update('scripting', { params = params }, { id = id })
script.reloadsingle({ type = 'scheduled' })
But not changing the time, but just enable and disable it?
I think I have to change line 4, but don't know what to use.
------------------------------------------------------------------------------
I was still trying to solve my problem, but he always set the Scheduled script off, never on, also when the input value was true
Code:
1234567
verl_aanrecht_TM = grp.getvalue('1/4/5') --'0 verl. aanrechtblad (tm)'ifverl_aanrecht_TM == truethenscript.set('12.01 Check if Light can turn Off', enable)
elseifverl_aanrecht_TM == falsethenscript.set('12.01 Check if Light can turn Off', disable)
end
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:
1234567891011
id = 112-- scheduled script idvalue = 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 idvalue = event.getvalue()
params = string.format('00 24 * * *', value.minute, value.hour)
db:update('scripting', { params = params }, { id = id })
script.reloadsingle({ type = 'scheduled' })
29.02.2024, 20:13 (This post was last modified: 29.02.2024, 20:15 by Dré.)
(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:
1234567891011
id = 112-- scheduled script idvalue = 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 idvalue = 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).