This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Alert Manager App
#9
(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
Reply


Messages In This Thread
Alert Manager App - by gdimaria - 09.09.2021, 10:19
RE: Alert Manager App - by gdimaria - 09.09.2021, 11:08
RE: Alert Manager App - by gdimaria - 10.09.2021, 08:27
RE: Alert Manager App - by gdimaria - 11.09.2021, 08:30
RE: Alert Manager App - by gdimaria - 12.09.2021, 10:15
RE: Alert Manager App - by admin - 11.09.2021, 11:59
RE: Alert Manager App - by gdimaria - 15.06.2022, 10:32
RE: Alert Manager App - by davidchispas - 14.10.2022, 07:45
RE: Alert Manager App - by admin - 14.10.2022, 07:49
RE: Alert Manager App - by davidchispas - 14.10.2022, 07:54
RE: Alert Manager App - by admin - 14.10.2022, 07:55
RE: Alert Manager App - by gdimaria - 24.01.2023, 08:51

Forum Jump: