Adding a New Device

You can automatically discover devices with the IzoT Server, and you can manually add devices to the IzoT Server devices collection.  You can discover or add devices to the IzoT Server using any of the following methods:

 

The IzoT Server maintains a list of devices in a device file. On the IzoT Router and other Debian derivative platforms, the device file is /home/debian/izot-sdk/etc/lonbridge/instances/device.xml. The device file has a list of all devices discovered by the IzoT Server, and you can manually add devices to the device file. The device file also has properties for each device as described in Getting a List of Devices. When the IzoT Server discovers a new device, it adds an entry for the device to the device file, and sets the active attribute to "pending". If the IzoT Server matches the program ID for the device to a device class file and starts receiving datapoint values from the device, it changes the active attribute to "true". If the IzoT Server fails to read a datapoint from a device after several attempts, it changes the active attribute to "marginal". If the IzoT Server fails to read a datapoint from a device after many attempts, it changes the active attribute to "false".

 

The following example is the contents of a device file with two devices defined:

 

<devices>
<device nid="00D07105C253" id="7" fblock="-1" type="unknown" name="Unknown Device" brand="IzoT" active="false" pid="8000010101010421" />
<device nid="00D07110020D" id="1" fblock="-1" type="room_controller" name="FT_6000_Multi_Sensor" brand="Echelon" active="true" pid="9FFFFF0501840430" illuminance="35841" temperature="102" switch-setting-1="off" switch-state-1="off" state-setting- 1="off" state-1="off" switch-setting-2="off" switch-state-2="off" state-setting-2="off" state-2="off" />
</devices>

To manually add a device to the device file, follow these steps:

 

  1. Open an SSH console to the IzoT Server and enter the commands in the following steps.

  2. Stop the IzoT Server:
    izot_stop
  3. If the $IZOT/etc/lonbridge/instances/devices.xml device file does not exist, create it by entering the following command:
    sudo printf '<devices>\n\n</devices>' > $IZOT/etc/lonbridge/instances/devices.xml
  4. Edit the $IZOT/etc/lonbridge/instances/devices.xml device file and add the following line at the end before </devices>:
  5. <device nid="{macID}" id="{deviceIdx}" fblock="-1" type="unknown" name="Unknown Device" brand="IzoT" active="false" />
    	
    Where {macID} is the MAC ID (also known as the Neuron ID) of the device and {deviceIdx} is the index of the device that starts from 0. Each index must be unique. This device index is not the same as the Device ID shown in the Device Browser.

    For example, to add a device with a “BAAACCCCBBA0” MAC ID at index 0, enter the following line:
    <device nid=" BAAACCCCBBA0" id="0" fblock="-1" type="unknown" name="Unknown Device" brand="IzoT" active="false" /> 
  6. Restart the IzoT Server:
    izot_restart