User information to be used in alarming script


At the moment we have a setup that the Ewon sends 1 sms to an notification handler at our main office, and from there we send the message to multiple users. and this for all our alarms.
Script we use:

A% = ALSTAT(Index%)
IF A%=2 Then
M$= M$ + “,<01>”
IF A%=0 Then
M$= M$+",<00>"
D$ = “+32*********,gsm,0”
AL_HIST@ = 1

The number is being hard-coded in the script, this works fine, but the handler is an old device with serial connection… this device is starting to act his age :slight_smile: and we want to swap it for a similar device OR the Ewon Sends the multiple sms towards the different user itself. (24h alarm overview is already sent to the users every day so we “don’t need” the central handler anymore per sé)

As the standard alarm handling is done per tag-base, this would be to much work so I was thinking of using the “users” table on the Ewon.
=> Like the standard “ADM”-user, but the other users to be added in this list and the “information”-column would hold the mobile number of the user.

In this case, I would like to do a for loop in the users, and if the information column is filled in with only “numeric characters” and the right “size” , we would use this information to send out the alarm.

Can this info being read from script? and if so, How could I do that?

Thanks in advance for the info!


How many people or numbers would you need to send the alarm messages to? We do have some scripts to send things like this out, but depending on how many alarms/tags you have setup it might change the way this could be written

Hi Tim,

normally it’s around 2-3 peoples we need to notify, occasionally it’s 4-5 peoples (if the end-customer also needs to be notified).

Ok I think I have an idea. I have some code written below that will go through and modify it so that every tag’s email to section would be modified so that you could change the recipients all at once. The code below would be helpful if you choose to do the alarms through the Tag section instead of the BASIC section.

i% = 0
//Browse all Tags
For i%=0 To n%-1
Next i%

Normally we recommend that people use an option like the email to sms relay just so they don’t get charged text messaging fees. I’ll include a doc that mentions these.

Sending Emails with a Flexy.docx (433.3 KB)

You can also modify my code above to use “STO” instead of “ETO” as well if you’d like to change everything at once

Hi Tim,

I see where you are going, but the problem with this setup is, that with holidays, the list of people may vary…

So I would stick with the original plan of the user adding/removing their selves from the user list of the Ewon device itself (without digging into the scripts with all the problems that may arise…).
=> Can I get to the info of this user in script?

example in mind… psuedocoded :slight_smile:

// I loop through the configured users in the ewon
// If the userinformation is valid… only certain size and only alphanumeric characters…
// I copy all the receivers in one giant string… (string-size problems with 4/5 users?)

b% = NumberOfConfiguredUsersInEwon
for…x% = 0 to b%-1
UI% = GETSYS USER, “Information”
If (UI%= valid) then
M$= M$+ UI% + “;”

D$ = GETSYS TAG,“AlHint” //Alarm hint contains message to be sent
SENDMAIL M$, “”, D$, “”

How do I get the Amount of configured users in the Ewon?
In the programming manual (p.126/130), the table states EMA and SMS, but the webinterface of the ewon doesn’t show a field to add it… :frowning:

Could you point me in the right direction :slight_smile:


Hi @Teunen_Peter,

You could potentially do it this way, but it would likely end up being a good amount of code that’s pretty dependent on the strings. I’m going to try and come up with some code to see what we can do with this.


Hi Peter,

Can you take a look at this and let me know if this helps?

Enable email based on user status Version 1.0.docx (99.2 KB)

1 Like

Hi Tim,

I’ll have a look at it this afternoon, seems a viable solution…
I will go through a test-setup to see if it works.

=> Only a little concern of me.
At this moment I send an alarm out and the central handles the alarm 1 in, 4 out.
Now we go to 4 Out in the Ewon… With multiple alarms going out, no concern that the Ewon have problems following/buffering?


Hi Peter,

You shouldn’t have issues sending multiple alarms out from the ewon unless you’re going to be sending many emails over a very short time period.