12.09.2021, 10:15
(11.09.2021, 12:29)Erwin van der Zwart Wrote: I understand your pain points but the Alert Manager is never developed for tracking alerts and events, to be honest we would never use this controller for tasks like event/alarm management, in those cases we would select EcoStruxure Building Operation that has al these features build-in by default and is even compliant with 21 CFR/FDA Part 11 so you can backtrack every event/alert acknowledgment made by any user that is allowed to execute a certain task.
You could do it with this controller but it requires quite some development time to build an app on that level and I don’t have the ambition to rebuild something we already have in the form of another platform.
(11.09.2021, 11:59)admin Wrote: You can copy storage values via get/set like this:
Code:val = storage.get('source_key') storage.set('destination_key', val)
To copy client settings to another panel you need to update some additional fields in the storage table, below is a full functional script to set multple clients at once with the settings from a source client that is holding the correct settings.
Code:-- Set IP address of the source client you want to copy the settings from source_client_ip = '192.168.10.100' -- Set destination IP addresses of the clients that needs to get the settings from the source client new_client_ip_table = { '192.168.10.101', '192.168.10.102', '192.168.10.103', '192.168.10.104', '192.168.10.105' } -- Do not change anything under this line -- ************************************************************************************************** --source_client_settings = storage.get("Alert_App_" .. source_client_ip) -- Old versions source_client_settings = storage.get("app:alerts:" .. source_client_ip) -- Latest version 1.0.8 -- Update IP addres in the settings table to the new client IP settings and store it into the storage if type(source_client_settings) == 'table' then for _, ip in pairs(new_client_ip_table ) do source_client_settings.scripts[1].clientip = ip source_client_settings.scripts[2].clientip = ip source_client_settings.defaults.clientip = ip source_client_settings.settings.clientip = ip storage.set("Alert_App_" .. ip, source_client_settings) end else log('Could not find alert manager settings from client ' .. source_client_ip .. ' in the storage') end script.disable(_SCRIPTNAME)
Ok, later I realized I can use storage methods... thanks for the script!
Peppe