(01.07.2019, 10:54)admin Wrote: Do you need to replace group addresses in script source code only or trigger group addresses for event scripts as well?
I need change both, groups addresses in the script sand the trigger groups addresses.
03.07.2019, 12:48 (This post was last modified: 04.07.2019, 07:16 by Snoolik.)
(02.07.2019, 05:59)fabiorusco Wrote:
(01.07.2019, 10:54)admin Wrote: Do you need to replace group addresses in script source code only or trigger group addresses for event scripts as well?
I need change both, groups addresses in the script sand the trigger groups addresses.
Hello, I made alike script for shifting all adresses through db updating today. It shifts all ga with a step in modbus mapping, visualization, trends, object logs and a trigger for event scripts. Also it can change name of ga.
I had a event script for ga 0/0/23, which decoded is 23, shifting with a step 256 make it 0/1/23. So, you can improve it to solve your task.
Script was very simple just for testing:
Code:
1
log(grp.getvalue('0/0/23'))
Both of this scripts were tested on 20180828 LM Firmware. Homelynk can have little difference in db structure.
If you have any questions, I'll try to answer =)
03.07.2019, 14:32 (This post was last modified: 03.07.2019, 14:34 by fabiorusco.)
I only need to change the "Main group address", in all script and trigger group address for event script.
example 15/7/1 should be 11/7/1 (from 1 to 17, excluded 15 that is the number from I start).
(03.07.2019, 14:32)fabiorusco Wrote: I only need to change the "Main group address", in all script and trigger group address for event script.
example 15/7/1 should be 11/7/1 (from 1 to 17, excluded 15 that is the number from I start).
I edited my past code a bit to improve its understanding and rewrote script for changing ga in body of scripts. Now the "step" is the sum of the three parameters: main group + middle group + group address. If you need to change only main group then you can change first parameter of "step" and other set to 0.