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.
Hi,
Can a EWS server generate an alarm that will be displayed in the EBO's alarms pane?
If yes, how?
Thank you.
Mike
Link copied. Please paste this link to share this article on your social media post.
Hi Michael,
Yes, this is exactly what the AlarmItem/AlarmEvents part of the EWS Server are used for.
If you are using SmartConnector.Utilities EwsItemManager to manage your objects you can use the CreateAlarmEvent method to create an alarm event for a given AlarmItem that was created during your Setup processor.
Once you do this, the alarms should show up in EBO if you have the EWS Interface created and configured correctly.
Best Regards,
-Jeff
Link copied. Please paste this link to share this article on your social media post.
Hi Michael,
Yes, this is exactly what the AlarmItem/AlarmEvents part of the EWS Server are used for.
If you are using SmartConnector.Utilities EwsItemManager to manage your objects you can use the CreateAlarmEvent method to create an alarm event for a given AlarmItem that was created during your Setup processor.
Once you do this, the alarms should show up in EBO if you have the EWS Interface created and configured correctly.
Best Regards,
-Jeff
Link copied. Please paste this link to share this article on your social media post.
Hi Jeff, do you have an example of how to do that? Just want to make sure I'm doing it correctly. I can create the alarm object in the set up processor using EnsureAlarmItem method and i can update the state of the alarm and the alarm object changes state in EBO, but it doesn't come up in the alarm viewer, or rather it did until i acknowledged it, now it doesn't come back, even when i change the state of the alarm object.
Link copied. Please paste this link to share this article on your social media post.
Hi Steve,
If you are using the EwsItemManager then all you should need to do is EwsItemManager.CreateAlarmEvent(alarmItem, state, message, priority, type).
If you are using the DataAdapter directly, then you can do:
DataAdapter.ActivateAlarmItem,ResetAlarmItem,AcknowledgeAlarmItem,DisableAlarmItem(AlarmItem, Message, type, Priority)
'
If the Alarm Event isn't showing up in EBO, I may try to check what either what is going on Wireshark, or test it yourself with SoapUI, to make sure you are seeing the expected alarm events.
Best Regards,
-Jeff
Link copied. Please paste this link to share this article on your social media post.
Hi Jeff, working now, used the following:
var myAlarm = DataAdapter.AlarmItems.FirstOrDefault(x => x.AlternateId == "myFolder.myAlarm");
var ewsItemManager = new EwsItemManager();
ewsItemManager.DataAdapter = DataAdapter;
ewsItemManager.CreateAlarmEvent(myAlarm, EwsAlarmStateEnum.Active, "Test Alarm Active", 1);
Thanks.
Link copied. Please paste this link to share this article on your social media post.
Great! Let me know if you run into any more issues.
If I am be picky you can change:
var ewsItemManager = new EwsItemManager();
ewsItemManager.DataAdapter = DataAdapter;
to
var ewsItemManager = new EwsItemManager {DataAdapter = DataAdapter}
Same function, more precise syntax.
Best Regards,
-Jeff
Link copied. Please paste this link to share this article on your social media post.
I am getting the error "Cross EwsServer access is not allowed by the adapter.
at Mongoose.Ews.Server.Data.EwsServerDataAdapter.AssertNoCrossServerAccess(IEwsServerItem item)"
My Code:
EwsAlarmEventType type = new EwsAlarmEventType();
type.Name = "Test Alarm";
type.Description = "This is a test Set state";
var alarmItem = DataAdapter.AlarmItems.FirstOrDefault(x => x.AlternateId == "Alarm: One");
DataAdapter.ActivateAlarmItem(alarmItem, "Alarm Activated", type, 90);
Any ideas why?
Link copied. Please paste this link to share this article on your social media post.
I think you have another EWS with the same name and x.AlternateId == "Alarm: One"); is fetching the first found EWS ID that is in your other server.
Try changing your your condition in your selection to fetch it from the server with the same ServerId where your DataAdapter is connected to:
var CurrentServerID = Int32.Parse(DataAdapter.ServerId);
var alarmItem = DataAdapter.AlarmItems.FirstOrDefault(x => x.AlternateId == "Alarm: One" && x.EwsServerId == CurrentServerID);
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.