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,
I am using the Swagger to test the GET /AlarmEvents API for one alarm ID. I see that the response shows the alarm history for this alarm ID. See below.
My questions:
1. Is there a way to get a response just for the last alarm state and not the entire history?
2. When this alarm history is being cleared?
Thank you.
Michael
[
{
"AlarmId": "02/Server 1/Values/LightsAllFloors Change of State Alarm",
"Acknowledgeable": 1,
"OccurredOn": "2019-04-09T16:21:18Z",
"LastTransitionedOn": "2019-04-09T17:27:39Z",
"Message": "Building lighting is OFF",
"Priority": 100,
"State": 1,
"Type": "",
"AlarmSourceName": "LightsAllFloors Change of State Alarm",
"Id": "/Server 1|/Server 1/Values/LightsAllFloors Change of State Alarm|e90c40a6-a4ac-4206-9bb5-fc78954b9149"
},
{
"AlarmId": "02/Server 1/Values/LightsAllFloors Change of State Alarm",
"Acknowledgeable": 0,
"OccurredOn": "2019-04-09T16:21:18Z",
"LastTransitionedOn": "2019-04-10T06:42:21Z",
"Message": "Building lighting is ON",
"Priority": 100,
"State": 0,
"Type": "",
"AlarmSourceName": "LightsAllFloors Change of State Alarm",
"Id": "/Server 1|/Server 1/Values/LightsAllFloors Change of State Alarm|644090ed-84d6-4c4c-ba08-2361f8c9fc5b"
},
{
"AlarmId": "02/Server 1/Values/LightsAllFloors Change of State Alarm",
"Acknowledgeable": 1,
"OccurredOn": "2019-04-10T06:42:46Z",
"LastTransitionedOn": "2019-04-10T06:42:46Z",
"Message": "Building lighting is OFF",
"Priority": 100,
"State": 1,
"Type": "",
"AlarmSourceName": "LightsAllFloors Change of State Alarm",
"Id": "/Server 1|/Server 1/Values/LightsAllFloors Change of State Alarm|86351495-0b14-4805-b5dd-0b0aeed0474a"
},
{
"AlarmId": "02/Server 1/Values/LightsAllFloors Change of State Alarm",
"Acknowledgeable": 0,
"OccurredOn": "2019-04-10T06:42:46Z",
"LastTransitionedOn": "2019-04-10T06:49:40Z",
"Message": "Building lighting is ON",
"Priority": 100,
"State": 0,
"Type": "",
"AlarmSourceName": "LightsAllFloors Change of State Alarm",
"Id": "/Server 1|/Server 1/Values/LightsAllFloors Change of State Alarm|909163d4-3aed-497f-93e9-9672e8352cb0"
},
{
"AlarmId": "02/Server 1/Values/LightsAllFloors Change of State Alarm",
"Acknowledgeable": 1,
"OccurredOn": "2019-04-10T06:50:13Z",
"LastTransitionedOn": "2019-04-10T06:50:13Z",
"Message": "Building lighting is OFF",
"Priority": 100,
"State": 1,
"Type": "",
"AlarmSourceName": "LightsAllFloors Change of State Alarm",
"Id": "/Server 1|/Server 1/Values/LightsAllFloors Change of State Alarm|474a6def-9703-498f-afd4-91dd71233000"
},
{
"AlarmId": "02/Server 1/Values/LightsAllFloors Change of State Alarm",
"Acknowledgeable": 0,
"OccurredOn": "2019-04-10T06:50:13Z",
"LastTransitionedOn": "2019-04-10T06:50:44Z",
"Message": "Building lighting is ON",
"Priority": 100,
"State": 0,
"Type": "",
"AlarmSourceName": "LightsAllFloors Change of State Alarm",
"Id": "/Server 1|/Server 1/Values/LightsAllFloors Change of State Alarm|bc9118fd-64b5-4dba-9565-5032c1ba2111"
}
]
Link copied. Please paste this link to share this article on your social media post.
Hi Firdous,
This has already been taken care of via email and can be closed.
Regards,
-Jeff
Posted: 2019-08-06 08:56 AM
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Hi Jeff,
I got the same problem on a site which uses this for alarm surveilance.
Could I get the solution?
Speciallly to question number 2: (When this alarm history is being cleared?)
I scripted a restart of SmartConnector at midnight which clearard the oldest events upto that point.
But any alarm change is being added to the list as long as GET/AlarmEvents is triggered.
This happens every 30 seconds.
The customer now has to look for LastTransitionedOn for each AlarmID to get current status.
I have tested with Smart Connector 2.4.10, 2.4.21 and 2.4.22 together with EcoStruxure Building Operation 1.9.3, 2.0.2 and 3.0.2
/Roar
Link copied. Please paste this link to share this article on your social media post.
Hi Roar,
I will say your fix is likely to add a filter to your web service request with LastTransitionedTime as your key filter. See below for the two query parameters required. Basically you will need to set OnOrAfter to the last known transition time of your previous request, and TransitionedBefore to the current time (UTC). That will get you only updated alarm events. However, because the alarm events endpoint returns all historic states as well with each response, it is possible that even using this filter, you can retrieve two events from the same alarm. In that case, you must filter on the most recent LastTransitionedTime from each AlarmId.
Best Regards,
-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.