This guide covers how to configure notifications for generator events using Apprise and system notification channels.
- Overview
- Apprise Integration
- GenMaster Notifications
- GenSlave Notifications
- System Notification Events
- Notification Channels
- Testing Notifications
- Troubleshooting
The RPi Generator Control system supports notifications at two levels:
| Component | Purpose | Notification Type |
|---|---|---|
| GenMaster | System events, generator status | Channels + Groups |
| GenSlave | Failsafe alerts, local events | Apprise URLs |
Apprise is a notification library supporting 80+ services.
| Service | URL Format |
|---|---|
| Telegram | tgram://bottoken/chatid |
| Slack | slack://tokenA/tokenB/tokenC/channel |
| Discord | discord://webhook_id/webhook_token |
| Pushover | pover://user_key@api_token |
mailto://user:pass@gmail.com |
|
| Twilio SMS | twilio://account_sid:auth_token@from/to |
| ntfy | ntfy://topic |
| Many more | See Apprise Wiki |
Telegram:
tgram://123456789:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw/chatid
Slack Webhook:
slack://T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
Discord Webhook:
discord://webhook_id/webhook_token
Email (Gmail):
mailto://myuser:mypassword@gmail.com?to=recipient@example.com
ntfy:
ntfy://mytopic
GenMaster uses a channel-based notification system with flexible grouping.
Create channels for each notification service:
Via Web UI:
- Navigate to Settings > Notifications
- Click Add Channel
- Configure:
- Name: Descriptive name (e.g., "My Telegram")
- Type: Select service type
- Configuration: Service-specific settings
- Enabled: Toggle on/off
Via API:
curl -X POST https://your-genmaster/api/notifications/channels \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Main Telegram",
"channel_type": "telegram",
"config": {
"bot_token": "123456789:AAHdqTcvCH1vGW...",
"chat_id": "-1001234567890"
},
"enabled": true
}'Group channels together for different purposes:
curl -X POST https://your-genmaster/api/notifications/groups \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Critical Alerts",
"description": "High-priority notifications",
"channel_ids": [1, 2, 3],
"enabled": true
}'| Type | Config Fields |
|---|---|
telegram |
bot_token, chat_id |
slack |
webhook_url |
discord |
webhook_url |
email |
smtp_host, smtp_port, username, password, from_email, to_emails |
pushover |
user_key, api_token |
apprise |
urls (array of Apprise URLs) |
webhook |
url, headers, method |
GenSlave uses Apprise URLs directly for failsafe notifications.
Via Environment Variable:
# In .env file
APPRISE_URLS=tgram://token/chatid,slack://webhookVia API (through GenMaster):
curl -X POST https://your-genmaster/api/genslave/notifications \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"apprise_urls": [
"tgram://123456:ABC.../chatid",
"slack://T00/B00/XXX"
]
}'Prevent notification spam with cooldown settings:
curl -X POST https://your-genmaster/api/genslave/notifications/settings \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"failsafe_cooldown_minutes": 5,
"restored_cooldown_minutes": 5
}'| Event | When Triggered |
|---|---|
| Failsafe Triggered | Communication lost with GenMaster |
| Heartbeat Restored | Communication restored after failsafe |
GenMaster can send notifications for various system events.
| Event | Description |
|---|---|
generator_started |
Generator has started |
generator_stopped |
Generator has stopped |
slave_connected |
GenSlave connection established |
slave_disconnected |
GenSlave connection lost |
override_enabled |
Manual override activated |
override_disabled |
Manual override deactivated |
exercise_started |
Exercise run started |
exercise_completed |
Exercise run completed |
max_runtime_reached |
Generator hit runtime limit |
lockout_activated |
Runtime lockout enabled |
lockout_cleared |
Runtime lockout cleared |
Via Web UI:
- Navigate to Settings > System Notifications
- For each event type:
- Toggle enabled/disabled
- Select notification channels/groups
- Configure message template (optional)
Via API:
curl -X PUT https://your-genmaster/api/system-notifications/generator_started \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"channel_ids": [1, 2],
"group_ids": [1],
"title_template": "Generator Started",
"body_template": "Generator started at {{start_time}} - Reason: {{reason}}"
}'Templates support these variables:
Generator Events:
{{run_id}}- Run ID{{start_time}}- Start timestamp{{stop_time}}- Stop timestamp{{runtime}}- Formatted runtime{{reason}}- Start/stop reason{{fuel_gallons}}- Fuel used{{fuel_type}}- Fuel type
System Events:
{{timestamp}}- Event timestamp{{status}}- Current status{{details}}- Event details
- Create a bot via @BotFather
- Get your bot token
- Get your chat ID (message @userinfobot or add bot to group)
{
"channel_type": "telegram",
"config": {
"bot_token": "123456789:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw",
"chat_id": "123456789"
}
}Group Chat ID: Use negative number (e.g., -1001234567890)
- Create a Slack app or use incoming webhook
- Get webhook URL
{
"channel_type": "slack",
"config": {
"webhook_url": "https://hooks.slack.com/services/T00/B00/XXX"
}
}- In channel settings, create a webhook
- Copy webhook URL
{
"channel_type": "discord",
"config": {
"webhook_url": "https://discord.com/api/webhooks/123/abc"
}
}{
"channel_type": "email",
"config": {
"smtp_host": "smtp.gmail.com",
"smtp_port": 587,
"username": "your@gmail.com",
"password": "app-specific-password",
"from_email": "Generator <your@gmail.com>",
"to_emails": ["recipient@example.com"]
}
}Gmail: Use an App Password
{
"channel_type": "pushover",
"config": {
"user_key": "your_user_key",
"api_token": "your_api_token"
}
}curl -X POST https://your-genmaster/api/notifications/channels/1/test \
-H "Authorization: Bearer YOUR_TOKEN"curl -X POST https://your-genmaster/api/genslave/notifications/test \
-H "Authorization: Bearer YOUR_TOKEN"curl -X POST https://your-genmaster/api/notifications/send \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Test Notification",
"body": "This is a test message",
"channel_ids": [1, 2]
}'-
Check channel is enabled:
curl https://your-genmaster/api/notifications/channels \ -H "Authorization: Bearer YOUR_TOKEN" -
Check event is configured:
- Verify event type has channels assigned
- Verify event is enabled
-
Check logs:
docker compose logs genmaster | grep -i notification
-
Verify bot token:
curl "https://api.telegram.org/bot<token>/getMe" -
Verify chat ID:
- Message the bot first
- For groups, bot must be added to group
-
Check bot permissions:
- Bot needs permission to send messages
-
Check SMTP settings:
- Verify host and port
- Try port 465 (SSL) or 587 (TLS)
-
Check authentication:
- Gmail requires App Password
- Some providers require "less secure apps"
-
Check firewall:
- Outbound SMTP may be blocked
-
Verify webhook URL:
- Test manually with curl
-
Check webhook is active:
- Webhooks can be deleted/disabled
-
Enable cooldowns:
- Set appropriate cooldown periods
- Prevents notification spam
-
Adjust event triggers:
- Disable non-critical events
- Use groups for different priority levels
Configure backup notification channels:
- Primary: Telegram/Slack
- Backup: Email
- Critical: SMS (Twilio)
Prevent notification fatigue:
- Failsafe notifications: 5-10 minute cooldown
- Status updates: 1-5 minute cooldown
Verify notifications work:
- Test after configuration changes
- Test after system updates
- Test backup channels periodically
- Critical: All channels for emergencies
- Status: Primary channel for routine updates
- Admin: Detailed logs for debugging
Review sent notifications:
curl "https://your-genmaster/api/notifications/history?limit=50" \
-H "Authorization: Bearer YOUR_TOKEN"- Generator Controls - Events that trigger notifications
- GenSlave Setup - Configure GenSlave notifications
- Troubleshooting - More debugging tips
