Sensor package provides drivers for various sensors.
Temperature interface provides functions to read temperature.
Returns the temperature in kelvin.
REST API : GET /devices/name/sensor/temperature/k
Returns the temperature in celsius.
REST API : GET /devices/name/sensor/temperature/c
Returns the temperature in fahrenheit.
REST API : GET /devices/name/sensor/temperature/f
from webiopi.devices.analog import TMP102
tmp = TMP102(...) # setup a TMP102 I2C Temperature sensor
# or
from webiopi import deviceInstance
tmp = deviceInstance("tmp") # retrieve device named "tmp" in configuration file
tmp.getKelvin()
tmp.getCelsius()
tmp.getFahrenheit()
HTTP GET /devices/tmp/sensor/temperature/k
HTTP GET /devices/tmp/sensor/temperature/c
HTTP GET /devices/tmp/sensor/temperature/f
Pressure interface provides functions to read atmospheric pressure.
Returns the pressure in pascal.
REST API : GET /devices/name/sensor/pressure/pa
Returns the pressure in hecto pascal.
REST API : GET /devices/name/sensor/pressure/hpa
Returns the pressure at sea level in pascal.
REST API : GET /devices/name/sensor/pressure/sea/pa
Returns the pressure at sea level in hecto pascal.
REST API : GET /devices/name/sensor/pressure/sea/hpa
from webiopi.devices.analog import BMP085
bmp = BMP085(...) # setup a BMP085 I2C Pressure sensor
# or
from webiopi import deviceInstance
bmp = deviceInstance("bmp") # retrieve device named "bmp" in configuration file
bmp.getHectoPascal()
bmp.getHectoPascalAtSea()
HTTP GET /devices/bmp/sensor/pressure/hpa
HTTP GET /devices/bmp/sensor/pressure/sea/hpa
Luminosity interface provides functions to measure light.
Returns the luminosity in lux.
REST API : GET /devices/name/sensor/luminosity/lx
from webiopi.devices.analog import TSL2561
tsl = TSL2561(...) # setup a TSL2561 I2C Luminosity sensor
# or
from webiopi import deviceInstance
tsl = deviceInstance("tsl") # retrieve device named "tsl" in configuration file
tsl.getLux()
HTTP GET /devices/tmp/sensor/luminosity/lx
Distance interface provides functions to measure distances.
Returns the distance in millimeter.
REST API : GET /devices/name/sensor/distance/mm
Returns the distance in millimeter.
REST API : GET /devices/name/sensor/distance/cm
Returns the distance in millimeter.
REST API : GET /devices/name/sensor/distance/in
from webiopi.devices.analog import TSL2561
vcn = VCNL4000(...) # setup a VCNL4000 I2C Luminosity sensor
# or
from webiopi import deviceInstance
vcn = deviceInstance("vcn") # retrieve device named "vcn" in configuration file
vcn.getMillimeter()
HTTP GET /devices/tmp/sensor/distance/mm