Listing email alerts for a specific device
-
Hi,
I was wondering if it's possible to make a page which lists email alerts on it (for a specific device) which would list only the items which are in an alert status - I had a look at the discussion in this post here:
https://forum.infiniteautomation.com/topic/2550/configuration-of-filtering-email-alerts/
and it seems the background for this is about 2 to 3 years old - so I'm not sure if it's still current.
Essentially what I want to do is:
-
create a watchlist for each alert on a specific device
-
display this watchlist on a page either: filtering (removing) inactive items (or) list them by value, with 'inactive' at the bottom
Any pointers to get me started would be appreciated.
Thanks
Richard
-
-
@richard-mortimer said in Listing email alerts for a specific device:
make a page which lists email alerts on it
Do you mean events / alarms?
-
@jared-wiltshire said in Listing email alerts for a specific device:
@richard-mortimer said in Listing email alerts for a specific device:
make a page which lists email alerts on it
Do you mean events / alarms?
Yes, sorry for my terminology, we also use the alarms to fire off emails to groups/users.
Thanks
Richard
-
OK, there is no way to do this from a watchlist. You will have to create a custom dashboard / component to do this. Unfortunately its not super easy as the point objects do not have an active event / alarms property to filter on. I might try and sneak something like this into the 3.6 release for you.
-
Hi Richard,
Jared's solution may be the correct one for the future.
In the present, you can always do a general purpose technique like encoding that information into data points for use elsewhere. This thread sends an email for the last day's events, but it would show how to query the events from a script, currently. Then compose the JSON object you need to power your page and serialize it into an alphanumeric point.
https://forum.infiniteautomation.com/topic/3147/email-last-day-s-events
-
@jared-wiltshire said in Listing email alerts for a specific device:
I might try and sneak something like this into the 3.6 release for you.
Thanks!!
-
@phildunlap said in Listing email alerts for a specific device:
Hi Richard,
Jared's solution may be the correct one for the future.
In the present, you can always do a general purpose technique like encoding that information into data points for use elsewhere. This thread sends an email for the last day's events, but it would show how to query the events from a script, currently. Then compose the JSON object you need to power your page and serialize it into an alphanumeric point.
https://forum.infiniteautomation.com/topic/3147/email-last-day-s-events
Cheers for that - is the first script on the page Java, or Javascript? Where would be the suggested place to store the script?
Thanks
Richard
-
As is in the thread, it's a scripting data source. It's JavaScript that invokes the Java directly. I didn't supply the intended cron pattern, though, probably something like
0 0 0 * * ?
for that thread, but maybe someone wants an 8 AM summary instead?