Alert configuration for remote values streaming in from the device.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Alert configuration for remote values streaming in from the device.
Hello,
I have multiple devices of same type where 2 sensor parameters which are streaming in from the device to the platform lets say T1 and P1
Based on that i have created multiple remote things to access those parameter values.
Now i need to create a UI where i need to allow the user to configure the threshold for T1 and P1 with lolo,lo,hi and hihi.
Whenever the streaming value crosses configured threshold value, i need to run a default service for lolo,lo,hi and hihi respectively.
To achieve it, what should be my approach in saving those threshold for each device, and how should i make the configuration for properties such that when it crosses certain threshold, it runs the service automatically.
Thanks
Sunay
Solved! Go to Solution.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Yes its correct understanding, acknowledging alert shows that someone is working on it. E.g. if the motor temp is high and is raising an alert. By acknowledging alert you only show that someone is working on it lets say that it will require reducing RPM on the motor. So unless this action is taken to reduce the motor temp alert will be active.
Whether or not its in Acknowledged state would depends on someone or any automated entity acknowledging it to show certain action is underway to handle the alert.
Acknowledging it will only move it to the Acknowledged state, it doesn't mean the alert is not active, see attached AlertHistory screenshot from my e.g. which shows how an alert was moved from Unacknowledged to Acknowledged with a comment added by the user Administrator that it is being worked upon - but alert is still active.
I can see the summary when i used the GetAlertSummary service on the thing where the property exists on which the alert is active, you can see that in the attached screenshot called GetAlertSummary
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi Sunay, you could consider creating threadshold as a property which will store the values set by the users via your UI and then create a subscription on DataChange event for that Thing/ThingTemplate which contains the streaming property values.
Then you can either write your compare script in that subscription or simply call your already existing compare script which can invoke your default service as needed.
With this whenever there will be new data streaming into the ThingWorx platform, it will file the DataChange event which will invoke the subscription to compare against the threshold value which in turn will execute the default service.
Hope this'll help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thanks for your reply sushanth.
Yes i can go with adding threshold property if it was for a single threshold. Since i need to check for 4 threshold, lo,lolo,hi,hihi in that i need to create 4 threshold property for each parameter.
Correct me if i am wrong, How about considering property alerts where i ll give "lo" has priority4 and "lolo" has priority 3 and with "HiHi" priority 1.
And in the subscription i ll select the event has "Alert" and chose the source property and run the required service in the script.??
But my only question here is... will i be able to find the priority of the alert???
Bcoz i need to execute certain service based on priority.
Thanks
Sunay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Yes you are right, Alert can be another way of achieving this based on your requirement. As to your question Alert's Priority I see under the AlertDefinition class there is a method called getPriorty()
From the snippet you could try using the GetAlertDefinitions()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello Sushanth,
I have worked on this alert by creating a testthing and try to simulate my condition, but somewhere i feel i am wrong.
1. I have created two properties temp and press.
2. Created 2 above alerts with priority 1 & 2.
3. Subscribed the alerts for both the properties.
4. Increased the properties value, I was able to see the alert in alerthistory.
But my question is as long as the value is above the alert limit the alert is active right??? GetAlertSummary didnt give the information for active alerts.
also when i decreased the value to below the alert range i see the alertreset event.
How is the ack event works and if i ack the event, does that mean that even if the property value is above the alert range the alert is not active..???
Is it possible to give more information.
I have attached the testthing for reference.
Thanks,
Sunay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Yes its correct understanding, acknowledging alert shows that someone is working on it. E.g. if the motor temp is high and is raising an alert. By acknowledging alert you only show that someone is working on it lets say that it will require reducing RPM on the motor. So unless this action is taken to reduce the motor temp alert will be active.
Whether or not its in Acknowledged state would depends on someone or any automated entity acknowledging it to show certain action is underway to handle the alert.
Acknowledging it will only move it to the Acknowledged state, it doesn't mean the alert is not active, see attached AlertHistory screenshot from my e.g. which shows how an alert was moved from Unacknowledged to Acknowledged with a comment added by the user Administrator that it is being worked upon - but alert is still active.
I can see the summary when i used the GetAlertSummary service on the thing where the property exists on which the alert is active, you can see that in the attached screenshot called GetAlertSummary
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you sushanth for your explanation. It indeed gave me clear idea.
Thanks
Sunay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Is there anything wrong in my procedures. If so, please do correct me.
