A .NET Core console application that monitors PHD2 for StarLoss events and sends real-time alerts to Slack.
GlasgowAstro.GuideAlert is a monitoring tool designed for astrophotographers using PHD2 guiding software. The application continuously monitors PHD2's event stream via TCP connection and automatically sends notifications to a Slack channel when star loss events are detected, allowing immediate response to guiding issues during imaging sessions.
During long astrophotography imaging sessions, losing the guide star can result in ruined sub-exposures and wasted imaging time. This application provides immediate notification when PHD2 loses the guide star, enabling astrophotographers to:
- Respond quickly to guiding failures
- Minimize lost imaging time
- Monitor remote imaging setups
- Maintain awareness of equipment status during unattended sessions
- Initialization: The application starts and loads configuration from
appsettings.json - Connection Test: Establishes TCP connection to PHD2 (default: localhost:4400) and verifies connectivity
- Alert Test: Sends a test message to the configured Slack webhook to verify alert system
- Monitoring: Continuously reads and parses JSON event messages from PHD2's event stream
- Detection: When a "StarLost" event is detected in the stream, triggers an alert
- Notification: Sends configured alert message to Slack webhook for immediate notification
- .NET 8.0: Cross-platform console application
- Dependency Injection: Microsoft.Extensions.DependencyInjection for service management
- Configuration: JSON-based configuration with Microsoft.Extensions.Configuration
- Logging: Serilog with file and console output
- HTTP Client: HttpClientFactory for Slack webhook requests
- JSON Parsing: Newtonsoft.Json for event stream deserialization
Configuration is managed through appsettings.json:
{
"GuideAlertSettings": {
"SlackWebhookUrl": "your-slack-webhook-url",
"AlertMessage": "Star lost!",
"TestAlertMessage": "Test alert!",
"PhdHost": "localhost",
"PhdPort": 4400,
"LogPhdEventsToConsole": true
}
}- SlackWebhookUrl: Slack incoming webhook URL for alert notifications (required)
- AlertMessage: Message sent when star loss is detected
- TestAlertMessage: Message sent during initial connection test
- PhdHost: PHD2 server hostname (default: localhost)
- PhdPort: PHD2 TCP event server port (default: 4400)
- LogPhdEventsToConsole: Enable/disable console logging of all PHD2 events
- .NET 8.0 or later runtime
- PHD2 guiding software running with event server enabled
- Slack workspace with incoming webhook configured
dotnet builddotnet run --project GlasgowAstro.GuideAlertPre-alpha - Under active development
- Website: https://glasgowastro.co.uk
See repository for license information.