11.06.2020, 00:16
(This post was last modified: 11.06.2020, 00:24 by Erwin van der Zwart.)
Hi,
I was triggered by the request and wanted to see if it was do-able and offcourse as always there is a way and i liked the challenge (:
You need to create sync.lp on the master controller so run the script once in there, now we can request the scheduler data from the main database from another controller.
In the other controllers you need to create a event based script with a trigger or a resident/scheduled script at the desired interval, you also need to create the schedulers and holidays with the exact same names as in the main controller., events can be empty as they are synced anyway.
Events and holidays will by synced from the main controller, all scheduler events and holidays with the same name will be cleared first (after a check that request for data was succesful) and then populated with the data from the main controller. All schedulers events and holidays in the slave controller with another name will stay untouched.
The start/end date from schedulers with the same name as in the main controller will also be syncronised, including the active state. So if you disable the scheduler or events in the main controller, they will be also synced as disabled in the slaves.
Group adrresses for output and disabling the scheduler are not synced so you can attached them to any addresses you like in the slaves.
It works even over the internet, i just uploaded my scheduler events to the LM demo and it was poulated with all events i have at home (:
Here are the 2 files you need:
BR,
Erwin
I was triggered by the request and wanted to see if it was do-able and offcourse as always there is a way and i liked the challenge (:
You need to create sync.lp on the master controller so run the script once in there, now we can request the scheduler data from the main database from another controller.
In the other controllers you need to create a event based script with a trigger or a resident/scheduled script at the desired interval, you also need to create the schedulers and holidays with the exact same names as in the main controller., events can be empty as they are synced anyway.
Events and holidays will by synced from the main controller, all scheduler events and holidays with the same name will be cleared first (after a check that request for data was succesful) and then populated with the data from the main controller. All schedulers events and holidays in the slave controller with another name will stay untouched.
The start/end date from schedulers with the same name as in the main controller will also be syncronised, including the active state. So if you disable the scheduler or events in the main controller, they will be also synced as disabled in the slaves.
Group adrresses for output and disabling the scheduler are not synced so you can attached them to any addresses you like in the slaves.
It works even over the internet, i just uploaded my scheduler events to the LM demo and it was poulated with all events i have at home (:
Here are the 2 files you need:
Create sync lp.lua (Size: 1.21 KB / Downloads: 37)
Sync schedulers from another controller based on name requires sync.lp on other controller.lua (Size: 4.91 KB / Downloads: 32)
BR,
Erwin