Device API - Add Devices

If you have a proxy or gateway communicating with the server on behalf of your devices, you will need to add each new device to the server using the <add ...> command. Otherwise, you can skip this section.

You must add sub-devices after activating your proxy, because the server will ignore the proxy until it is activated to the user's account.

The URL to POST to is http://developer.peoplepowerco.com/deviceio/ml.

In the example POST below, a gateway with ID 123456FFFEABCDEF declares to the Internet of Things Platform that a new device B0C8AD6806123456 has been added to the system.

<?xml version="1.0" encoding="UTF-8"?>
<h2s seq="1" hubId="123456FFFEABCDEF" ver="2">
  <add deviceId="B0C8AD6806123456" deviceType="11" />
</h2s>

The gateway does not need to add itself because it has already been activated. Anytime an <add ... /> message is passed to the cloud server, the cloud will verify we can receive measurements for this device, and then send back an ACK.

Duplicate <add ... /> messages are acceptable, and are expected to happen when a hub or gateway reboots and rediscovers all devices in the network.

If the Internet of Things Platform receives a measurement from a device that has not been added, it will respond to measurements with an 'unknown' tag:

<?xml version="1.0" encoding="UTF-8"?> 
<s2h seq="6" status="ACK" ver="2">
  <unknown>B0C8AD6806123456</unknown>
</s2h>