Notification Center

Hệ thống thông báo tập trung — gửi cảnh báo qua web, email, SMS, Slack, Microsoft Teams, webhook với quy tắc và chuỗi leo thang

Notification Center

Notification Center là hệ thống thông báo tập trung, tích hợp nhiều kênh giao tiếp và hỗ trợ quy tắc tự động với chuỗi leo thang (escalation).

Kênh giao tiếp

KênhMô tả
WebThông báo trong giao diện VieLang IoT
EmailGửi qua SMTP
SMSTin nhắn điện thoại (Twilio, AWS SNS)
SlackGửi vào channel Slack
Microsoft TeamsGửi vào channel Teams
WebhookHTTP POST đến URL tùy chọn
Mobile PushFCM push notification (app mobile)

Gửi thông báo thủ công

Notification Center > Send notification:

Template: [chọn template] Recipients: [chọn người nhận] Method: Web, Email, SMS, ...

Notification Templates

Template định nghĩa nội dung thông báo, tái sử dụng cho nhiều quy tắc.

Ví dụ template:

Name: High Temperature Alert Type: ALARM Subject: Cảnh báo nhiệt độ cao — ${deviceName} Body: Thiết bị ${deviceName} tại ${location} báo nhiệt độ ${temperature}°C (ngưỡng: ${threshold}°C) Xem thiết bị: ${deviceUrl} Action buttons: [Xem Dashboard] → /dashboard/${dashboardId} [Xem thiết bị] → /device/${deviceId}

Biến có sẵn: ${deviceName}, ${deviceId}, ${alarmType}, ${alarmSeverity}, ${tenantName}, ${timestamp}, và bất kỳ metadata nào trong message.


Notification Rules (Tự động)

Quy tắc tự động gửi thông báo khi có sự kiện.

Trigger Types:

TriggerKhi nào
Alarm CreatedAlarm mới được tạo
Alarm Severity ChangedSeverity alarm thay đổi
Alarm AcknowledgedAlarm được xác nhận
Alarm ClearedAlarm được clear
Alarm Comment AddedCó comment mới
Device ActivityThiết bị connect/disconnect
Entity ActionEntity được tạo/sửa/xóa
API Usage LimitVượt giới hạn API
Rule Engine LifecycleRule chain khởi động/dừng

Ví dụ: Rule cảnh báo alarm

Name: Critical Alarm Notification Trigger: Alarm Created Filter: - Alarm severity: CRITICAL, MAJOR - Alarm type: (bỏ trống = tất cả) Escalation chain: Step 1 (delay: 0s): → Web, Email (tenant admins) Step 2 (delay: 5m): → SMS (on-call engineer) Step 3 (delay: 15m): → Phone call (manager)

Ví dụ: Rule thiết bị offline

Name: Device Disconnected Alert Trigger: Device Activity Filter: - Event type: INACTIVE (offline) - Device list: [Gateway-01, Gateway-02] Recipients: On-call team Method: Slack (#alerts channel)

Recipients (Người nhận)

Platform Users

All tenant admins All tenant users User list: [admin@company.com, ops@company.com]

Slack

Workspace: company-workspace Channel: #iot-alerts Bot token: xoxb-...

Microsoft Teams

Webhook URL: https://company.webhook.office.com/webhookb2/...

Webhook

URL: https://api.pagerduty.com/v2/enqueue Method: POST Headers: Authorization: Token token=... Content-Type: application/json

Escalation Chain

Chuỗi leo thang: nếu không ai xác nhận → gửi tiếp lên cấp cao hơn.

Delay 0: Web + Email → L1 support Delay 5m: SMS → L2 on-call Delay 15m: Slack #management + Email manager Delay 30m: Phone call CTO

Notification Inbox

Tất cả thông báo Web lưu tại Notification Center > Inbox:

  • Đánh dấu đã đọc / chưa đọc
  • Bộ lọc theo loại, ngày
  • Xem chi tiết + action buttons
  • Mark all as read

API

POST /api/notification GET /api/notifications?pageSize=20&page=0 GET /api/notifications/unread/count PUT /api/notifications/read DELETE /api/notifications/{id} POST /api/notificationRule GET /api/notificationRules GET /api/notificationTemplates