SafetyEvents Property Implementation Notes
SafetyEvents Action (mandatory)
- Action Name:
SafetyEvents - Action Parameters:
string.Empty - Returns: A JSON encoded string containing an array of
SafetyEventobjects .
//Example 1 - No events active
[
]
//Example 2 - One event active
[
{
"Source":"ASCOM Sentinel at My Observatory",
"Name":"Observing conditions SkyBrightness",
"Id":"723e775aab_SkyBrightness",
"Type":"SkyBrightness",
"Trigger":"AboveThreshold",
"Description":"SkyBrightness rule 1 violated: Value 85.83 is greater than 0.25.",
"EventTimeUtc":"2026-04-15T08:05:03.2139641Z"
}
]
// Example 3 - Two events active
[
{
"Source":"ASCOM Sentinel at My Observatory",
"Name":"Observing conditions SkyBrightness",
"Id":"723e775aab_SkyBrightness",
"Type":"SkyBrightness",
"Trigger":"AboveThreshold",
"Description":"SkyBrightness rule 1 violated: Value 85.83 is greater than 0.25.",
"EventTimeUtc":"2026-04-15T08:05:03.2139641Z"
},
{
"Source":"ASCOM Sentinel at My Observatory",
"Name":"Observing conditions StarFWHM",
"Id":"723e775aab_StarFWHM",
"Type":"StarFWHM",
"Trigger":"AboveThreshold",
"Description":"StarFWHM rule 1 violated: Value 1.03 is greater than 0.8.",
"EventTimeUtc":"2026-04-15T08:05:03.2147037Z"
}
]The response has been whitespace formatted for readability, but the actual response should be a single line of JSON text without unnecessary whitespace.
Alpaca Clients and Devices
Alpaca clients must send an HTTP PUT request to the safety monitor's action endpoint as described here:
Alpaca Action Endpoint with application/x-www-form-urlencoded body parameters:
ActionName= "SafetylEvents"ActionParameters= An empty string.
Alpaca devices must return a standard Alpaca response object whose Value field is a string containing a JSON encoded array of SafetyEvent objects. Or return an error if they cannot complete the request.
{
"Value":"[
{
"Source":"ASCOM Sentinel at My Observatory",
"Name":"Observing conditions StarFWHM",
"Id":"c25e51ed9e_StarFWHM",
"Type":"StarFWHM",
"Trigger":"AboveThreshold",
"Description":"StarFWHM rule 1 violated: Value 1.07 is greater than 0.8.",
"EventTimeUtc":"2026-04-16T08:00:54.8172238Z"
}
]",
"ClientTransactionID":66,
"ServerTransactionID":428,
"ErrorNumber":0,
"ErrorMessage":""
}The response has been whitespace formatted for readability, but the actual response should be a single line of JSON text without unnecessary whitespace.
On receipt, the client should check the ErrorNumber field:
- = 0 - The
Valuefield can be de-serialised to yield an enumerable collection ofSafetyEventobjects. - ≠ 0 - An error occurred and the
ErrorMessagefield should be examined to determine the cause of the error.
COM Clients and Drivers
COM clients should call the safety monitor instance's Action method with ActionName = "SafetyEvents" and ActionParameters = "".
COM devices should return a string containing a JSON array of SafetyEvent objects as shown above.
On return from the call, COM clients should:
- No exception - De-serialise the returned string to an enumerable collection of
SafetyEventobjects - Exception - Catch and handle any exception thrown by the safety monitor.