.. _xbee-sensor:

********************
XBee Sensor
********************

.. index:: devices; xbee; XBee Sensor

Overview
====================
A Dia Driver for the XBee Sensor /L/T(/H) Product.

.. note:: This is not the driver for the :ref:`watchport` product.


Configuration
====================

A typical sensor configuration block looks like this::

    - name: lth0
      driver: devices.xbee.xbee_devices.xbee_sensor:XBeeSensor
      settings:
          xbee_device_manager: <instance name>
          extended_address: <sensor address>
          sample_rate_ms: 10000

Settings
--------------------

xbee_device_manager (required)
    The name of an XBeeDeviceManager instance to manage this device.

extended_address (required)
    The extended address of the XBee Sensor device you would like to
    monitor.

sleep (optional, default: False)
    True/False; Setting which determines if the device should sleep
    between samples. 

sample_rate_ms (required)
    The sample rate of the XBee adapter in milliseconds.

trace (optional, default: On)
    On/Off; On prints trace line for every sample, Off turns this function off.

awake_time_ms (optional, default: 1000)
    How many milliseconds should the device remain awake after waking
    from sleep.

sample_predelay (optional, default: 125)
    How long (in milliseconds) to wait after waking up from sleep
    before taking a sample from the inputs.

humidity_present (optional, default: False)
    Force a sensor which has not been detected to have humidity
    capability present to report that humidity capability is present. Writes the
    devices DD device-type value as a side effect so that it will
    report itself as having humidity capability in the future.

Channels
====================

light (Get, type: float, units: brightness)
    Provides a unit-less measure of light intensity.  The full range of
    values is from zero to 1200 with a roughly linear proportional
    correspondence from zero to 10,000 lux.  However, the value is not
    calibrated to correspond to any fixed standard.

temperature (Get, type: float, units: C)
    Temperature as measured by the sensor.

humidity (Get, type: float, units: %)
    Relative humidity measured by the sensor.  This channel will only
    be present for devices that indicate support for humidity, or have
    the ``humidity_present`` setting enabled.  

low_battery (Get, type: bool)
    Low battery indication condition as reported by the adapter.
