Skip to content

device.moved

The gateway’s own event: an allowed device moved to another sync group, because its endpoint’s group was changed (its sync_group set, changed or taken away). It is told once for each allowed device of the endpoint and each change. The endpoint’s policy package’s moved hook is called after it is stored. The envelope’s tenant, endpoint and device name the device, and group is the group it is in now.

Schema id: urn:houradvantage:events:3:device.moved

Fields

FieldTypeRequiredDescription
device_idintegeryesThe gateway’s own number for the device in its register.
fromobjectyesWhere the device was.
from.groupstringyesThe id, within the tenant, of the sync group it was in.
groupstring or nullyesThe id, within the tenant, of the sync group it is in now.

Example

{
"device_id": 17,
"from": {
"group": "hq"
},
"group": "plant-7"
}

JSON Schema

device.moved.json
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "urn:houradvantage:events:3:device.moved",
"title": "device.moved: data",
"description": "The gateway's own event: an allowed device moved to another sync group, because its endpoint's group was changed (its sync_group set, changed or taken away). It is told once for each allowed device of the endpoint and each change. The endpoint's policy package's moved hook is called after it is stored. The envelope's tenant, endpoint and device name the device, and group is the group it is in now.",
"type": "object",
"properties": {
"device_id": {
"type": "integer",
"description": "The gateway's own number for the device in its register."
},
"from": {
"type": "object",
"description": "Where the device was.",
"properties": {
"group": {
"type": "string",
"description": "The id, within the tenant, of the sync group it was in."
}
},
"required": [
"group"
]
},
"group": {
"type": [
"string",
"null"
],
"description": "The id, within the tenant, of the sync group it is in now."
}
},
"required": [
"device_id",
"from",
"group"
],
"examples": [
{
"device_id": 17,
"from": {
"group": "hq"
},
"group": "plant-7"
}
]
}