1.0.0 • Published 8 years ago
homebridge-lightsensor-analog v1.0.0
homebridge-lightsensor-analog
Analog light sensor service for Homebridge
Reads from an analog-to-digital SPI chip using mcp-spi-adc, and represents the value as an ambient light sensor light level.
Installation
- Install Homebridge using
npm install -g homebridge
- Install this plugin
npm install -g homebridge-lightsensor-analog
- Update your configuration file - see below for an example
Connect an MCP SPI ADC chip to your computer, and a photodiode or other analog light sensor to one of the channels of the ADC.
Configuration
accessory
: "LightSensorAnalog"name
: descriptive namechip
: one of: MCP3002, MCP3004, MCP3008, MCP3202, MCP3204, MCP3208, or MCP3304channel
: channel number of ADC chip to read fromoptions
: options for mcp-spi-adcscale
: value to multiply the raw 0.0 - 1.0 analog value withoffset
: value to add to the raw 0.0 - 1.0 analog value
Homebridge expects a value in lux, you can adjust scale
and offset
to calibrate the analog sensor value (currently only linearly) empirically.
Example configuration:
"accessories": [
{
"accessory": "LightSensorAnalog",
"name": "Kitchen",
"chip": "MCP3304",
"channel": 7,
"options": {
"speedHz": 20000
},
"scale": 500,
"offset": 0
}
]
See also
- 10der/homebridge-LightSensor: currently blank (in progress?), created 2016/09/17
- lagunacomputer/homebridge-CurrentAmbientLightLevel(https://github.com/lagunacomputer/homebridge-CurrentAmbientLightLevel]: HTTP for sensors
- lucavb/homebridge-bh1750: plugin for I2C-based bh1750 digital light sensor
License
MIT
1.0.0
8 years ago