SmartConnector Forum
Schneider Electric support forum about SmartConnector applications for integration of other building management systems (BMS) into EcoStruxure Building Operation.
Link copied. Please paste this link to share this article on your social media post.
Dear:
If I wanna use SmartConnector to sync alarms of third party system into SBO, is there a supported method in SmartConnector API that I can use to set a live alarm message into SBO.
Now I only find the supported function for a client to set values into SBO(as EWS server) is SetValues(), which can't be used to send live alarm message.
Thanks,
Austen Yin
Link copied. Please paste this link to share this article on your social media post.
Hi Austen,
Yes, no matter where the alarm messages come from, if they are not native 'alarm' objects in SBO they need to be read into SBO through some sort of interface.. whether it be EWS (most likely in your case).. or BACnet or some other interface in SBO that supports alarming.
As far as "Mirroring" alarms, What you will effectively be doing is fetching the Alarms from the third party systems with SmartConnector (EWS if SBO.. or some other mechanism if not) and converting those alarms into EWS alarms in a SmartConnector EWS Server.. And yes, once an EWS Interface is created in the master ES and points at the SmartConnector EWS server.. SBO will start reading the alarms from SmartConnector automatically.
Also to mirror Mark's comment, you will not need to develop your own EWS Server in SmartConnector, as SmartConnector already contains the classes necessary to facilitate this. What you may need to do is override some of the methods in order to add custom functionality. For example, you may want to acknowledge the actual alarm in the child system when the alarm is acknowledged from the master ES (the default SmartConnector EWS server functionality is to Acknowledge the alarm in the SmartConnector EWS server only). You can see an example of overriding the default behavior of an EWS method in the Mongoose.Ews.Server.Sample Nuget package. Also if you need more sample code, please ask and we will try and provide some for you.
-Jeff
Link copied. Please paste this link to share this article on your social media post.
There are a couple of different ways I'd achieve this behaviour.
You're discussing using the EWS Client to set a StruxureWare value which would in turn require a StruxureWare alarm to be configured on the object. There are several reasons why you might chose this approach at present.
Firstly, by setting a StruxureWare value which has an SBO alarm attached you will not need to poll your SmartConnector server and will not have any chance of missing the alarm event. (Assuming your alternative was the inverse of alarming the remote EWS value which would cause that value to be polled)
Secondly, if you were to use the alternative approach of presenting the alarm via an EWS server, you are limited to the actions that it has in SBO. EWS alarms are really more like messages, you cannot attach specific behaviour to those alarms such as cause notes, graphic attachments etc.
If you want to use SmartConnector to present an EWS server which has alarm, then you can do this. You need to create an EWS Server instance with SmartConnector, create the objects and then you can trigger EWS alarms. I believe this is covered in the Nuget sample package Mongoose.Process.Sample - if you find you need some more assistance please reply back and I'm sure me or someone else can provide you the support and a code snippet if required for this!
Link copied. Please paste this link to share this article on your social media post.
I think the approach of using SmartConnector as the EWS Server with SBO as the EWS Client is the recommended approach.
As Adam said, you would need to provision a SmartConnector EWS Server first. This can be done either from a Processor (see the samples as Adam suggested) or from the Portal itself.
Once provisioned you would then manage the data that is being "served" to SBO by using the SmartConnector EwsServerDataAdapter class from a Processor subclass which is reading data from your third party system and generating the corresponding entities: AlarmItem, AlarmEvent etc.
Link copied. Please paste this link to share this article on your social media post.
Thanks Adam, I think I need clarify my question as:
1. I wish the ES would receive the third-party alarms message and display them in "Alarms"window directly, without create any EWS interface(the ES role as EWS server)
2. I am not going to set a StruxureWare value which has an SBO alarm attached, I wish I can write a alarm message into the "Alarm Server"(assume it is the name) of ES if possible.
3. As you said in you Secondly way, it may be limited by attach specific behavior to those alarms such as cause notes, graphic attachments etc., Then how about I just need show the alarm message in the "Alarms" window to be acknowledged?
User case would possible be as:
Assume I have 3 ES server, By using the SmartConnector to develop an application, I wonna use only one ES as master to receive all alarms also including the ones from the other two ES. and all alarms will be as natural as its own.(The other two ES may be replaced by third-party system)
Would it be possible?
Thanks a lot
Austen
Link copied. Please paste this link to share this article on your social media post.
Hi Austen,
Currently, without using SBO alarms natively,(aka setting a point in SBO to trigger a native alarm). There is no way to get alarms into SBO without the use of an interface (BACnet or EWS for example).
Even if one were to look at using the WorkStation SDK.. there is no way to send alarms directly to an ES.The only way in either case would be to create an interface at some point.. either BACnet or EWS.. or otherwise.
As far as your use case. We have done a proof of concept in the StruxureLab using SmartConnector (called Cerberus) that does exactly what you are asking for and more. I have attached a very informal powerpoint describing it. So it is indeed possible to do what you are trying to accomplish. However, you would have to note that the Alarm Acknowledgement back to the 'child' ES would be the EWS user.. and not necessarily the user who Acknowledged the alarm in the 'Master'.
In the case that your other systems are replaced by a third party system, that would be a different story as the mechanism for fetching the alarms from the third party system would change, but this kind of thing is exactly what SmartConnector is designed to accomplish, so it also would be possible.
-Jeff
Link copied. Please paste this link to share this article on your social media post.
Thanks Jeffrey:
You answer is absolutely helpful.
According to your explanation, no matter where the alarm messages come from,another ES or third-party system, we have to mirror all the alarms in a self-developed EWS server by using SmartConnctor framework, and then the master ES will get all alarms by creating a EWS interface. Am I right?
Cheers
-Austen
Link copied. Please paste this link to share this article on your social media post.
You don't have to develop an EWS Server, SmartConnector provides that functionality for you. You can provision one using SmartConnector's web management portal or programmatically using the EwsServerDataAdapter class. Typically you would then manage the data served with a Processor Extension you would write, again using the EwsServerDataAdapter class.
Link copied. Please paste this link to share this article on your social media post.
Hi Austen,
Yes, no matter where the alarm messages come from, if they are not native 'alarm' objects in SBO they need to be read into SBO through some sort of interface.. whether it be EWS (most likely in your case).. or BACnet or some other interface in SBO that supports alarming.
As far as "Mirroring" alarms, What you will effectively be doing is fetching the Alarms from the third party systems with SmartConnector (EWS if SBO.. or some other mechanism if not) and converting those alarms into EWS alarms in a SmartConnector EWS Server.. And yes, once an EWS Interface is created in the master ES and points at the SmartConnector EWS server.. SBO will start reading the alarms from SmartConnector automatically.
Also to mirror Mark's comment, you will not need to develop your own EWS Server in SmartConnector, as SmartConnector already contains the classes necessary to facilitate this. What you may need to do is override some of the methods in order to add custom functionality. For example, you may want to acknowledge the actual alarm in the child system when the alarm is acknowledged from the master ES (the default SmartConnector EWS server functionality is to Acknowledge the alarm in the SmartConnector EWS server only). You can see an example of overriding the default behavior of an EWS method in the Mongoose.Ews.Server.Sample Nuget package. Also if you need more sample code, please ask and we will try and provide some for you.
-Jeff
Link copied. Please paste this link to share this article on your social media post.
Thanks Mark, when I talked about develop my own EWS server in SmartConnector, Exactly I am saying using EwsServerDataAdapter class to do it with override the get and set methods.
Link copied. Please paste this link to share this article on your social media post.
Thanks Jeff, you explanation is already very clear to me about the alarm mechanism of SBO.
For the Mongoose.Ews.Server.Sample, I understand it and ever designed an application for a demo project, works well until now.
Besides, I DO wonder is there any documents which describe all or most of the method/functions of SmartConnector and how to use them, since now most of my understanding are come from trying to use the library files and figure out how the method in it would be used, as you know, the two samples in Mongoose NuGet is very limited.
Cheers
Austen
Link copied. Please paste this link to share this article on your social media post.
Hi Austen,
Other than the 'Developers Guide' and the 'Installation and Configuration Guide' there are no other formal documents such as listing and describing all the methods/functions. However, all the methods/functions in SmartConnector have Metadata attached to them, so you should be able to see descriptions of all these methods within Visual Studio.
If something is not clean, or you are wondering how to do a certain thing, please post here and we will try our best to answer, and subsequently update the metadata.
Also with the 'Cerberus' extension, I did a fairly complex way of sending the alarms to the master ES as instead of using native SmartConnector AlarmItems and events, I did it all with the included In-Memory Cache. That way I could avoid needing to have actual Value Items in the case that it was a 'system alarm' that doesn't have an attached value item. If you wanted, I could potentially show you the code for this, however, it would have to be noted that this was a proof of concept and it is not "cleaned" up for production. In fact, it is missing some functionality with filtering, but at the very least it would give you another example of how this can be done.
I would recommend updating to the current SmartConnector release of 2.1.83 (You can get these from www.smartconnectorserver.com). So you can get the latest released functionality.
-Jeff
Link copied. Please paste this link to share this article on your social media post.
Thanks Jeff:
About the Cerberus, extension, it will be helpful to me if you share with me the code.
Cheers.
-Austen
Link copied. Please paste this link to share this article on your social media post.
Hi Jeff:
I tried to add EWS alarms in a SmartConnector EWS Server but failed, could you please help possible provide me some sample code for this?
I am thinking two ways ( for example, one digitalValue "Test", one ChangeofState Alarm "AlarmTest", when "Test" =false then generate a ChangeOfStatus alarm).
1. in EwsServerDataAdapter, to add points to EWS Server, using the AddValueItem() method to add a "Test" value item and using AddAlarmItem() to add a "AlarmTest" alarm items with the "EwsValueItem" binding "Test"
---In this way, there is no way to set the alarm trigger condition as what can be done in SBO, then how could be the alarm triggered?
2. in EwsServerDataAdapter, create all live alams according to the alarm information received from ES or third-party system, Is it the way and how?
Cheers
Austen Yin
Link copied. Please paste this link to share this article on your social media post.
Hi Austen,
See below for the answers to your questions:
2. If you simply want to mirror the alarms another ES, and return it to the calling EWS Client. There are a few ways you can probably do this:
-Jeff
Link copied. Please paste this link to share this article on your social media post.
Hi Jeff:
In order to poll the updated alarms from ES, I need some explanation about parameters of GetUpdatedAlarmEvents() function:
As the definition of the function is as:
GetUpdatedAlarmEvents(int? priorityFrom, int? priorityTo, string moreDataRef, string[] types, string lastUpdate)
My example would be:
String lastUpdat=null // define as global variable
int PriorityFrom=0;
int PriorityTo=100;
String MoreDataRef="????"; // Please help explain what this parameter should be, I come across exception here
String[] types=c.GetAlarmEvenType(); //c is a connected EwsClient.
GetUpdatedAlarmEvents(priorityFrom, priorityTo, moreDataRef,types, lastUpdate);
lastUpdate=DateTime.Now.ToString();
Please help clarify.
Cheers
Austen
Link copied. Please paste this link to share this article on your social media post.
Hi Austen,
The MoreDataRef is an EWS Parameter used when multiple pages of Alarms are returned. If you receive MoreDataAvailable = true and a MoreDataRef in your intial GetUpdatedAlarmEvents request, the thing to do would be to send another GetUpdatedAlarmEvents passing in the MoreDataRef from the previous response. This will get the next page of events. This would continue until MoreDataAvailable=false.
If you don't have a MoreDataRef, pass in an Empty string (and maybe null works as well?)
The definition of these parameters can be found in the EWS Specification if you are interested. The spec is posted in the Download Center of www.SmartConnectorServer.com.
However, I would definitely recommend using the AlarmItemReader class in Mongoose.Process.Ews in order to read your alarms. This class was created to help read alarms, it handles paging automatically, knows how to handle the NeedsRefresh parameter, and also knows when to use GetAlarmEvents vs GetUpdateAlarmEvents. It is reccommended to save the LastUpdate either in the In Memory Cache, or in a Processor Value (In Memory cache approach shown below).
using (var ar = new AlarmItemReader()
{
EwsEndpoint = ewsEndpoint,
AuthenticationScheme = authenticationScheme,
UserName = username,
Password = password,
LastUpdate = _cache.RetrieveItem("LastUpdate#SomeServerId"),
PriorityFrom = 0,
PriorityTo = 100
})
{
var response = ar.ReadData();
_prompts.AddRange(response.Prompts);
if (!response.Success) return;
if (!response.DataRead.Any()) return;
foreach (var alarm in response.DataRead)
{
// Handle the alarm events
}
_cache.AddOrUpdateItem(ar.LastUpdate, "LastUpdate#SomeServerId");
}
-Jeff
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.