1.0.1 • Published 1 year ago
@townsen/homebridge-ds18b20 v1.0.1
homebridge-ds18b20
Features
- Supports the graphing feature of the Eve app for trends
- This plugin can read a 1-wire device attached to the host running Homebridge or it can
use the
rgpiolibrary to read a device attached to a remote host.
Installation
Setup the Hardware
First ensure you have a 4.7k pullup resistor wired between the data pin and positive supply. Then choose which GPIO pin to use. The default is GPIO 4 but since I2C devices are often connected in that area I use header pins 14(gnd), 15(gpio 22) and 17 (3v3).
Setup Homebridge
Do the following on the computer that will run the HomeBridge instance:
- Install Homebridge using
npm install -g homebridge Install this plugin
npm install -g @townsen/homebridge-ds18b20Alternatively, if you want to run the plugin directly from this repository then in this plugin directory issue:npm install sudo npm link
Update your configuration file - see below for an example
- If accessing remote devices install
python3-rgpio
Setup the OS hosting the 1-wire devices
- Setup the correct GPIO pin in
/boot/config.txtwithdtoverlay=w1-gpio,gpiopin=22. - Alternatively dynamically load it with
dtoverlay w1-gpio gpiopin=22 pullup=0 - If this will be accessed from a remote HomeBridge instance install the
rpgiodpackage and edit the/etc/defaults/rgpiodfile to remove the-loption. For security you may add the option-n <homebridge-instance-ip>to the configuration.
Configuration
accessory: "DS18B20"name: descriptive namerefresh: Optional, time interval for refreshing data in seconds, defaults to 30 seconds.device_id: the 1-wire device identifier. Find this by listing the directory/sys/bus/w1/devices.host: the remote host to use. Default is 'localhost'.rgpiodmust be installed on the remote host and thepython3-rgpiolibrary on the homebridge instance.recordpath: Optional, used by the fakegato history code to create an on-disk record of the observations. This preserves the history in case of a restart, and can be used to extract the observations manually. Thenameand thedevice_idare used to name the sensor device, which is then used as the filename.
Simple Configuration
{
"bridge": {
"name": "DS18B20",
"username": "CB:22:33:E2:CE:31",
"port": 51826,
"pin": "033-44-254"
},
"accessories": [
{
"accessory": "DS18B20",
"name": "Water Temperature",
"refresh": 60,
"device_id": "28-3c01d6077a95"
},
{
"accessory": "DS18B20",
"name": "Pool Temperature",
"host": "piz-pool-temperature",
"refresh": 60,
"device_id": "28-6a8e491f64ff"
}
],
"platforms": []
}Debugging
Set the DEBUG variable to DS18B20 to get messages in the HomeBridge console
License
MIT