XBee Smart Plug
XBee Smart Plug
The Smart Plug provides XBee on/off control over a standard power outlet. The Smart Plug is a wall-wart type device which plugs into any 3 prong wall outlet. It has a switched outlet on its side and status LEDs and a light sensor on its front. In addition, it has an internal current sensor for measuring the current sourced to any attached device.
XBee Smart Plug Terminals
The terminals on a Smart Plug Device provide control over the switched outlet, and they provide status information. The "1" input terminal takes
off input values and uses them to switch the switched outlet on and off. The "1S" status terminal emits
off values which indicate the state of the switched outlet. The "current_AMPs" output emits a number indicating the number of AMPs the switched outlet is sourcing. The "light_Lux" output emits a number indicating the amount of light, in Lux, that is shining on the light sensor.
XBee Smart Plug Device Installation
To install a Smart Plug Device, the device must first be joined into an existing XBee network (which the Virtual Wiring system is a part of). Once joined, create a Smart Plug Device by running the SmartPlug Script. The parameters for the SmartPlug Script are:
port_location: the port_location of whatever wired device the system owns in the network (usually a Coordinator's port_location). If there is only one XBee network for the system, this parameter can be set to nil.
address: the 64 bit network address of the device. The network address uniquely identifies the XBee device. Typically, the address is found on a paper (serial number) label affixed to the device. It is also in the device's SH and SL registers, and it shows up in the return value from an AT ND (node detect) command. Network addresses are written in hex, are 16 characters long, and often look like "0013a200406b0263". To enter a network address as an address parameter, start with the 16 character network address, strip off any leading zeros, and append "0x" to the beginning.
To add a Smart Plug Device with ID "smart_plug" and network address 0013a200406b0263 to a system connected to a Coordinator Device at port_location "/dev/ttyUSB0", run the SmartPlug Script with the following parameters:
Note: the port_location parameter can be set to nil, if the system owns only one XBee network.