This is a public API!
A third‑party app sends control commands to field devices and receives both an immediate command acknowledgement and an eventual state‑change notification.
Transport & Topics
- Publish commands to:
resource/commands
QoS:2(exactly‑once delivery negotiated by MQTT) - Subscribe for responses & notifications:
application/third-party/appName/instanceId
Message Envelopes (Common)
Command Request
Command Response
Notification (Async)
1) setExtDO Command
Set an external digital output (relay/DO) to on/off.
Request
Parameters
resourceId(number) – Target device identifier.output(number) – Output index/port (1‑based unless otherwise provisioned).status(number) – Desired state:1(on/closed),0(off/open).
Some deployments may validate output ranges per model; invalid ports will yield an error response.
For this example (due to
"appId": "flexyWattApp.1"); subscribe to topic application/third-party/flexyWattApp/1 or application/third-party/flexyWattApp/# (for all instances) to receive responses and async notifications.
Immediate Response
Error Response (Example)
State‑Change Notification
Emitted when the device confirms the output’s actual state.Consumer Guidance
- QoS & retries: Expect duplicate deliveries at QoS 1. Make handlers idempotent.
- Timeouts: If no notification arrives, surface the queued state and allow users to retry.
- Security: Store tokens securely; rotate when expired; never log full JWTs.
- Tracing: Log
correlationIdon both publish and receive paths for observability.