Hive REST API v6.1

Hive App showing two booster plugs.
Hive App showing two booster plugs.

I have already written a short post about Hive’s v5 API in which I document some V5’s basic calls including temperature control. In this post I document the Hive’s newer v6.1 API, again with examples of a few basic calls. In comparison to the v5 API, albeit still a REST API, v6 is quite different.

HTTP Headers

The first major difference is that all calls, including login, must send the following 3 HTTP header keys with any request calls:

  • Content-Type: application/vnd.alertme.zoo-6.1+json
  • Accept: application/vnd.alertme.zoo-6.1+json
  • X-Omnia-Client: Hive Web Dashboard

The above lets the server know which version of API the caller is intending to use the type of client is making the call. Then, following login, a 4th HTTP header key must also be sent with all subsequent calls:

  • X-Omnia-Access-Token: {{sessionId}}

The above access token is the ‘sessionId’ which is returned by the initial login response, this sessionId will be change each login session.

JSON Requests

The second difference to v5 is that the v6 API requests content types should be in raw JSON format (rather than simple Content-Type: multipart/form-data which v5 uses), this is to allow more complex requests.

Base URL

The base URL for the Hives V6 API is:

  • https://api-prod.bgchprod.info:443/omnia
  • https://api.prod.bgchprod.info:443/omnia (SSL Errors)

For example to make a call to get the current user you would call the following URL:

  • https://api.prod.bgchprod.info:443/omnia/auth/sessions

Login

[POST] /auth/sessions

Before any API calls can be made you must login using your Hive login (email address) and password. Replace {{username}} and {{password}} accordingly.

Request Body:

{
	"sessions": [{
		"username": "{{username}}",
		"password": "{{password}}",
		"caller": "WEB"
	}]
}

The response to the login will contain the sessionId which is what is required to be passed in all further calls.

Example Response:

{
	"meta": {},
	"links": {},
	"linked": {},
	"sessions": [{
		"id": "xxxxxxxxxxxx",
		"links": {},
		"username": "joe.bloggs@email.com",
		"userId": "cf82b9d8-8d0b-43b7-ae28-xxxxxxxxxxxx",
		"extCustomerLevel": 1,
		"latestSupportedApiVersion": "6",
		"sessionId": "xxxxxxxxxxxx"
	}]
}

Device List

[GET] /nodes

Returns a list of devices associated with the hub. There are no arguments or request body details required because this is a GET request, but, as mentioned, above ALL subsequent calls following login MUST pass the headers:

  • Content-Type: application/vnd.alertme.zoo-6.1+json
  • Accept: application/vnd.alertme.zoo-6.1+json
  • X-Omnia-Client: Hive Web Dashboard
  • X-Omnia-Access-Token: {{sessionId}}

Example Response:

{
	"meta": {},
	"links": {},
	"linked": {},
	"nodes": [{
		"id": "2ba0f1e4-4f51-4aea-adb3-447908448786",
		"href": "https://api.prod.bgchprod.info:8443/omnia/nodes/2ba0f1e4-4f51-4aea-adb3-447908448786",
		"links": {},
		"name": "Your Receiver",
		"nodeType": "http://alertme.com/schema/json/node.class.thermostat.json#",
		"parentNodeId": "c9c78b80-574c-4ceb-b149-df02e18d2056",
		"lastSeen": 1465759250499,
		"createdOn": 1452412238799,
		"userId": "cf82b9d8-8d0b-43b7-ae28-xxxxxxxxxxxx",
		"ownerId": "cf82b9d8-8d0b-43b7-ae28-xxxxxxxxxxxx",
		"attributes": {
			"zigBeeNeighbourTable": {
				"reportedValue": [{
					"neighbourAddress": "::21c:2bff:fe09:9012",
					"deviceType": "COORDINATOR",
					"relationship": "NONE",
					"LQI": 100
				}, {
					"neighbourAddress": "::21e:5e09:212:109b",
					"deviceType": "DEVICE",
					"relationship": "NONE",
					"LQI": 99
				}, {
					"neighbourAddress": "::21e:5e09:20f:5ac3",
					"deviceType": "DEVICE",
					"relationship": "CHILD",
					"LQI": 100
				}],
				"reportReceivedTime": 1465758491201
			},
			"lastSeen": {
				"reportedValue": "2016-06-12T19:08:48.800+0000",
				"reportReceivedTime": 1465758553331
			},
			"protocol": {
				"reportedValue": "ZIGBEE",
				"reportReceivedTime": 1465758553331
			},
			"model": {
				"reportedValue": "SLR1",
				"reportReceivedTime": 1465758553331
			},
			"holidayMode": {
				"reportedValue": {
					"enabled": false,
					"startDateTime": "2016-04-15T15:15:00.000+0000",
					"endDateTime": "2016-04-17T15:00:00.000+0000",
					"targetHeatTemperature": 1
				},
				"reportReceivedTime": 1465758553331
			},
			"RSSI": {
				"reportedValue": -45,
				"reportReceivedTime": 1465759226465
			},
			"zoneName": {
				"reportedValue": "Your Receiver",
				"reportReceivedTime": 1465758553331
			},
			"LQI": {
				"reportedValue": 100,
				"reportReceivedTime": 1465759226465
			},
			"presence": {
				"reportedValue": "PRESENT",
				"reportReceivedTime": 1465759226465
			},
			"manufacturer": {
				"reportedValue": "Computime",
				"reportReceivedTime": 1465758553331
			},
			"zigBeeBindingTable": {
				"reportedValue": [{
					"sourceAddress": "::21e:5e09:20d:8ed",
					"sourceEndpoint": 5,
					"cluster": 513,
					"destinationAddress": "::21c:2bff:fe09:9012",
					"destinationEndpoint": 1
				}, {
					"sourceAddress": "::21e:5e09:20d:8ed",
					"sourceEndpoint": 5,
					"cluster": 64768,
					"destinationAddress": "::21c:2bff:fe09:9012",
					"destinationEndpoint": 1
				}, {
					"sourceAddress": "::21e:5e09:20d:8ed",
					"sourceEndpoint": 5,
					"cluster": 9,
					"destinationAddress": "::21c:2bff:fe09:9012",
					"destinationEndpoint": 1
				}],
				"reportReceivedTime": 1465758492381
			},
			"zigBeeRoutingTable": {
				"reportedValue": [{
					"destinationAddress": "::21c:2bff:fe09:9012",
					"status": "ACTIVE",
					"memoryConstrained": true,
					"manyToOne": true,
					"routeRecordRequired": false,
					"nextHopAddress": "::21c:2bff:fe09:9012"
				}, {
					"status": "ACTIVE",
					"memoryConstrained": true,
					"manyToOne": true,
					"routeRecordRequired": true
				}, {
					"destinationAddress": "::21e:5e09:211:943d",
					"status": "ACTIVE",
					"memoryConstrained": false,
					"manyToOne": false,
					"routeRecordRequired": false,
					"nextHopAddress": "::21e:5e09:211:943d"
				}, {
					"destinationAddress": "::21c:2bff:fe09:9012",
					"status": "INACTIVE",
					"memoryConstrained": false,
					"manyToOne": false,
					"routeRecordRequired": false,
					"nextHopAddress": "::21c:2bff:fe09:9012"
				}, {
					"destinationAddress": "::21e:5e09:212:109b",
					"status": "ACTIVE",
					"memoryConstrained": true,
					"manyToOne": true,
					"routeRecordRequired": true,
					"nextHopAddress": "::21e:5e09:212:109b"
				}, {
					"destinationAddress": "::21c:2bff:fe09:9012",
					"status": "INACTIVE",
					"memoryConstrained": false,
					"manyToOne": false,
					"routeRecordRequired": false,
					"nextHopAddress": "::21c:2bff:fe09:9012"
				}, {
					"status": "ACTIVE",
					"memoryConstrained": false,
					"manyToOne": false,
					"routeRecordRequired": false,
					"nextHopAddress": "::21e:5e09:212:109b"
				}, {
					"status": "ACTIVE",
					"memoryConstrained": false,
					"manyToOne": false,
					"routeRecordRequired": false
				}, {
					"destinationAddress": "::21c:2bff:fe09:9012",
					"status": "INACTIVE",
					"memoryConstrained": false,
					"manyToOne": false,
					"routeRecordRequired": false,
					"nextHopAddress": "::21c:2bff:fe09:9012"
				}],
				"reportReceivedTime": 1465758492183
			},
			"powerSupply": {
				"reportedValue": "AC",
				"reportReceivedTime": 1465758553331
			},
			"softwareVersion": {
				"reportedValue": "08004640",
				"reportReceivedTime": 1465758553331
			},
			"nodeType": {
				"reportedValue": "http://alertme.com/schema/json/node.class.thermostat.json#",
				"reportReceivedTime": 1465759226465
			},
			"hardwareVersion": {
				"reportedValue": "01",
				"reportReceivedTime": 1465758553331
			}
		},
		"relationships": {
			"boundNodes": []
		}
	}, {
		"id": "91bcbaea-0ed7-4216-9b7a-351bb6f8ac26",
		"href": "https://api.prod.bgchprod.info:8443/omnia/nodes/91bcbaea-0ed7-4216-9b7a-351bb6f8ac26",
		"links": {},
		"name": "ActivePlug",
		"nodeType": "http://alertme.com/schema/json/node.class.smartplug.json#",
		"parentNodeId": "c9c78b80-574c-4ceb-b149-df02e18d2056",
		"lastSeen": 1465759225444,
		"createdOn": 1461790278989,
		"userId": "cf82b9d8-8d0b-43b7-ae28-xxxxxxxxxxxx",
		"ownerId": "cf82b9d8-8d0b-43b7-ae28-xxxxxxxxxxxx",
		"attributes": {
			"zigBeeNeighbourTable": {
				"reportedValue": [{
					"neighbourAddress": "::21c:2bff:fe09:9012",
					"deviceType": "COORDINATOR",
					"relationship": "NONE",
					"LQI": 100
				}, {
					"neighbourAddress": "::21e:5e09:20d:8ed",
					"deviceType": "DEVICE",
					"relationship": "NONE",
					"LQI": 99
				}],
				"reportReceivedTime": 1465758492544
			},
			"lastSeen": {
				"reportedValue": "2016-06-12T19:10:39.519+0000",
				"reportReceivedTime": 1465758664240
			},
			"protocol": {
				"reportedValue": "ZIGBEE",
				"reportReceivedTime": 1465758664240
			},
			"model": {
				"reportedValue": "SLP2",
				"reportReceivedTime": 1465758664240
			},
			"state": {
				"reportedValue": "OFF",
				"targetValue": "ON",
				"reportReceivedTime": 1465759147698,
				"targetSetTime": 1465509783258,
				"targetExpiryTime": 1465510083258,
				"targetSetTXId": "5e096157-07b3-4fd9-b162-23dbf43e7bb7",
				"propertyStatus": "COMPLETE"
			},
			"RSSI": {
				"reportedValue": -75,
				"reportReceivedTime": 1465759225444
			},
			"LQI": {
				"reportedValue": 100,
				"reportReceivedTime": 1465759225444
			},
			"presence": {
				"reportedValue": "PRESENT",
				"reportReceivedTime": 1465759225444
			},
			"manufacturer": {
				"reportedValue": "Computime",
				"reportReceivedTime": 1465758664240
			},
			"zigBeeBindingTable": {
				"reportedValue": [{
					"sourceAddress": "::21e:5e09:212:109b",
					"sourceEndpoint": 9,
					"cluster": 1794,
					"destinationAddress": "::21c:2bff:fe09:9012",
					"destinationEndpoint": 1
				}, {
					"sourceAddress": "::21e:5e09:212:109b",
					"sourceEndpoint": 9,
					"cluster": 6,
					"destinationAddress": "::21c:2bff:fe09:9012",
					"destinationEndpoint": 1
				}],
				"reportReceivedTime": 1465758493410
			},
			"zigBeeRoutingTable": {
				"reportedValue": [{
					"destinationAddress": "::21c:2bff:fe09:9012",
					"status": "ACTIVE",
					"memoryConstrained": true,
					"manyToOne": true,
					"routeRecordRequired": false,
					"nextHopAddress": "::21c:2bff:fe09:9012"
				}, {
					"destinationAddress": "::21c:2bff:fe09:9012",
					"status": "INACTIVE",
					"memoryConstrained": false,
					"manyToOne": false,
					"routeRecordRequired": false,
					"nextHopAddress": "::21c:2bff:fe09:9012"
				}],
				"reportReceivedTime": 1465758493522
			},
			"powerSupply": {
				"reportedValue": "AC",
				"reportReceivedTime": 1465758664240
			},
			"softwareVersion": {
				"reportedValue": "02095120",
				"reportReceivedTime": 1465758664240
			},
			"nodeType": {
				"reportedValue": "http://alertme.com/schema/json/node.class.smartplug.json#",
				"reportReceivedTime": 1465759225444
			},
			"hardwareVersion": {
				"reportedValue": "01",
				"reportReceivedTime": 1465758664240
			}
		},
		"relationships": {
			"boundNodes": []
		}
	}, {
		"id": "c9c78b80-574c-4ceb-b149-df02e18d2056",
		"href": "https://api.prod.bgchprod.info:8443/omnia/nodes/c9c78b80-574c-4ceb-b149-df02e18d2056",
		"links": {},
		"name": "Hub",
		"nodeType": "http://alertme.com/schema/json/node.class.hub.json#",
		"parentNodeId": "c9c78b80-574c-4ceb-b149-df02e18d2056",
		"lastSeen": 1465759267689,
		"createdOn": 1450996703178,
		"userId": "cf82b9d8-8d0b-43b7-ae28-xxxxxxxxxxxx",
		"ownerId": "cf82b9d8-8d0b-43b7-ae28-xxxxxxxxxxxx",
		"attributes": {
			"zigBeeNeighbourTable": {
				"reportedValue": [{
					"neighbourAddress": "::21e:5e09:212:109b",
					"deviceType": "DEVICE",
					"relationship": "NONE",
					"LQI": 99
				}, {
					"neighbourAddress": "::21e:5e09:20d:8ed",
					"deviceType": "DEVICE",
					"relationship": "NONE",
					"LQI": 100
				}],
				"reportReceivedTime": 1465758490028
			},
			"devicesState": {
				"reportedValue": "UP",
				"reportReceivedTime": 1465759265164
			},
			"supportsCombinedUpgrade": {
				"reportedValue": true,
				"reportReceivedTime": 1465759265164
			},
			"softwareVersion": {
				"reportedValue": "1.0.0-4782-0.0",
				"reportReceivedTime": 1465759265164
			},
			"bootLoaderVersion": {
				"reportedValue": "2013.04-g60890ce",
				"reportReceivedTime": 1465759265164
			},
			"nodeType": {
				"reportedValue": "http://alertme.com/schema/json/node.class.hub.json#",
				"reportReceivedTime": 1465759265164
			},
			"internalIPAddress": {
				"reportedValue": "192.168.0.107",
				"reportReceivedTime": 1465759265164
			},
			"zigBeeTileFirmwareVersion": {
				"reportedValue": "R311 B051015",
				"reportReceivedTime": 1465758616579
			},
			"zigBeePanId": {
				"reportedValue": "64C8",
				"reportReceivedTime": 1465758616579
			},
			"serverConnectionState": {
				"reportedValue": "CONNECTED",
				"reportReceivedTime": 1465759265164
			},
			"protocol": {
				"reportedValue": "ZIGBEE",
				"reportReceivedTime": 1465758616579
			},
			"connection": {
				"reportedValue": "ETHERNET",
				"reportReceivedTime": 1465759265164
			},
			"ethernetConnectionState": {
				"reportedValue": "CONNECTED",
				"reportReceivedTime": 1465759265164
			},
			"zigBeeRadioChannel": {
				"reportedValue": 22,
				"reportReceivedTime": 1465758616579
			},
			"rootFSVersion": {
				"reportedValue": "The Ångström Distribution",
				"reportReceivedTime": 1465759265164
			},
			"uptime": {
				"reportedValue": 512088,
				"reportReceivedTime": 1465759265164
			},
			"kernelBuildDate": {
				"reportedValue": "#1 Wed May 28 14:35:19 BST 2014",
				"reportReceivedTime": 1465759265164
			},
			"softwareInstallationState": {
				"reportedValue": "COMPLETE",
				"reportReceivedTime": 1465759265164
			},
			"presence": {
				"reportedValue": "PRESENT"
			},
			"rootFSBuildDate": {
				"reportedValue": "Wed May 28 14:59:52 2014",
				"reportReceivedTime": 1465759265164
			},
			"zigBeeTileFirmwareVendor": {
				"reportedValue": "Telegesis",
				"reportReceivedTime": 1465758616579
			},
			"zigBeeRoutingTable": {
				"reportedValue": [{
					"destinationAddress": "::21e:5e09:20d:8ed",
					"status": "ACTIVE",
					"memoryConstrained": false,
					"manyToOne": false,
					"routeRecordRequired": false,
					"nextHopAddress": "::21e:5e09:20d:8ed"
				}, {
					"destinationAddress": "::21c:2bff:fe09:9012",
					"status": "INACTIVE",
					"memoryConstrained": false,
					"manyToOne": false,
					"routeRecordRequired": false,
					"nextHopAddress": "::21c:2bff:fe09:9012"
				}],
				"reportReceivedTime": 1465758490764
			},
			"powerSupply": {
				"reportedValue": "AC",
				"reportReceivedTime": 1465759265164
			},
			"operationalMode": {
				"reportedValue": "DEPLOYED",
				"reportReceivedTime": 1465759265164
			},
			"pcbRevision": {
				"reportedValue": 1,
				"reportReceivedTime": 1465759265164
			},
			"capabilities": {
				"reportedValue": [
					"deviceRemoval",
					"zoneNameInitializer",
					"motionDurationDevice"
				],
				"reportReceivedTime": 1465759265164
			},
			"kernelVersion": {
				"reportedValue": "3.12.10",
				"reportReceivedTime": 1465759265164
			},
			"hardwareVersion": {
				"reportedValue": "NANO2",
				"reportReceivedTime": 1465759265164
			}
		}
	}]
}

Thermostat Set

[PUT] /nodes/2ba0f1e4-4f51-4aea-adb3-447908448786

Set the target temperature of the thermostat (in degrees C). The ‘2ba0f1e4-4f51-4aea-adb3-447908448786’ should be replaced by the device ID of your own thermostat (as listed in the device list response above).

Request Body:

{
	"nodes": [{
		"attributes": {
			"targetHeatTemperature": {
				"targetValue": 22
			}
		}
	}]
}

Thermostat Boost

[PUT] /nodes/2ba0f1e4-4f51-4aea-adb3-447908448786

Set thermostat Boost on or off. A very similar request to that of the temperature set. As can be seen the request JSON mirrors the nodes:attributes stanza seen in the device response below. From this we can start to guess at other calls by looking at other possible attributes which may be read or set.

Request Body:

{
	"nodes": [{
		"attributes": {
			"activeHeatCoolMode": {
				"targetValue": "BOOST"
			},
			"scheduleLockDuration": {
				"targetValue": 30
			},
			"targetHeatTemperature": {
				"targetValue": 22
			}
		}
	}]
}

Example Response:

{
	"meta": {},
	"links": {},
	"linked": {},
	"nodes": [{
		"id": "2ba0f1e4-4f51-4aea-adb3-447908448786",
		"href": "https://api.prod.bgchprod.info:8443/omnia/nodes/2ba0f1e4-4f51-4aea-adb3-447908448786",
		"links": {},
		"name": "Your Receiver",
		"nodeType": "http://alertme.com/schema/json/node.class.thermostat.json#",
		"parentNodeId": "c9c78b80-574c-4ceb-b149-df02e18d2056",
		"lastSeen": 1465151772524,
		"createdOn": 1452412238799,
		"attributes": {
			"zigBeeNeighbourTable": {
				"reportedValue": [{
					"neighbourAddress": "::21c:2bff:fe09:9012",
					"deviceType": "COORDINATOR",
					"relationship": "NONE",
					"LQI": 100
				}, {
					"neighbourAddress": "::21e:5e09:20f:5ac3",
					"deviceType": "DEVICE",
					"relationship": "CHILD",
					"LQI": 100
				}],
				"reportReceivedTime": 1465148406148
			},
			"lastSeen": {
				"reportedValue": "2016-06-05T17:41:02.794+0000",
				"reportReceivedTime": 1465148470959
			},
			"model": {
				"reportedValue": "SLR1",
				"reportReceivedTime": 1465148470959
			},
			"holidayMode": {
				"reportedValue": {
					"enabled": false,
					"startDateTime": "2016-04-15T15:15:00.000+0000",
					"endDateTime": "2016-04-17T15:00:00.000+0000",
					"targetHeatTemperature": 1
				},
				"reportReceivedTime": 1465150592860
			},
			"protocol": {
				"reportedValue": "ZIGBEE",
				"reportReceivedTime": 1465148470959
			},
			"datecode": {
				"reportReceivedTime": 1464554457247
			},
			"RSSI": {
				"reportedValue": -40,
				"reportReceivedTime": 1465151300198
			},
			"zoneName": {
				"reportedValue": "Your Receiver",
				"reportReceivedTime": 1465148470959
			},
			"LQI": {
				"reportedValue": 100,
				"reportReceivedTime": 1465151300198
			},
			"scheduleLockDuration": {
				"targetValue": 30,
				"targetSetTime": 1464989217012,
				"targetExpiryTime": 1464989517012,
				"targetSetTXId": "6ff7c17d-7ceb-4775-b225-0ef4b5e3b410",
				"propertyStatus": "FAILED"
			},
			"hwVersion": {
				"reportedValue": 1,
				"reportReceivedTime": 1464554457247
			},
			"presence": {
				"reportedValue": "PRESENT",
				"reportReceivedTime": 1465151300198
			},
			"zigBeeBindingTable": {
				"reportedValue": [{
					"sourceAddress": "::21e:5e09:20d:8ed",
					"sourceEndpoint": 5,
					"cluster": 513,
					"destinationAddress": "::21c:2bff:fe09:9012",
					"destinationEndpoint": 1
				}, {
					"sourceAddress": "::21e:5e09:20d:8ed",
					"sourceEndpoint": 5,
					"cluster": 64768,
					"destinationAddress": "::21c:2bff:fe09:9012",
					"destinationEndpoint": 1
				}, {
					"sourceAddress": "::21e:5e09:20d:8ed",
					"sourceEndpoint": 5,
					"cluster": 9,
					"destinationAddress": "::21c:2bff:fe09:9012",
					"destinationEndpoint": 1
				}],
				"reportReceivedTime": 1465148406938
			},
			"manufacturer": {
				"reportedValue": "Computime",
				"reportReceivedTime": 1465148470959
			},
			"zigBeeRoutingTable": {
				"reportedValue": [{
					"destinationAddress": "::21c:2bff:fe09:9012",
					"status": "ACTIVE",
					"memoryConstrained": true,
					"manyToOne": true,
					"routeRecordRequired": false,
					"nextHopAddress": "::21c:2bff:fe09:9012"
				}, {
					"status": "ACTIVE",
					"memoryConstrained": true,
					"manyToOne": true,
					"routeRecordRequired": true
				}, {
					"destinationAddress": "::21c:2bff:fe09:9012",
					"status": "INACTIVE",
					"memoryConstrained": false,
					"manyToOne": false,
					"routeRecordRequired": false,
					"nextHopAddress": "::21c:2bff:fe09:9012"
				}, {
					"destinationAddress": "::21c:2bff:fe09:9012",
					"status": "INACTIVE",
					"memoryConstrained": false,
					"manyToOne": false,
					"routeRecordRequired": false,
					"nextHopAddress": "::21c:2bff:fe09:9012"
				}, {
					"status": "ACTIVE",
					"memoryConstrained": true,
					"manyToOne": true,
					"routeRecordRequired": true
				}, {
					"destinationAddress": "::21c:2bff:fe09:9012",
					"status": "INACTIVE",
					"memoryConstrained": false,
					"manyToOne": false,
					"routeRecordRequired": false,
					"nextHopAddress": "::21c:2bff:fe09:9012"
				}, {
					"status": "ACTIVE",
					"memoryConstrained": false,
					"manyToOne": false,
					"routeRecordRequired": false
				}, {
					"status": "ACTIVE",
					"memoryConstrained": false,
					"manyToOne": false,
					"routeRecordRequired": false
				}, {
					"destinationAddress": "::21c:2bff:fe09:9012",
					"status": "INACTIVE",
					"memoryConstrained": false,
					"manyToOne": false,
					"routeRecordRequired": false,
					"nextHopAddress": "::21c:2bff:fe09:9012"
				}],
				"reportReceivedTime": 1465148406910
			},
			"powerSupply": {
				"reportedValue": "AC",
				"reportReceivedTime": 1465148470959
			},
			"softwareVersion": {
				"reportedValue": "08004640",
				"reportReceivedTime": 1465148470959
			},
			"activeHeatCoolMode": {
				"targetValue": "BOOST",
				"targetSetTime": 1464989217012,
				"targetExpiryTime": 1464989517012,
				"targetSetTXId": "6ff7c17d-7ceb-4775-b225-0ef4b5e3b410",
				"propertyStatus": "FAILED"
			},
			"nodeType": {
				"reportedValue": "http://alertme.com/schema/json/node.class.thermostat.json#",
				"reportReceivedTime": 1465151300198
			},
			"targetHeatTemperature": {
				"targetValue": 22,
				"targetSetTime": 1465151801726,
				"targetExpiryTime": 1465152101726,
				"targetSetTXId": "83d5a944-7927-4c62-8641-d2abd98f6f06",
				"propertyStatus": "PENDING"
			},
			"swVersion": {
				"reportedValue": 8004640,
				"reportReceivedTime": 1464554457247
			},
			"hardwareVersion": {
				"reportedValue": "01",
				"reportReceivedTime": 1465148470959
			}
		},
		"relationships": {
			"boundNodes": []
		}
	}]
}

ActivePlug Set

[PUT] /nodes/91bcbaea-0ed7-4216-9b7a-351bb6f8ac26

Switch ActivePlug on. Replace 91bcbaea-0ed7-4216-9b7a-351bb6f8ac26 with the ID of your plug (found in the device list results above). Set targetValue to ON or OFF accordingly. Again this is another of the nodes:attributes values.

Request body:

{
	"nodes": [{
		"attributes": {
			"state": {
				"targetValue": "ON"
			}
		}
	}]
}

Example Response:

{
	"meta": {},
	"links": {},
	"linked": {},
	"nodes": [{
		"id": "91bcbaea-0ed7-4216-9b7a-351bb6f8ac26",
		"href": "https://api.prod.bgchprod.info:8443/omnia/nodes/91bcbaea-0ed7-4216-9b7a-351bb6f8ac26",
		"links": {},
		"name": "ActivePlug",
		"nodeType": "http://alertme.com/schema/json/node.class.smartplug.json#",
		"parentNodeId": "c9c78b80-574c-4ceb-b149-df02e18d2056",
		"lastSeen": 1465152050436,
		"createdOn": 1461790278989,
		"attributes": {
			"zigBeeNeighbourTable": {
				"reportedValue": [{
					"neighbourAddress": "::21e:5e09:20f:5ac3",
					"deviceType": "DEVICE",
					"relationship": "CHILD",
					"LQI": 100
				}, {
					"neighbourAddress": "::21c:2bff:fe09:9012",
					"deviceType": "COORDINATOR",
					"relationship": "NONE",
					"LQI": 100
				}, {
					"neighbourAddress": "::21e:5e09:211:943d",
					"deviceType": "DEVICE",
					"relationship": "NONE",
					"LQI": 100
				}, {
					"neighbourAddress": "::21e:5e09:20d:8ed",
					"deviceType": "DEVICE",
					"relationship": "NONE",
					"LQI": 100
				}],
				"reportReceivedTime": 1465152010173
			},
			"lastSeen": {
				"reportedValue": "2016-05-28T19:45:04.591+0000",
				"reportReceivedTime": 1464464820573
			},
			"model": {
				"reportedValue": "SLP2",
				"reportReceivedTime": 1465151979713
			},
			"protocol": {
				"reportedValue": "ZIGBEE",
				"reportReceivedTime": 1465151979713
			},
			"state": {
				"reportedValue": "OFF",
				"targetValue": "ON",
				"reportReceivedTime": 1465151980189,
				"targetSetTime": 1465152050454,
				"targetExpiryTime": 1465152350454,
				"targetSetTXId": "2c43052f-056d-486f-b971-be4da18f1ce8",
				"propertyStatus": "PENDING"
			},
			"datecode": {
				"reportReceivedTime": 1465151977843
			},
			"energyConsumed": {
				"reportedValue": 7,
				"reportReceivedTime": 1464033109098
			},
			"RSSI": {
				"reportedValue": -45,
				"reportReceivedTime": 1465151980189
			},
			"macAddress": {
				"reportedValue": "001E5E090212109B",
				"reportReceivedTime": 1463835197650
			},
			"powerConsumption": {
				"reportedValue": 1,
				"reportReceivedTime": 1464033111026
			},
			"LQI": {
				"reportedValue": 100,
				"reportReceivedTime": 1465151980189
			},
			"presence": {
				"reportedValue": "PRESENT",
				"reportReceivedTime": 1465152050436
			},
			"hwVersion": {
				"reportedValue": 1,
				"reportReceivedTime": 1465151977843
			},
			"zigBeeBindingTable": {
				"reportedValue": [{
					"sourceAddress": "::21e:5e09:212:109b",
					"sourceEndpoint": 9,
					"cluster": 1794,
					"destinationAddress": "::21c:2bff:fe09:9012",
					"destinationEndpoint": 1
				}, {
					"sourceAddress": "::21e:5e09:212:109b",
					"sourceEndpoint": 9,
					"cluster": 6,
					"destinationAddress": "::21c:2bff:fe09:9012",
					"destinationEndpoint": 1
				}],
				"reportReceivedTime": 1465152050436
			},
			"manufacturer": {
				"reportedValue": "Computime",
				"reportReceivedTime": 1465151979713
			},
			"zigBeeRoutingTable": {
				"reportedValue": [{
					"destinationAddress": "::21c:2bff:fe09:9012",
					"status": "ACTIVE",
					"memoryConstrained": true,
					"manyToOne": true,
					"routeRecordRequired": false,
					"nextHopAddress": "::21c:2bff:fe09:9012"
				}, {
					"destinationAddress": "::21e:5e09:211:943d",
					"status": "ACTIVE",
					"memoryConstrained": false,
					"manyToOne": false,
					"routeRecordRequired": false,
					"nextHopAddress": "::21e:5e09:211:943d"
				}, {
					"destinationAddress": "::21c:2bff:fe09:9012",
					"status": "INACTIVE",
					"memoryConstrained": false,
					"manyToOne": false,
					"routeRecordRequired": false,
					"nextHopAddress": "::21c:2bff:fe09:9012"
				}, {
					"destinationAddress": "::21c:2bff:fe09:9012",
					"status": "INACTIVE",
					"memoryConstrained": false,
					"manyToOne": false,
					"routeRecordRequired": false,
					"nextHopAddress": "::21c:2bff:fe09:9012"
				}, {
					"destinationAddress": "::21c:2bff:fe09:9012",
					"status": "INACTIVE",
					"memoryConstrained": false,
					"manyToOne": false,
					"routeRecordRequired": false,
					"nextHopAddress": "::21c:2bff:fe09:9012"
				}, {
					"destinationAddress": "::21c:2bff:fe09:9012",
					"status": "INACTIVE",
					"memoryConstrained": false,
					"manyToOne": false,
					"routeRecordRequired": false,
					"nextHopAddress": "::21c:2bff:fe09:9012"
				}, {
					"destinationAddress": "::21c:2bff:fe09:9012",
					"status": "INACTIVE",
					"memoryConstrained": false,
					"manyToOne": false,
					"routeRecordRequired": false,
					"nextHopAddress": "::21c:2bff:fe09:9012"
				}, {
					"destinationAddress": "::21c:2bff:fe09:9012",
					"status": "INACTIVE",
					"memoryConstrained": false,
					"manyToOne": false,
					"routeRecordRequired": false,
					"nextHopAddress": "::21c:2bff:fe09:9012"
				}, {
					"destinationAddress": "::21c:2bff:fe09:9012",
					"status": "INACTIVE",
					"memoryConstrained": false,
					"manyToOne": false,
					"routeRecordRequired": false,
					"nextHopAddress": "::21c:2bff:fe09:9012"
				}],
				"reportReceivedTime": 1465152008980
			},
			"powerSupply": {
				"reportedValue": "AC",
				"reportReceivedTime": 1465151979713
			},
			"softwareVersion": {
				"reportedValue": "02095120",
				"reportReceivedTime": 1465151979713
			},
			"batteryState": {
				"reportedValue": "FULL",
				"reportReceivedTime": 1465151979713
			},
			"nodeType": {
				"reportedValue": "http://alertme.com/schema/json/node.class.smartplug.json#",
				"reportReceivedTime": 1465152050436
			},
			"swVersion": {
				"reportedValue": 2095120,
				"reportReceivedTime": 1465151977843
			},
			"hardwareVersion": {
				"reportedValue": "01",
				"reportReceivedTime": 1465151978243
			}
		},
		"relationships": {
			"boundNodes": []
		}
	}]
}

Events

[GET] /events/

List system events (hub reboots, new devices, errors).

Example Response:

{
	"meta": {},
	"links": {},
	"linked": {},
	"events": [{
		"id": "ffc2cff0-0cb5-11e6-8871-06352e9cf147",
		"href": "https://api.prod.bgchprod.info:8443/omnia/events/ffc2cff0-0cb5-11e6-8871-06352e9cf147",
		"links": {},
		"eventType": "ADDED",
		"source": "91bcbaea-0ed7-4216-9b7a-351bb6f8ac26",
		"time": "2016-04-27T20:24:10.095+0000",
		"properties": {
			"deviceType": "SMART_PLUG"
		}
	}, {
		"id": "29128880-0ace-11e6-a049-062b5586e889",
		"href": "https://api.prod.bgchprod.info:8443/omnia/events/29128880-0ace-11e6-a049-062b5586e889",
		"links": {},
		"eventType": "ABSENT",
		"source": "a8d79ad7-6651-453f-a104-862046eb59b8",
		"time": "2016-04-25T10:12:05.000+0000"
	}, {
		"id": "2879f200-0ace-11e6-a195-029a128b7e29",
		"href": "https://api.prod.bgchprod.info:8443/omnia/events/2879f200-0ace-11e6-a195-029a128b7e29",
		"links": {},
		"eventType": "HUB_STARTED",
		"source": "c9c78b80-574c-4ceb-b149-df02e18d2056",
		"time": "2016-04-25T10:12:04.000+0000"
	}, {
		"id": "2879f200-0ace-11e6-9dee-062b5586e889",
		"href": "https://api.prod.bgchprod.info:8443/omnia/events/2879f200-0ace-11e6-9dee-062b5586e889",
		"links": {},
		"eventType": "ONBOARDING_COMPLETED",
		"source": "c9c78b80-574c-4ceb-b149-df02e18d2056",
		"time": "2016-04-25T10:12:04.000+0000"
	}, {
		"id": "831ba7e0-0acd-11e6-85f7-029a128b7e29",
		"href": "https://api.prod.bgchprod.info:8443/omnia/events/831ba7e0-0acd-11e6-85f7-029a128b7e29",
		"links": {},
		"eventType": "HUB_BACK_ONLINE",
		"source": "c9c78b80-574c-4ceb-b149-df02e18d2056",
		"time": "2016-04-25T10:07:26.558+0000",
		"properties": {}
	}, {
		"id": "760d37d0-0acd-11e6-bf98-062b5586e889",
		"href": "https://api.prod.bgchprod.info:8443/omnia/events/760d37d0-0acd-11e6-bf98-062b5586e889",
		"links": {},
		"eventType": "HUB_MISSING",
		"source": "c9c78b80-574c-4ceb-b149-df02e18d2056",
		"time": "2016-04-25T10:07:04.653+0000",
		"properties": {}
	}, {
		"id": "6ce79b60-04d2-11e6-9d79-0a37dbac88d5",
		"href": "https://api.prod.bgchprod.info:8443/omnia/events/6ce79b60-04d2-11e6-9d79-0a37dbac88d5",
		"links": {},
		"eventType": "ABSENT",
		"source": "a8d79ad7-6651-453f-a104-862046eb59b8",
		"time": "2016-04-17T19:27:29.814+0000",
		"properties": {}
	}]
}

Channels

[GET] /channels/

Example Response:

{
	"meta": {},
	"links": {},
	"linked": {},
	"channels": [{
		"id": "signal@2ba0f1e4-4f51-4aea-adb3-447908448786",
		"href": "https://api.prod.bgchprod.info:8443/omnia/channels/signal@2ba0f1e4-4f51-4aea-adb3-447908448786",
		"links": {
			"node": [
				"2ba0f1e4-4f51-4aea-adb3-447908448786"
			]
		},
		"unit": "PERCENTAGE",
		"supportedOperations": [
			"MAX",
			"MIN",
			"AVG"
		]
	}, {
		"id": "temperature@2ba0f1e4-4f51-4aea-adb3-447908448786",
		"href": "https://api.prod.bgchprod.info:8443/omnia/channels/temperature@2ba0f1e4-4f51-4aea-adb3-447908448786",
		"links": {
			"node": [
				"2ba0f1e4-4f51-4aea-adb3-447908448786"
			]
		},
		"unit": "CELSIUS",
		"supportedOperations": [
			"MAX",
			"MIN",
			"AVG"
		]
	}, {
		"id": "rssi@2ba0f1e4-4f51-4aea-adb3-447908448786",
		"href": "https://api.prod.bgchprod.info:8443/omnia/channels/rssi@2ba0f1e4-4f51-4aea-adb3-447908448786",
		"links": {
			"node": [
				"2ba0f1e4-4f51-4aea-adb3-447908448786"
			]
		},
		"unit": "DECIBEL",
		"supportedOperations": [
			"MAX",
			"MIN",
			"AVG"
		]
	}, {
		"id": "targetTemperature@2ba0f1e4-4f51-4aea-adb3-447908448786",
		"href": "https://api.prod.bgchprod.info:8443/omnia/channels/targetTemperature@2ba0f1e4-4f51-4aea-adb3-447908448786",
		"links": {
			"node": [
				"2ba0f1e4-4f51-4aea-adb3-447908448786"
			]
		},
		"unit": "CELSIUS",
		"supportedOperations": [
			"MAX",
			"MIN",
			"AVG"
		]
	}, {
		"id": "controllerState@2ba0f1e4-4f51-4aea-adb3-447908448786",
		"href": "https://api.prod.bgchprod.info:8443/omnia/channels/controllerState@2ba0f1e4-4f51-4aea-adb3-447908448786",
		"links": {
			"node": [
				"2ba0f1e4-4f51-4aea-adb3-447908448786"
			]
		},
		"unit": "ENCODED RELAY STATE",
		"supportedOperations": [
			"DATASET"
		]
	}, {
		"id": "signal@81414acc-9404-41fa-9947-c18990e7ed01",
		"href": "https://api.prod.bgchprod.info:8443/omnia/channels/signal@81414acc-9404-41fa-9947-c18990e7ed01",
		"links": {
			"node": [
				"81414acc-9404-41fa-9947-c18990e7ed01"
			]
		},
		"unit": "PERCENTAGE",
		"supportedOperations": [
			"MAX",
			"MIN",
			"AVG"
		]
	}, {
		"id": "temperature@81414acc-9404-41fa-9947-c18990e7ed01",
		"href": "https://api.prod.bgchprod.info:8443/omnia/channels/temperature@81414acc-9404-41fa-9947-c18990e7ed01",
		"links": {
			"node": [
				"81414acc-9404-41fa-9947-c18990e7ed01"
			]
		},
		"unit": "CELSIUS",
		"supportedOperations": [
			"MAX",
			"MIN",
			"AVG"
		]
	}, {
		"id": "rssi@81414acc-9404-41fa-9947-c18990e7ed01",
		"href": "https://api.prod.bgchprod.info:8443/omnia/channels/rssi@81414acc-9404-41fa-9947-c18990e7ed01",
		"links": {
			"node": [
				"81414acc-9404-41fa-9947-c18990e7ed01"
			]
		},
		"unit": "DECIBEL",
		"supportedOperations": [
			"MAX",
			"MIN",
			"AVG"
		]
	}, {
		"id": "targetTemperature@81414acc-9404-41fa-9947-c18990e7ed01",
		"href": "https://api.prod.bgchprod.info:8443/omnia/channels/targetTemperature@81414acc-9404-41fa-9947-c18990e7ed01",
		"links": {
			"node": [
				"81414acc-9404-41fa-9947-c18990e7ed01"
			]
		},
		"unit": "CELSIUS",
		"supportedOperations": [
			"MAX",
			"MIN",
			"AVG"
		]
	}, {
		"id": "controllerState@81414acc-9404-41fa-9947-c18990e7ed01",
		"href": "https://api.prod.bgchprod.info:8443/omnia/channels/controllerState@81414acc-9404-41fa-9947-c18990e7ed01",
		"links": {
			"node": [
				"81414acc-9404-41fa-9947-c18990e7ed01"
			]
		},
		"unit": "ENCODED RELAY STATE",
		"supportedOperations": [
			"DATASET"
		]
	}, {
		"id": "signal@91bcbaea-0ed7-4216-9b7a-351bb6f8ac26",
		"href": "https://api.prod.bgchprod.info:8443/omnia/channels/signal@91bcbaea-0ed7-4216-9b7a-351bb6f8ac26",
		"links": {
			"node": [
				"91bcbaea-0ed7-4216-9b7a-351bb6f8ac26"
			]
		},
		"unit": "PERCENTAGE",
		"supportedOperations": [
			"MAX",
			"MIN",
			"AVG"
		]
	}, {
		"id": "rssi@91bcbaea-0ed7-4216-9b7a-351bb6f8ac26",
		"href": "https://api.prod.bgchprod.info:8443/omnia/channels/rssi@91bcbaea-0ed7-4216-9b7a-351bb6f8ac26",
		"links": {
			"node": [
				"91bcbaea-0ed7-4216-9b7a-351bb6f8ac26"
			]
		},
		"unit": "DECIBEL",
		"supportedOperations": [
			"MAX",
			"MIN",
			"AVG"
		]
	}, {
		"id": "signal@a8600168-f81a-4f79-be07-08db414507c4",
		"href": "https://api.prod.bgchprod.info:8443/omnia/channels/signal@a8600168-f81a-4f79-be07-08db414507c4",
		"links": {
			"node": [
				"a8600168-f81a-4f79-be07-08db414507c4"
			]
		},
		"unit": "PERCENTAGE",
		"supportedOperations": [
			"MAX",
			"MIN",
			"AVG"
		]
	}, {
		"id": "rssi@a8600168-f81a-4f79-be07-08db414507c4",
		"href": "https://api.prod.bgchprod.info:8443/omnia/channels/rssi@a8600168-f81a-4f79-be07-08db414507c4",
		"links": {
			"node": [
				"a8600168-f81a-4f79-be07-08db414507c4"
			]
		},
		"unit": "DECIBEL",
		"supportedOperations": [
			"MAX",
			"MIN",
			"AVG"
		]
	}, {
		"id": "signal@c10ffa70-30c1-460a-ab7a-c39a19a80c0a",
		"href": "https://api.prod.bgchprod.info:8443/omnia/channels/signal@c10ffa70-30c1-460a-ab7a-c39a19a80c0a",
		"links": {
			"node": [
				"c10ffa70-30c1-460a-ab7a-c39a19a80c0a"
			]
		},
		"unit": "PERCENTAGE",
		"supportedOperations": [
			"MAX",
			"MIN",
			"AVG"
		]
	}, {
		"id": "battery@c10ffa70-30c1-460a-ab7a-c39a19a80c0a",
		"href": "https://api.prod.bgchprod.info:8443/omnia/channels/battery@c10ffa70-30c1-460a-ab7a-c39a19a80c0a",
		"links": {
			"node": [
				"c10ffa70-30c1-460a-ab7a-c39a19a80c0a"
			]
		},
		"unit": "VOLT",
		"supportedOperations": [
			"MAX",
			"MIN",
			"AVG"
		]
	}, {
		"id": "rssi@c10ffa70-30c1-460a-ab7a-c39a19a80c0a",
		"href": "https://api.prod.bgchprod.info:8443/omnia/channels/rssi@c10ffa70-30c1-460a-ab7a-c39a19a80c0a",
		"links": {
			"node": [
				"c10ffa70-30c1-460a-ab7a-c39a19a80c0a"
			]
		},
		"unit": "DECIBEL",
		"supportedOperations": [
			"MAX",
			"MIN",
			"AVG"
		]
	}]
}

[GET] /channels/temperature@2ba0f1e4-4f51-4aea-adb3-447908448786,targetTemperature@2ba0f1e4-4f51-4aea-adb3-447908448786?start=1458432000000&end=1458434400000&rate=5&timeUnit=MINUTES&operation=AVG

  • Return multiple channel stats:
    • temperature@deviceId
    • targetTemperature@deviceId
  • Times in unixtime (Milliseconds since Epoch)
    • start
    • end
  • rate
  • timeUnit (MINUTES, SECONDS)
  • operation (MIN, MAX, AVG, DATASET)

Example Response:

{
	"meta": {},
	"links": {},
	"linked": {},
	"channels": [{
		"id": "temperature@2ba0f1e4-4f51-4aea-adb3-447908448786",
		"href": "https://api.prod.bgchprod.info:8443/omnia/channels/temperature@2ba0f1e4-4f51-4aea-adb3-447908448786",
		"links": {
			"node": [
				"2ba0f1e4-4f51-4aea-adb3-447908448786"
			]
		},
		"start": 1458432000000,
		"end": 1458434400000,
		"timeUnit": "MINUTES",
		"rate": 5,
		"unit": "CELSIUS",
		"values": {
			"1458432000000": 19.327000000000005,
			"1458432300000": 19.287000000000003,
			"1458432600000": 19.25,
			"1458432900000": 19.235555555555553,
			"1458433200000": 19.183333333333334,
			"1458433500000": 19.135,
			"1458433800000": 19.106666666666666,
			"1458434100000": 19.09375
		},
		"operation": "AVG"
	}, {
		"id": "targetTemperature@2ba0f1e4-4f51-4aea-adb3-447908448786",
		"href": "https://api.prod.bgchprod.info:8443/omnia/channels/targetTemperature@2ba0f1e4-4f51-4aea-adb3-447908448786",
		"links": {
			"node": [
				"2ba0f1e4-4f51-4aea-adb3-447908448786"
			]
		},
		"start": 1458432000000,
		"end": 1458434400000,
		"timeUnit": "MINUTES",
		"rate": 5,
		"unit": "CELSIUS",
		"values": {
			"1458432000000": 1,
			"1458432300000": 1,
			"1458432600000": 1,
			"1458432900000": 1,
			"1458433200000": 1,
			"1458433500000": 1,
			"1458433800000": 1,
			"1458434100000": 1
		},
		"operation": "AVG"
	}]
}

User Details

[GET] /users/

Get the contact details, email, address, user ID of the currently logged in user.

Example Response:

{
	"meta": {},
	"links": {},
	"linked": {},
	"users": [{
		"id": "cf82b9d8-8d0b-43b7-ae28-xxxxxxxxxxxx",
		"href": "https://api.prod.bgchprod.info:8443/omnia/users/cf82b9d8-8d0b-43b7-ae28-xxxxxxxxxxxx",
		"links": {},
		"username": "xxxxxx@email.com",
		"email": "xxxxxx@email.com",
		"firstName": "Joe",
		"lastName": "Bloggs",
		"mobile": "+448009808614 ",
		"phone": "",
		"postcode": "W1T 1HY",
		"country": "United Kingdom",
		"city": "London",
		"address": "19-22 Rathbone Place",
		"locale": "en_GB",
		"partnerId": "1",
		"latestSupportedApiVersion": "6",
		"permissions": [
			"ROLE_USER"
		],
		"extCustomerLevel": 1,
		"alertSettings": {
			"links": {},
			"failuresEmail": false,
			"failuresSMS": false,
			"warningsEmail": true,
			"warningsSMS": false,
			"nightAlerts": false
		},
		"externalUserId": "DIA-xxxxxxxx"
	}]
}

Postman

While exploring this API I made use of the Postman API testing tool. Postman allows you to write, run and save API calls in an simple but powerful user interface. Postman also allows you to collaborate with other users to further test and develop APIs. Postman is available as a Chrome plugin or Mac application.

API Documentation

For details of further Hive API 6.1 calls see the documentation found here:

AlertMe API v6.1 Documentation

59 Comments

Add a Comment

Your email address will not be published. Required fields are marked *