21.02.2018, 16:37 (This post was last modified: 21.02.2018, 16:54 by buuuudzik.)
Here there is a script for mass generate new GAs via script according to specified template and rules. It can save a lot of time and clicking but before do some BACKUP.
(21.02.2018, 16:37)buuuudzik Wrote: Here there is a script for mass generate new GAs via script according to specified template and rules. It can save a lot of time and clicking but before do some BACKUP.
-- GENERATE all group addresses according to specified template and conditionsfirstId, lastId = 1, 10-- e.g. Blind1 to Blind10canChangeMiddle = true-- if yes can change e.g. 0/0/255 -> 0/1/0canChangeMain = false-- if yes can change e.g. 0/7/255 -> 1/0/0offset = 10-- address offset between first GA in 2 devices e.g. Blind41_up/down - Blind40_up/down = 0/0/20 - 0/0/10 = 10curMain, curMiddle, curSub = 0, 0, 0-- initial GA e.g. 1, 2, 3 means 1/2/3numberOfAddedGAs, numberOfNotAddedGAs = 0, 0-- init the counters of new or updated objects and not created objectsforcurId = firstId, lastId, 1docurSubMax = curSub + 7-- maximum subaddress in current iterationifcurSubMax > 255andcanChangeMiddlethenif ((curMiddle + 1) <= 7) thencurSub, curMiddle = 0, curMiddle + 1elseifcanChangeMainand (curMain + 1) <= 15thencurSub, curMiddle, curMain = 0, curMiddle + 1, curMain + 1elselog('Cannot increment main group.'); breakendendelseif (curSubMax > 255andnotcanChangeMiddle) thenlog('Cannot increment middle group.'); breakendcurMainAndMiddle = curMain .. '/' .. curMiddle .. '/'template = {
{datatype = dt.bool, address = curMainAndMiddle .. curSub + 1, name = 'Blind' .. curId .. '_up/down'},
{datatype = dt.bool, address = curMainAndMiddle .. curSub + 2, name = 'Blind' .. curId .. '_step/stop'},
{datatype = dt.uint8, address = curMainAndMiddle .. curSub + 3, name = 'Blind' .. curId .. '_scene'},
{datatype = dt.scale, address = curMainAndMiddle .. curSub + 4, name = 'Blind' .. curId .. '_height'},
{datatype = dt.scale, address = curMainAndMiddle .. curSubMax, name = 'Blind' .. curId .. '_height status'} -- Maximum subaddress
};
fork,vinipairs(template) dores = grp.create(v)
ifresthennumberOfAddedGAs = numberOfAddedGAs + 1elsenumberOfNotAddedGAs = numberOfNotAddedGAs + 1endendcurSub = curSub + offsetendmessage = ''ifnumberOfAddedGAs > 0thenmessage = 'Successfully added or updated ' .. numberOfAddedGAs .. ' new GAs. 'endifnumberOfNotAddedGAs > 0thenmessage = message .. 'There was ' .. numberOfNotAddedGAs .. ' errors(not added or updated objects).'endifnumberOfAddedGAs > 0ornumberOfNotAddedGAs > 0thenlog(message) endscript.disable(_SCRIPTNAME)
Hello,
Is it possible to copy the G.A. of a logic machine and then paste them on another from a backup? It is not necessary to copy all the parameters of the BACKUP but only the addresses so as not to rewrite all the addresses on the second L.M. (The addresses were not created from ETS but directly on the logic machine can not import them via ESF)
B. R.
If you export all GAs then you can use import neighbors feature. To use it you have to enable w Remote services first. All exported GAs will be imported to second LM.
(25.06.2019, 09:26)Daniel. Wrote: If you export all GAs then you can use import neighbors feature. To use it you have to enable w Remote services first. All exported GAs will be imported to second LM.
Thank you for your quick reply. Remote services is enable.
It does not work when we use this import between a SpaceLynk and a Logic machine? (Error : host not found) B.R.