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

105 thoughts on “Hive REST API v6.1

    • James Saunders says:

      @John Yes sure,
      GET device thermostat will return current temperature….
      “temperature”: {
      “reportedValue”: 20.07,
      “displayValue”: 20.07,
      “reportReceivedTime”: 1476480696281,
      “reportChangedTime”: 1476480696281,
      “readOnly”: false
      },

        • James Saunders says:

          Hi Paul, what did you not get to work? The base URLs are above. If you are wanting to get the current temperature note you need to pull the values on the Hive receiver (not the thermostat as you may first assume).
          Jim

          • Paul says:

            Sorry got a bit confused I couldn’t find temperature in your example for nodes so assumed it was another method. I have succeeded in finding the current temperature by using nodes as method. I was also able to reduce the 2411 line response to 643 by putting /id of receiver after nodes don’t suppose its possible to get just an attribute returned as this api response is rather heavy for a small embedded device to use. shame they haven’t followed other IOT platforms and given a user configured api so it looks like I might have to create my own restapi wrapper on another Device.

  1. Paul says:

    Great work James

    Been playing with the API today calling it from inside an oracle database.

    So far managed to get the authentication working to get my session id and then calling the nodes successfully, parsing the json and displaying it in an APEX application which is a nice start but still plenty more I can try. I noticed it’s actually the Heating Receiver you retrieve the temperature from and not the thermostat.

    Seems like a lot will be possible. I saw a feature request on the Hive forums from someone to overlay the temperature graph with when the boiler was actually firing which I thought would be pretty nice and I reckon as you can retrieve past actual temperatures and target temperatures that it would certainly be possible to do.

    Shame there’s no API for the BG smart meters as I’ve just had them installed.

  2. Martin says:

    Hi,I have just have Hive installed and I have been trying to access the web API using an Chrome test App called Postman.
    I send a Post to
    https://api-prod.bgchprod.info:443/omnia/auth/sessions
    with raw body
    {
    “sessions”: [{
    “username”: “xxxxxxxxxx@xxxxxxxxx”,
    “password”: “xxxxxxxxxxxx”,
    “caller”: “WEB”,
    “Accept”: “application/vnd.alertme.zoo-6.1+json”,
    “Content-Type”: “application/vnd.alertme.zoo-6.1+json”,
    “X-Omnia-Client”: “Hive Web Dashboard”
    }]
    }
    with or without Content-Type application/json in the header, but I always get back
    {
    “error”: {
    “reason”: “COULD_NOT_PARSE_VERSION”,
    “message”: “Please provide API version in Accept header in the format e.g.: ‘application/vnd.alertme.zoo-6.0.0+json’. The known versions are: [6.0, 6.1, 6.2, 6.3, 6.4, 6.5]”
    }
    }

    The username and password work ok with the V5 APi login, any idea where I am going wrong. Thanks for any help.

    • James Saunders says:

      Hi Martin,

      As it happens, I have put together a couple of Postman ‘collections’ for the Hive v5 and v6.1 API’s which may be of use.

      Postman is a really cool Chrome extension application which allows you to test REST API’s and save them into a library. You can download Postman here:
      https://www.getpostman.com

      Once installed you should then be able to add the following ‘Collections’ to your Postman app:
      * Hive API v5 https://www.getpostman.com/collections/b07ceeb5983e7640b07e
      * Hive API v6.1 https://www.getpostman.com/collections/954a62af1259222e8b39

      I have configured these to use session variables and it should populate variables such as hubId and sessionId automatically on login, but You may need to configure your own environment variables for:
      “v6url” : “https://api-prod.bgchprod.info:443/omnia”
      “v5url” : “https://api.bgchlivehome.co.uk/v5”
      “username” : “user@email.co.uk”
      “password” : “pa$$word”

      If you find these useful or have and additions or corrections please do share your ideas – I am happy to add further to these. I may pop them on GitHub to share.

      • Martin says:

        Hi James, Thanks for the quick reply, I see my problem now, I was putting the Accept etc in the body instead of the headers. Thanks for the help

      • Graham White says:

        Hi James,

        Thanks for your work on this. Having bought a Google Home back to the UK from the US this weekend I’ve been investigating setting it up with Hive since IFTTT support for Hive is rather basic. Ultimately, I’d like to create a Node Red node for version 6.1 of the API and this guide has given me a great head start.

        Playing around with your Postman collection for v6.1 you’ve included your device ID in the URL. It’s no biggie but you could add a variable for that as well based off the GET call to Device List.

        Thanks again,

        Graham

        • James Saunders says:

          Thanks Steve,
          I haven’t got any Hive bulbs yet, but I am sure it will not be a million miles from that of ‘THERMOSTAT SET’ calls above. So would probably be something like:

          [PUT] /nodes/xxxx-light-node-id-xxxxx
          Request Body:
          {
          “nodes”: [{
          “attributes”: {
          “state”: on,
          “level”: 90
          }
          }]
          }

          The above is only a guess – but you get the idea.

          • Steve says:

            Cheers James,
            I installed the postman interceptor (it’s great!) and found for my white bulb it’s the following:
            {
            “nodes”:[{
            “attributes”:{
            “state”:{“targetValue”:”ON”},
            “brightness”:{“targetValue”:100}
            }
            }]
            }

            Seems the ON/OFF *has* to be uppercase
            … off to play with the colour bulb now 🙂

          • Steve says:

            …and from a colour bulb it’s all about hue, saturation and value as a colour,brightness:
            {
            “nodes”:[{
            “attributes”:{
            “hsvHue”:{“targetValue”:0},
            “hsvSaturation”:{“targetValue”:99},
            “hsvValue”:{“targetValue”:100},
            “colourMode”:{“targetValue”:”COLOUR”}
            }
            }]
            }

          • Alex says:

            For a White To Warm bulb if you want to set colour temp and brightness:

            {
            “nodes”: [{
            “attributes”: {
            “state”: {
            “targetValue”: “ON”
            },
            “brightness”: {
            “targetValue”: 90
            },
            “brightnessTransitionTime”: {
            “targetValue”: “”
            },
            “colourTemperature”: {
            “targetValue”: 3378.3783783783783
            },
            “colourTemperatureTransitionTime”: {
            “targetValue”: “”
            }
            }
            }]
            }

            Simple on off operation is the same as the active plug call

      • Keith Solomon says:

        Sorry to dredge up an old post, but I just got my Hive kit. I want to use one of the active plugs to control power to my 3D printer, so I’ve been poking around the API. However, I’m having a problem where no matter what I do, I always get a USERNAME_PASSWORD_ERROR when trying to authenticate. I’m using your v6.1 collection in Postman, with the proper environment variables configured, but it happens even without the collection. Any pointers on where to start looking to track down the issue?

  3. Will says:

    Thanks for this. I’ve been trying to find a response which includes basic info about Hive’s heating – mainly, when did the heating last come on? What was the time when it went off? I may have missed it in /nodes/ but can’t see that anywhere. Have you come across it?

    • James Saunders says:

      Hi Will,
      I think what you are looking for can be found in the ‘channels’ function. I briefly talk about this call above in this post. If you first off do a GET call to:
      /channels/
      You will then receive a list of available channels akin to:
      {
      “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”
      ]
      },

      Then a call to /channels/controllerState@2ba0f1e4-4f51-4aea-adb3-447908448786?start=1458432000000&end=1459360868000&rate=5&timeUnit=MINUTES&operation=DATASET

      You will see results akin to:
      {
      “meta”: {},
      “links”: {},
      “linked”: {},
      “channels”: [
      {
      “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”
      ]
      },
      “start”: 1458432000000,
      “end”: 1459360868000,
      “timeUnit”: “MINUTES”,
      “rate”: 5,
      “timeZone”: “Europe/London”,
      “unit”: “ENCODED RELAY STATE”,
      “values”: {
      “1458432000000”: 0,
      “1458432300000”: 0,
      “1458432600000”: 0,
      “1458481200000”: 0,
      “1458481500000”: 1,
      “1458481800000”: 1,
      “1458482100000”: 1,
      “1458482400000”: 0,

      Hope this helps.

      • Rick says:

        Hi James,
        Have you any idea what the returned values relate to from call to the controllerstate? only I get back values of 0,1,2 and 3?

  4. Daniel says:

    Hi, I was wondering if anybody knows how we can control Hive Active Lights through the API, if possible does anybody have details on how to do this in both v5 and v6 APIs?

    Also, I noticed the v6 API now lets us activate a Boost. Does the v5 allow this in some way? If so it would be useful so I don’t have to re-write my code that calls the API. If anybody could offer any advice that would be great.

    • James Saunders says:

      Hi @dan
      For v6 API see the comment from Steve 26 November detailing the call needed to control lights.
      As for v5, I doubt it is possible as the bulbs came about after this API version so doubt they added this support.

      Hope this helps.

      • Daniel says:

        Thanks, sorry I missed that comment somehow. I’ve got the basics working with lights now (Only have a White Bulb to test with tbh) and just using a mix of the v5 and v6 API in the same solution at the moment. I didn’t realise the v6 API existed until after writing all the code based on v5.

        Good to see Boost is in the v6 API too. I am looking into how to rename a node at the moment so if I figure out that it’s possible I’ll post here. I’ll have to have a proper dig through the documentation at the link you provided.

        Thanks again for publishing this post, your v5 post was also a big help.

  5. Craig says:

    Hi James, superb article,
    However I am getting the following response:

    {“errors”:[{“code”:”INVALID_PARAMETER”,”title”:”No such properties ‘[state]’ in class ‘com.alertme.zoo.schemas.Node_class_synthetic_binary_control_device_uniform_scheduler”,”links”:[]}]}

    When I issue a PUT to try and access a smart socket using the request

    {
        “nodes”: [{
            “attributes”: {
                “state”: {
                    “targetValue”: “ON”
                }
            }
        }]
    }

    Do you have any advice?

    • James Saunders says:

      Hi Craig, I think your call looks correct, but the device you are calling it against is possibly incorrect?
      In your example it says the class nodeType is:
      “nodeType”: “http://alertme.com/schema/json/node.class.synthetic.binary.control.device.uniform.scheduler.json#”,
      where as an ActivePlug class nodeType should be:
      “nodeType”: “http://alertme.com/schema/json/node.class.smartplug.json#”
      I think you are making the call against the synthetic (virtual) scheduler device rather than the physical ActivePlug device.

      Check the device ID you are calling this against.

      I also assume you are trying to control a new Hive ActivePlug (rather than the older AlertMe SmartPlug which can not be remotely controlled)?

  6. Kieron Cooke says:

    Hi James, useful article, wondered if anyone could clarify my understanding of the nodes listed in the output of get nodes. For me I just have one thermostat, but I get list of 5 nodes back:

    1) “name”: “Home”,
    “nodeType”: “http://alertme.com/schema/json/node.class.thermostat.json#”,

    2) “name”: “Your Receiver”,
    “nodeType”: “http://alertme.com/schema/json/node.class.thermostat.json#”,

    3) “name”: “http://alertme.com/schema/json/node.class.synthetic.zonename.initializer.json#”,
    “nodeType”: “http://alertme.com/schema/json/node.class.synthetic.zonename.initializer.json#”,

    4) “name”: “Home”,
    “nodeType”: “http://alertme.com/schema/json/node.class.thermostatui.json#”,

    5) “name”: “Your Hub”,
    “nodeType”: “http://alertme.com/schema/json/node.class.hub.json#”,

    I’ve been playing with setting the activeHeatCoolMode on the node named “Your Receiver”, which broadly seems to work, not always consistently though. Any idea what the second node of the same type is for? Both have the attribute: “activeHeatCoolMode”, should I be setting both?

    • James Saunders says:

      Hi Kieron,
      The nodes you are seeing are:
      1) “name”: “Home” – This is your thermostat, the unit with the controls and screen (You probably renamed it to ‘Home’ in your Hive app).
      2) “name”: “Your Receiver” – This is the receiver which sits next to, and connects directly to, your boiler.
      3) “name”: “Synthetic” – This is a virtual device, it is the scheduler which you can use to set boiler on/off schedules.
      4) “name”: “Home” – Not sure why you see 2 of these??
      5) “name”: “Your Hub” – Your hub device connected to your broadband router.

      I too was a little confused by all these at the start as it is a little backwards, but when setting temperature though the API you send temperatures to the ‘Receiver’ device (not the ‘Thermostat’ as you would first assume). The way I remember it is that the ‘Receiver’ device is the main boiler control brain which can be sent messages from either the Hub (via Web/API) or from the Thermostat (via Zigbee) or from the Synthetic virtual schedule device. Hope this makes sense.
      Jim

      • Kieron Cooke says:

        Thanks James for the clarification. In case this of any use to others, I’ve written a small program to turn my heating schedule on/off based on whether any mobile phones (and therefore people) are at home. Its always been a bit of a frustration to me that the mobile app just sends me geo-location alerts rather than actually doing something about it. Anyway take a look: https://github.com/krcooke/hive-home

  7. John Maguire says:

    I’ve been trying to use this tread as a means of controlling my two new Hive lights. If nothing else I’ve learnt a lot about PUT and GET but now I’ve fit a brick wall.

    So using Postman I can login OK and get back the session ID token, I can also get a Device list and receive two ids for the two bulbs I have.

    I can even send a GET …./nodes/0967bc11-7462-448a-87fe-bac199920f07 referencing the ID of one of the bulbs and I get the following (snipped to remove the irrelevant stuff)

    “meta”: {},
    “links”: {},
    “linked”: {},
    “nodes”: [
    {
    “id”: “0967bc11-7462-448a-87fe-bac199920f07”,
    “href”: “https://api.prod.bgchprod.info:8443/omnia/nodes/0967bc11-7462-448a-87fe-bac199920f07”,
    “links”: {},
    “name”: “Warm White 1”,
    “nodeType”: “http://alertme.com/schema/json/node.class.light.json#”,
    “parentNodeId”: “64ae687e-949e-4218-9b05-14aa3ea8c8d8”,
    “lastSeen”: 1484571060158,
    “createdOn”: 1484383859437,
    “userId”: “xxxxx”,
    “ownerId”: “xxxxxx”,
    “relationships”: {
    “boundNodes”: []
    },

    },
    “brightness”: {
    “reportedValue”: 100,
    “targetValue”: 100,
    “displayValue”: 100,
    “reportReceivedTime”: 1484401860316,
    “reportChangedTime”: 1484389412177,
    “targetSetTime”: 1484389998156,
    “targetExpiryTime”: 1484390298156,
    “targetSetTXId”: “540f84df-0779-4b42-a591-59d0bc991d53”,
    “propertyStatus”: “COMPLETE”

    “model”: {
    “reportedValue”: “FWBulb01”,
    “displayValue”: “FWBulb01”,
    “reportReceivedTime”: 1484401860316,
    “reportChangedTime”: 1484383859357
    },
    “state”: {
    “reportedValue”: “OFF”,
    “targetValue”: “OFF”,
    “displayValue”: “OFF”,
    “reportReceivedTime”: 1484401860316,
    “reportChangedTime”: 1484389999266,
    “targetSetTime”: 1484389998156,
    “targetExpiryTime”: 1484390298156,
    “targetSetTXId”: “540f84df-0779-4b42-a591-59d0bc991d53”,
    “propertyStatus”: “COMPLETE”
    },
    …snip…

    So it seems to be reporting back OK

    But if I try to change the status by sending a PUT to …./nodes/0967bc11-7462-448a-87fe-bac199920f07

    With the following in the body
    {
    “nodes”:[{
    “attributes”:{
    “state”:{“targetValue”:”ON”},
    “brightness”:{“targetValue”:100}
    }
    }]
    }

    I always get a 400 error ‘Could not read json”

    I’ve tried both the bulb IDs, different browsers and plugins (both on a PC and Mac) but always get the same result.

    I’d be grateful if anyone could point out where I’m going wrong – I’m probably doing something obviously incorrect.

    Many thanks in advance

    • James Saunders says:

      Hi John,
      What happens when you paste your request into a JSON validator like http://jsonlint.com/ ? Does it validate OK?

      My first guess is that the quotes you are using are “ (unicode quotes) rather then ” (ascii quotes) ?
      e.g “targetValue”:”ON” rather than “targetValue”:”ON”.

      [EDIT]… ahh, thats annoying WordPress converts them.. But I think you get the idea – replace your quotes.

      • John Maguire says:

        Oh for crying out loud! That’s what happens when you copy and paste!

        Right then I’ve manually retyped all the quotes, dropped the whole body content into a JSON validator (the one you suggested) and it returns OK.

        So far so good, try to send the PUT command and I get a 404 error and the return result is
        “errors”: [
        “code”: “NOT_FOUND”,
        “links”: []
        I’ve snipped some of the opening and closing braces out

        Which sounds to me as if the target URL is wrong. I can successfully run a GET command to URL/nodes/
        as from the results returned from a Device List GET command below;

        “id”: “0967bc11-7462-448a-87fe-bac199920f07”,
        “href”: “https://api.prod.bgchprod.info:8443/omnia/nodes/0967bc11-7462-448a-87fe-bac199920f07”,
        “links”: {},
        “name”: “Warm White 1”,
        “nodeType”: “http://alertme.com/schema/json/node.class.light.json#”,
        “parentNodeId”: “64ae687e-949e-4218-9b05-14aa3ea8c8d8”,
        “lastSeen”: 1484581859956,
        “createdOn”: 1484383859437,

        Many thanks for your very quick response and I do appreciate any suggestions you might have for me.

        John

        • John Maguire says:

          Right scrub that, all working now. Turns out that while I was working on the code, someone had managed to switch the bulb off at the switch so no power to it!

          So learnt something new, a 404 Not Found error can mean that the actual device is unreachable.

          And now to learn how cURL works, wrap it all up in bit of Python script and see if my Domoticz HA system can talk to it.

          What can possibly go wrong….

    • James Saunders says:

      Hi Rick,
      Sure! See the ‘Channels’ example above from which you can get temperature history.
      Channels are a bit more complicated than the old v5 method but a great deal more powerful.
      Let me know how you get on.
      Jim

  8. Kostas says:

    Hello James,

    Thanks for the detailed outline of the API! It is amazing!

    When I experiment with my Hive at home I get an interesting response when asking the nodes! I get 3 entries with name: “Your Receiver” plus “Your Hub” and the UI as “Hive 2”!

    Those 3 entries seem similar but it seems they are doing different things and the only way I could ‘identify’ the one that actually controlled the temperature has been trying to search for the [‘attributes’][‘capabilities’][‘reportedValue’][0] = “THERMOSTAT” but don’t know if this is the most reliable way?

    Thanks!

  9. John says:

    Great article thanks.
    I cant see anything obvious in the outputs but does anyone know of a way to get thermostat battery life from the API?

      • John says:

        James, thanks for that. I did see this however as it was against a different device than my thermostat i wasn’t sure what it was related to,

  10. Mike says:

    Hello! Is it possible to check boiler on/off (ie firing or not firing) status with the API. I want to check every minute to be able to create a log of how many hours the boiler has been on for each day…. Thanks

  11. Nick Boyle says:

    I’m trying to set my temperature, and have it all working until the final set call …

    “{“errors”:[{“code”:”MISSING_PARAMETER”,”title”:”Node type is missing”,”links”:[]}]}”

    I didn’t see that I needed to send Node Type. Any suggestions on where to place this and whether this is the right data?

    msg.nodeType = “http://alertme.com/schema/json/node.class.thermostat.json#”;

    msg.payload = {
    “nodes”: [{
    “attributes”: {
    “targetHeatTemperature”: {
    “targetValue”: 22
    }
    }
    }]
    };

    • James Saunders says:

      Hi Nick, Very odd. You should not need to send a device type?

      1. Are you calling the correct URL? and using PUT?
      e.g: https://api-prod.bgchprod.info:443/omnia/nodes/2ba0f1e4-4f51-4aea-adb3-447908448786

      2. Are you calling against the correct device ID?
      Note: It is a not obvious, but it is NOT the “Your Thermostat” device you send temperature changes to but rather the “Your Receiver” device.

      3. You could try downloading Postman (https://www.getpostman.com/) and the ‘collection’ I have put together to test the Hive API (see comment above dated ‘2 November 2016’ for more info. I have just re-tested the Thermostat Set function on my setup and it all still works fine.

      Let me know how you get on.

      • Nick Boyle says:

        James,

        3/ I’ve tried Postman, but am unsure how to implement the usernames & passwords. Do you know of a demo?

        2/ I got seven options, so am not sure.

        3 x Your Receiver
        1 x Signal Booster
        1 x schema/json
        1 x Your Hub
        1 x Your Thermostat

        1/ It’s a right mish mash of GET/PUT/PUSH

  12. Ben Davies says:

    Great article James, and thanks for this! It has really helped me get started with my attempt at wrapping the as a PowerShell Module available here if anyone is interested: https://github.com/ukbendavies/PoshHive. I’m hopeful others will find what I’ve started useful and I can highly recommend using the /events api to review how you nodes are interacting and what commands are doing. Thanks, and by the way has anyone successfully attempted to simulate a device using the api to see how the other Hive devices interact?

    • Ben Davies says:

      Hi James, I’m wondering if it would be possible to get a mention (really small one 🙂 in your main article to help publicise the powershell module. I’ve gotten most functions working now and I’m hoping this will help others with using the API directly too as you can add the -Verbose onto any function and see what the actual API call looks like and this could then be used verbatim in other apps. I’ve also referenced your great work in my module too, hope that’s okay.

    • Ben Davies says:

      Anyone noticed the change in the 6.5 version of the api recently? attributes has been replaced with features amongst other changes that look like a huge overhaul.

        • Ben Davies says:

          looks like the hive website is already using these feature based apis. wonder if this unlocks any more functionality.

          I’m looking for a method to monitor boiler water return temperature, not sure if this is possible but I figure if it is its burred in the data somewhere, anyone any clues if this is possible at all please?

          • Paul says:

            the hive does not even know when the boiler is on as it only raises the demand for the boiler but if its internal stat says water in system is up to temperature then the hive will report the boiler is on when its not. the former alertme products all reported temperature but not sure if the bgas ones do or if its reported in this api but if it did you could attach say a door contact to the return pipe to report temperature.

          • Ben Davies says:

            thanks Paul. Are you saying that the AlertMe products did provide diagnostic data from the boiler but Hive does not? I’m looking for water flow temperatures. Question is if my boiler is not emitting the data but others do? and secondly if Hive retrieves this data and makes it available?

          • Paul says:

            Alertme did a burglar alarm system which bgas are now offering updated versions of the same sensors ( movement and door contacts ) a feature of the previous alertme sensors was each one reported the temperature of the sensor so the off the wall idea was if the updated bgas door contact does report temperature via the api you could attach a door sensor to your pipes. unfortunately bgas have removed some of the features of the previous alertme products like the power plug doesn’t report power only switches and acts as range extender so they may have removed the temperature reporting from the door sensors even if the hardware still measures it. If someone has any of the door sensors installed maybe they can check if temperature is reported in the api return

  13. Rick says:

    When I do the following call to get the data for when the heating has been off/on, I’m only getting data back for every 1 hour and not 5 minutes as specified in the call??. Anyone else get this?, am I doing something wrong?.

    /channels/controllerState@2ba0f1e4-4f51-4aea-adb3-447908448786?start=1458432000000&end=1459360868000&rate=5&timeUnit=MINUTES&operation=DATASET

  14. Mark says:

    Hi all. I have successfully managed to ‘PUT’ BOOST mode and set temperature from the postman calls. I am struggling to switch between ACTIVE SCHEDULE / OFF / MANUAL / UNBOOST.
    Has anyone managed to find the combination of targets to set these modes?

    • Jason says:

      Hi did you manage to get an answer to your question, this is the sort of thing I’m trying to find out too?

  15. Mike says:

    I’ve had an Alertme system for years, but they’re turning of the service at the end of October, I’ve been offered a free upgrade to Hive with a few bits (not enough to replace my alertme kit). Does anyone know if the Alertme bits work with the latest Hive hub. Also, does the API still work. I’ve spoken to support but the answer I get is no to both, which I find hard to believe. All I want to do is turn lights on and off via a computer sitting in the house – presumably the API has to go through their servers, so I can’t do the lights locally?

  16. g says:

    I’m looking into using the API to record consumption and temperature data and then also utilise motion detection status changes for use alongside other smart devices, but in order to do this (with the REST API) Long Polling seems like the only option. For this to be responsive I’d need to request every few seconds, but I’m guessing that I’d get blocked in doing so, has anyone tried something similar?

  17. Mike G says:

    This is awesome thank you.
    Some things I’m going to work on – but others may have got there before me:
    Has anyone found a way to get the same information from a local device rather than going out to the internet?
    Any way to subscribe to a stream of updates for a channel rather than polling (though poling every few minutes will probably work)
    Joining the zigbee network with Xbee to get the same information locally.

  18. Tom says:

    James, this is brilliant!!!
    Great, really comprehensive article, and I managed to get it all working using a bash script and curl within an hour or two having had little API experience before.

    One minor point – would it be possible to have the JSON output in expandable boxes as it adds unnecessary length to the page and makes it difficult to find the various URIs that you can GET and PUT to.

  19. Sian says:

    Thanks for a really useful guide to the Hive API.
    I can login successfully, read the nodes and read the channels.
    But when trying to read temperature , using the url:
    https://api.prod.bgchprod.info:8443/omnia/channels/temperature@?start=1518733250396&end=1518733250996&rate=1&timeUnit=MINUTES&operation=AVG
    where end is now and start is 6 minutes ago, I get this response:
    { “errors”: [ { “code”: “NOT_FOUND”, “title”: “No data found for period”, “links”: [] } ] }
    Am I trying to read from the right node? If so, how do I find a valid time range?

  20. Paul says:

    have had a few problems with the session id which times out after a while of inactivity. you then get a 401 not authorized and if you then ask for a new key it wont give you one just carries on with giving 401. this is running on exosite’s script engine so not easy to work out what is happening as I cant sniff the traffic. by accident I discovered that if you send a request without a session key it will then let you have a new session key on the next request. Is there a better way to get a new session key when it expires due to inactivity

  21. Manigandan says:

    Hi,
    We are facing issue with Hive thermostat latest API response.
    We are not getting the lastSeen value in the API response for the parent node.
    Is it new behaviour or something to do with thermostat??
    “parentNodeId”: “c9c78b80-574c-4ceb-b149-df02e18d2056”,
    “lastSeen”: 1465759250499,

  22. AJ says:

    I’m not an expert programmer but I’d be interested to know from anyone who is how difficult it would be to write something that would turn off the heating when the last person leaves the house, and back on when the first person returns.

    My biggest annoyance with Hive is that they won’t provide the functionality to do proper geofencing like Tado and Nest do. I’m convinced this is because they don’t REALLY want you to maximise your saving.

    It would be great to poke them in the eye and come up with something that did the job another way,

  23. Sian says:

    That’s a great app! I’ve been working on a way to get csv of target and actual temperatures. It looks like that was your intention too, but I only see one line on the graph, for Temperature, and nothing for Target. Are you still developing it? I’ve got to the point where I can now run an on demand NodeRED job on my raspberry pi, which emails Temperature and Target readings for a specified time period, as json, to me, but I still have to do a lot of manual processing to turn this into a graph.

  24. Andrew Young says:

    Great API guide thanks. Hope you don’t mind me plugging this, but I’ve produced a hive web server app in Node.Js I plan on enhancing. Currently it allows you to view the JSON output from the APIs and export the history to a .csv format (one thing I noticed from the API is that if you request the temperature and target temperature, there might be gaps in the date/times requested in one or the other which makes it hard to compare. My export function will fill in the gaps to make sure you can import and graph both side by side without risk of them getting out of step).

    The app is on github here: https://github.com/ajyounguk/hive-client

    • Rich says:

      Hi Andrew I am trying to really hard to get your app working from GITHUB that you link to here, however I keep getting the follwing error, any ideas how to fix?
      Error: Cannot find module ‘json file’
      at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
      at Function.Module._load (internal/modules/cjs/loader.js:507:25)
      at Module.require (internal/modules/cjs/loader.js:637:17)
      at require (internal/modules/cjs/helpers.js:22:18)
      at new View (C:\HIVE\hive-client-master\node_modules\express\lib\view.js:81:14)
      at Function.render (C:\HIVE\hive-client-master\node_modules\express\lib\application.js:570:12)
      at ServerResponse.render (C:\HIVE\hive-client-master\node_modules\express\lib\response.js:1008:7)
      at C:\HIVE\hive-client-master\controllers\hiveController.js:180:25
      at Layer.handle [as handle_request] (C:\HIVE\hive-client-master\node_modules\express\lib\router\layer.js:95:5)
      at next (C:\HIVE\hive-client-master\node_modules\express\lib\router\route.js:137:13)

      • Andrew Young says:

        Hi Rich – sorry – not been monitoring things here at all, best way to get in touch is to create an issue on the git repository. Having said I’ve recreated your error, it can’t open the hive.config.json file with your hive user/password. Check the config directory, you need to copy the config-sample.json file to config.json and edit it with your credentials. There are instructions in the git readme to do this too. I’ll change the code to make the error for this condition a bit more user friendly.

  25. Chris says:

    Can this be used to detect whether or not a door/window sensor is open/closed.

    I ask as I want to write something that will alert me to any open windows in my office at 5pm, so no windows are left open overnight.

    Eg, if time is >5pm and sensor=open then email/text me

    Hive do not have a recipe for this and I cannot think of a way to do it with IFTTT so my only recourse is a possible api solution.

    Any ideas?

  26. Andy Jacobs says:

    Well, the learning curve has been steep as I started my little project with no knowledge of how to use an API and no programming experience apart from a bit of PHP. This guide has been invaluable. I’ve now go a Raspberry Pi sniffing for the Bluetooth MAC addresses of everyone in the house and writing the status to a MySQL database. This is done with a Python Flask route that gets run every 5 minutes via a cron job. Another route then checks to see who’s in and sets the heating accordingly. I’ve also written a little app to turn on/off the occupancy based stuff, adjust the temperature and turn the boost on and off with a nicer dashboard.

    This all works a treat so I now have proper occupancy based control to turn the heating off if the house is empty.

    I’m just wondering 3 things…

    – If Hive will ever support the API properly
    – Whether there is any limit on API calls per user
    – Whether they might just shut the API down at any time

  27. Mitul says:

    Does “THERMOSTAT SET” API support decimal values for “targetValue”?
    Example:

    {
    “nodes”: [{
    “attributes”: {
    “targetHeatTemperature”: {
    “targetValue”: 22.5
    }
    }
    }]
    }

  28. Steve says:

    Hi not sure if this thread is still active. i am tying to following the tutorials here, but when I type ./hiveToOpenHAB.sh -getIDs all I get is ERROR: Empty data
    Any ideas, thanks in advance Steve

  29. Steve says:

    I am actually getting a little further now, but am tottaly stuck on this error

    Curl_http_done: called premature == 0
    100 130 0 42 100 88 144 302 –:–:– –:–:– –:–:– 303
    * Connection #0 to host api-prod.bgchprod.info left intact
    Session: { “error”: { “reason”: “Could not read json” } }
    jq: error (at :1): Cannot iterate over null (null)
    SessionID:
    % Total % Received % Xferd Average Speed Time Time Time Current
    Dload Upload Total Spent Left Speed
    100 38 100 38 0 0 161 0 –:–:– –:–:– –:–:– 162

  30. Luke says:

    I’m late to the game on this, but have been trying to get a session ID and it looks like I’ve got something wrong, or the API has changed. When trying to get the session ID, the response is:
    “code”: “USERNAME_PASSWORD_ERROR”,
    “title”: “Username or password not specified or invalid”

    I’ve verified I can log in with my creds, I even downloaded the landlord app above to test and it cannot get a session ID, which tells me something changed.

    Any ideas?

    • Derek S says:

      Luke, did you solve your issue. I’ve just spotted that my Python program that hase been happily logging data from Hive is now having to logon every time. I’m guessing something has changed about the use of Session IDs.
      Thanks
      Derek

  31. Thomas says:

    auth/session works fine for me. But when I use /nodes I get the following error. Anyone know what it means?

    {
    “errors”: [
    {
    “code”: “SERVICE_UNAVAILABLE”,
    “title”: “Service unavailable”,
    “detail”: “Hystrix circuit short-circuited and is OPEN”,
    “links”: []
    }
    ]
    }

  32. Ian Cox says:

    Working perfectly, developing my own control/info panel solution for the heating so far but intend to extend the system to the other hive controlled products in the future. This was just the head start I needed.

    Only issue I really have is the ‘attributes’ values. Obviously a dictionary of mixed object types, using C# JsonConvert (NewtonSoft) I have yet to find a way to define object maps for the JSON. Is there anyway of getting to the schemas defined in the ‘NodeType’ fields. Tried my usual approaches but came up lacking.

    Next step to look at channels and historical data for temperature and heating on/off events.

  33. Alan says:

    I can get Boost working with “activeHeatCoolMode”: {“targetValue”: “BOOST”} as in the example, and I can switch off the thermostat by setting targetValue to OFF, but I can’t seem to get the thermostat to switch back on, either to SCHEDULE or MANUAL. Does anyone have the json to accomplish this?

    • Thomas says:

      Try this, replacing target value with the temp you want it to go to. I’m not sure if it’ll work

      {
      attributes: {
      targetHeatTemperature: {
      targetValue: 21.0
      },
      activeScheduleLock: {
      targetValue: true
      },
      scheduleLockDuration: {
      targetValue: 0
      },
      activeHeatCoolMode: {
      targetValue: “HEAT”
      }
      }
      }

      • Alan Carter says:

        Thanks Thomas, I figured out the solution a few days after I posted the question and should have posted the answer! You’re right, but the duration isn’t required. Set the lock to True for Manual, False for Schedule.

  34. Bruce says:

    This all looks great. Have managed to get live temps from all TRVs using “node” and get the history for one or more valves using “channels” which is all good stuff. Is there a way of being able to see if a valve is open or closed from the API ?

  35. Chris says:

    Any idea how to get oauth2 to work with this? I don’t like having to store my username and password. I can get a bearer token using the Swagger interface, and I can use it for requests using
    “Authorization: Bearer $TOKEN”
    but I can’t find out how to refresh it

    https://oauth.prod.bgchprod.info/oauth2/token
    seems to want to play ball, but I even with my username and password, it always returns Unauthorised

  36. Chris says:

    It seems like this API has been blocked now. It’s been working fine for me for a couple of years, but now when I try to get a session from
    https://api.prod.bgchprod.info/omnia/auth/sessions
    I get the response:

    {
    “genericError”: {
    “error”: {
    “reason”: “GONE”,
    “message”: “Not supported anymore”
    }
    }
    }

    This happens both with curl calls and with the Swagger UI

    • Chris B says:

      Me too!
      2 years hard work setting up switches & TRV’s suddendly stopped the same day I was fitting an extra 5 TRV’s

      • Rick says:

        I changed my code to get the sessionid using the following

        sessionId=$(curl -H “Host: beekeeper.hivehome.com” -H “Content-Type: application/json” -H “Accept: /” -H “User-Agent: HiveRNApp/10.16.2 Mozilla/5.0 (iPhone; CPU iPhone OS 13_1_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148” -H “Accept-Language: en-gb” –data-binary ‘{“username”:”YOURUSERNAME”,”password”:”YOURPASSWORD”,”devices”:true,”products”:true,”actions”:true,”homes”:true}’ –compressed ‘https://beekeeper.hivehome.com/1.0/cognito/login’ | python -c “import sys,json; print json.load(sys.stdin)[‘token’]”)

    • Chris B says:

      Excellent result !
      I have just today got it working almost perfectly after using the following very similar code to above in the original script:-
      session=$(curl -s -k -g -H “Content-Type: application/json” \
      -H “Accept: application/json” \
      -d ‘{“username”:”xxxxxx@icloud.com”,”password”:”xxxxxx”}’ \
      https://beekeeper.hivehome.com/1.0/cognito/login)
      sessionId=$(echo $session | python -c ‘import sys, json; print json.load(sys.stdin)[“token”]’)

  37. Rick says:

    Has the access to hive api gone again. I’m getting a “forbidden” error when trying to request the session id.

Leave a Reply to Kostas Cancel reply

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