cloud.smarthq.service.liveactivity.v1¶
Description¶
Service to model a live activity on a mobile device.
Example Device Response (Digital Twin API)¶
Live Activity service example for iOS device.
{
"adapterId": "0000000000000000000000000000000000000000",
"alertTypes": [],
"createdDateTime": "2022-03-04T12:12:12.123Z",
"deviceId": "0000000000000000000000000000000000000000000000000000000000000000",
"deviceType": "cloud.smarthq.device.mobile.ios",
"gatewayId": "0000000000000000000000000000000000000000000000000000000000000000",
"kind": "device#item",
"lastPresenceTime": "2022-03-04T12:12:12.123Z",
"lastSyncTime": "2022-03-04T12:12:12.123Z",
"presence": "OFFLINE",
"removable": true,
"services": [
{
"serviceType": "cloud.smarthq.service.liveactivity.v1",
"lastSyncTime": "2022-03-04T12:12:12.123Z",
"domainType": "cloud.smarthq.domain.apns",
"supportedCommands": [
"cloud.smarthq.command.liveactivity.v1.start"
],
"state": {},
"serviceId": "0000000000000000000000000000000000000000000000000000000000000000",
"serviceDeviceType": "cloud.smarthq.device.mobile.ios",
"config": {},
"lastStateTime": "2022-03-04T12:12:12.123Z"
}
],
"userId": "000000000000000"
}
Live Activity service example for Android device.
{
"adapterId": "0000000000000000000000000000000000000000",
"alertTypes": [],
"createdDateTime": "2022-03-04T12:12:12.123Z",
"deviceId": "0000000000000000000000000000000000000000000000000000000000000000",
"deviceType": "cloud.smarthq.device.mobile.android",
"gatewayId": "0000000000000000000000000000000000000000000000000000000000000000",
"kind": "device#item",
"lastPresenceTime": "2022-03-04T12:12:12.123Z",
"lastSyncTime": "2022-03-04T12:12:12.123Z",
"presence": "OFFLINE",
"removable": true,
"services": [
{
"serviceType": "cloud.smarthq.service.liveactivity.v1",
"lastSyncTime": "2022-03-04T12:12:12.123Z",
"domainType": "cloud.smarthq.domain.fcm",
"supportedCommands": [
"cloud.smarthq.command.liveactivity.v1.start"
],
"state": {},
"serviceId": "0000000000000000000000000000000000000000000000000000000000000000",
"serviceDeviceType": "cloud.smarthq.device.mobile.android",
"config": {},
"lastStateTime": "2022-03-04T12:12:12.123Z"
}
],
"userId": "000000000000000"
}
State¶
The following are properties for the device state report as part of the "state" object for each individual service.
| Field Name | Property Type | Required |
|---|---|---|
| disabled | BOOLEAN | No |
Commands¶
The following are properties for both the Digital Twin API to send a command to the device as well as the properties passed as part of a command to the gateway to be processed by the device itself.
cloud.smarthq.command.liveactivity.v1.start¶
Command used to start a live activity on a mobile device.
Rules Engine Allowed Domains:
- cloud.smarthq.domain.apns
- cloud.smarthq.domain.fcm
| Field Name | Property Type | Required |
|---|---|---|
| attributes | STRING | No |
| contentState | STRING | No |
| deviceId | STRING | Yes |
| pushText | STRING | Yes |
Example Commands¶
Example command to start a live activity on iOS
{
"command": {
"commandType": "cloud.smarthq.command.liveactivity.v1.start",
"pushText": "Test Push",
"deviceId": "washer1"
},
"deviceId": "00000000000000000000000000000000000000000000000000000000000000",
"domainType": "cloud.smarthq.domain.apns",
"kind": "service#command",
"serviceDeviceType": "cloud.smarthq.device.mobile.ios",
"serviceType": "cloud.smarthq.service.liveactivity.v1"
}
Supported Outcomes¶
Each service has an allow listed set of outcomes that the device may return when asked to execute a command.
| Outcome | Documentation |
|---|---|
| cloud.smarthq.outcome.developererror | Only used when there is a server side bug |
| cloud.smarthq.outcome.deviceoffline | The device is offline. |
| cloud.smarthq.outcome.disabled.endpoint | Push notification endpoint is disabled. |
| cloud.smarthq.outcome.disabled.platform | Push notification platform is disabled. |
| cloud.smarthq.outcome.forbidden | The request is forbidden due to permissions. |
| cloud.smarthq.outcome.internalerror | The server had an issue processing the request |
| cloud.smarthq.outcome.missingconfig | The service config is missing |
| cloud.smarthq.outcome.missingstate | The service state is missing |
| cloud.smarthq.outcome.notallowed | The command is not allowed. |
| cloud.smarthq.outcome.notfound | The request is forbidden due to permissions. |
| cloud.smarthq.outcome.notsupported | The command is not supported. |
| cloud.smarthq.outcome.servicedisabled | Feature is currently disabled |
| cloud.smarthq.outcome.success | Successful request |
| cloud.smarthq.outcome.timeout | The server experienced timeout waiting for a response from the gateway |
Data Types¶
BOOLEAN¶
Value must be either true or false.
STRING¶
Value must be a sequence of characters, inserted between " and " (double quotes). Field specific restrictions such as a regular expression may apply depending on the field.