IoT (chỉ đọc)
Thiết bị, số đo cảm biến, cảnh báo. Không có API điều khiển thiết bị cho khoá API.
5 thao tác · gốc /api/v1/iot
GET
/api/v1/iot/devicesThiết bị và trạng thái kết nối (is_online).
Công cụ MCP:
iot_list_devicesPhạm vi: iot.devices.viewTham số
| Tham số | Kiểu | Vị trí | Bắt buộc | Mô tả |
|---|---|---|---|---|
status | string | query | không | online | offline | active | inactive | maintenance |
page | int | query | không | Trang (mặc định 1) |
page_size | int | query | không | Số dòng/trang (tối đa 100) |
Ví dụ
curl https://api-prod.nextfarm.vn/api/v1/iot/devices?status=...&page=1&page_size=20 \
-H "Authorization: Bearer nfk_..."GET
/api/v1/iot/sensor-readings/latestSố đo mới nhất của cả trại hoặc một vùng.
Công cụ MCP:
iot_latest_readingsPhạm vi: iot.telemetry.viewTham số
| Tham số | Kiểu | Vị trí | Bắt buộc | Mô tả |
|---|---|---|---|---|
zone_id | GUID | query | không | — |
Ví dụ
curl https://api-prod.nextfarm.vn/api/v1/iot/sensor-readings/latest?zone_id=%3Czone_id%3E \
-H "Authorization: Bearer nfk_..."GET
/api/v1/iot/sensor-readingsLịch sử số đo theo thiết bị/vùng và khoảng thời gian.
Công cụ MCP:
iot_readings_historyPhạm vi: iot.telemetry.viewTham số
| Tham số | Kiểu | Vị trí | Bắt buộc | Mô tả |
|---|---|---|---|---|
device_id | GUID | query | không | — |
zone_id | GUID | query | không | — |
from | date | query | không | ISO 8601 |
to | date | query | không | ISO 8601 |
Ví dụ
curl https://api-prod.nextfarm.vn/api/v1/iot/sensor-readings?device_id=%3Cdevice_id%3E&zone_id=%3Czone_id%3E&from=2026-06-01&to=2026-06-01 \
-H "Authorization: Bearer nfk_..."GET
/api/v1/iot/alertsCảnh báo cảm biến vượt ngưỡng.
Công cụ MCP:
iot_list_alertsPhạm vi: iot.alerts.viewTham số
| Tham số | Kiểu | Vị trí | Bắt buộc | Mô tả |
|---|---|---|---|---|
status | string | query | không | — |
severity | string | query | không | — |
device_id | GUID | query | không | — |
Ví dụ
curl https://api-prod.nextfarm.vn/api/v1/iot/alerts?status=...&severity=...&device_id=%3Cdevice_id%3E \
-H "Authorization: Bearer nfk_..."GET
/api/v1/iot/searchTìm thiết bị theo tên, mã.
Công cụ MCP:
iot_searchPhạm vi: iot.devices.viewTham số
| Tham số | Kiểu | Vị trí | Bắt buộc | Mô tả |
|---|---|---|---|---|
q | string | query | có | Từ khoá, không dấu cũng được |
Ví dụ
curl https://api-prod.nextfarm.vn/api/v1/iot/search?q=... \
-H "Authorization: Bearer nfk_..."