Dashboard

Tạo giao diện giám sát IoT với widgets, time window, entity aliases và filters.

Dashboard

Dashboard là giao diện giám sát trực quan, cho phép hiển thị dữ liệu telemetry, quản lý thiết bị và tương tác với hệ thống IoT theo thời gian thực.

Tính năng

  • Widgets phong phú — Biểu đồ, bảng, đồng hồ đo, bản đồ, điều khiển
  • Dữ liệu real-time — Cập nhật qua WebSocket
  • Time window — Lựa chọn khoảng thời gian linh hoạt
  • Aggregation — Tổng hợp dữ liệu theo khoảng thời gian
  • Entity aliases — Tham chiếu linh hoạt đến thiết bị/tài sản
  • Filters — Lọc entity theo attributes hoặc telemetry
  • Đa trạng thái — Dashboard nhiều "trang" (states)
  • Chia sẻ — Public link, giao cho customer, nhúng vào website
  • Version control — Lưu lịch sử thay đổi

Tạo Dashboard

Qua UI

  1. Vào Dashboards+ Add dashboard
  2. Nhập tên và optional description
  3. Nhấn Add → mở dashboard ở chế độ xem
  4. Nhấn Edit (nút bút chì góc phải) để thêm widget

Qua API

POST /api/dashboard Authorization: Bearer {JWT} Content-Type: application/json { "title": "Factory Floor Monitor", "configuration": {} }

Widgets

Loại widget

Danh mụcWidgets
ChartsTime series chart, Bar chart, Pie chart, Polar chart
GaugesAnalog gauge, Digital gauge, Level card, Compass
MapsOpenStreet Map, Google Maps, Image map, Route map
TablesEntities table, Timeseries table, Alarms table
CardsValue card, Entity info, Label card, HTML card
ControlsRound switch, Slider, LED indicator, Knob control
InputText input, Select, Date range picker
AlarmAlarm count, Active alarms

Thêm widget

  1. Nhấn Edit+ Add widget
  2. Chọn loại widget
  3. Cấu hình Datasource:
    • Chọn Entity alias hoặc device trực tiếp
    • Chọn keys (telemetry keys)
  4. Tùy chỉnh màu sắc, label, đơn vị
  5. Nhấn Add

Entity Aliases

Aliases giúp dashboard linh hoạt — thay vì hard-code device cụ thể, bạn dùng alias có thể filter động.

Single Entity

Alias tham chiếu một entity cụ thể.

Entity List

Danh sách cố định nhiều entity.

Entity Group

Tất cả entity trong một nhóm.

Entity from dashboard state

Entity được chọn từ state cha của dashboard.

Filter-based aliases

Loại entity: DEVICE Bộ lọc: - device type = "Temperature Sensor" - server attribute: building = "HCM Factory"

Time Window (Cửa sổ thời gian)

Real-time Mode

Hiển thị dữ liệu trong khoảng thời gian cuối cùng N phút/giờ, tự động cập nhật.

Last: 1 hour → Dữ liệu 1 giờ vừa qua Last: 24 hours → Dữ liệu 24 giờ vừa qua

History Mode

Xem dữ liệu trong khoảng cố định.

From: 2026-01-01 00:00 To: 2026-01-01 23:59

Aggregation

Gộp nhiều điểm dữ liệu trong một bucket thời gian:

HàmÝ nghĩa
NONERaw data, không tổng hợp
AVGTrung bình
MINNhỏ nhất
MAXLớn nhất
SUMTổng
COUNTĐếm điểm

Ví dụ: Xem nhiệt độ trung bình mỗi 1 giờ trong 7 ngày qua → interval=3600000, agg=AVG.

Grouping Interval

Tự động chọn bucket size phù hợp với khoảng thời gian, hoặc đặt thủ công.

Dashboard States

Cho phép tạo nhiều "trang" trong một dashboard:

State 1: Overview (tất cả nhà máy) ↓ Click vào nhà máy State 2: Factory Detail (thiết bị trong nhà máy) ↓ Click vào thiết bị State 3: Device Detail (telemetry chi tiết)

Chia sẻ Dashboard

Public link

Tạo link công khai (không cần đăng nhập) — phù hợp để nhúng vào website:

Dashboard → ... → Make public → Copy public link

Giao cho Customer

POST /api/customer/{customerId}/dashboard/{dashboardId} Authorization: Bearer {JWT}

Giao cho Customer Group

POST /api/dashboard/{dashboardId}/customers/add Authorization: Bearer {JWT} Content-Type: application/json { "customerIds": ["customer-uuid-1", "customer-uuid-2"] }

Import / Export

# Export GET /api/dashboard/{dashboardId} Authorization: Bearer {JWT} # → Lưu response JSON # Import POST /api/dashboard Authorization: Bearer {JWT} Content-Type: application/json # Body = JSON đã export (xóa field "id" trước khi import)