POST https://openapi.rogo.com.vn/api/v2.0/iot-core/control/device/json/{userId}/{mac}
The body is the JSON message itself: {"type":"alert.ack","aid":…,"code":…,"state":…} or {"type":"config.set","configVersion":…,"values":{…}}. It is delivered inside the device’s SET envelope on the machine’s command topic (the device logs svcmsg received), so send the JSON, not a frame. At most 1024 UTF-8 bytes. config.set is published retained only without a scope or with scope: "core"; a config.set of another scope is not retained, so it cannot replace the core configuration on the topic.
POST https://openapi.rogo.com.vn/api/v2.0/iot-core/control/device/get-state/{userId}/{mac}
Sends GET DEVICE STATE to the machine and waits up to 5 seconds for its answer, returned decoded: elements is { <element>: { <attr>: [attrId, ...values] } }, the array a control command carries. includeSubDevices also asks a hub for its sub-devices, returned in subDevices by eid. reportedAt is when the answer arrived.
Parameter
In
Type
Required
Description
userId
path
string
Yes
mac
path
string
Yes
Body
Field
Type
Required
Description
includeSubDevices
boolean
No
Also ask a hub’s sub-devices to report (MsgData byte 2 of GET DEVICE STATE).
POST https://openapi.rogo.com.vn/api/v2.0/iot-core/control/device/batch
At most 200 commands, each shaped like the body of POST control/device. Commands are addressed under the partner of the api key. The response lists every command by its index with success and, when it failed, error; success at the top is true only when all of them were sent.
Body
Field
Type
Required
Description
commands
object[]
Yes
The commands to send, at most 200. Each has the shape of the single-command body; the partner is the api key’s.
commands[].eid
number
Yes
EID
commands[].elementIds
string[]
Yes
List of Element IDs
commands[].command
string[]
Yes
Command details as an array where the first element is the attribute and the rest are values