# @townsen/homebridge-ds18b20

> DS18B20 Plugin for Homebridge: https://github.com/nfarina/homebridge"

Latest version **1.0.1** (published 2024-06-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @townsen/homebridge-ds18b20
pnpm add @townsen/homebridge-ds18b20
yarn add @townsen/homebridge-ds18b20
bun add @townsen/homebridge-ds18b20
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2024-06-11 |
| First published | 2022-01-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=10.17.0 |
| Dependencies | 3 |
| Unpacked size | 11 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | townsen |
| Maintainers | townsen |
| Keywords | homebridge-plugin, bosch, maxim, ds18b20, temperature, humidity, pressure, sensor |

## Links

- npm: https://www.npmjs.com/package/@townsen/homebridge-ds18b20
- Repository: https://gitlab.com/townsen/homebridge-ds18b20
- Homepage: https://gitlab.com/townsen/homebridge-ds18b20#readme
- Issues: https://gitlab.com/townsen/homebridge-ds18b20/issues
- npm.io page: https://npm.io/package/@townsen/homebridge-ds18b20

## Dependencies (3)

- [debug](https://npm.io/package/debug.md) >=4.1.1
- [moment](https://npm.io/package/moment.md) >=2.24.0
- [fakegato-history](https://npm.io/package/fakegato-history.md) >=0.5.6

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2024-06-11
- 1.0.0 — 2024-05-22
- 0.9.8 — 2022-03-09
- 0.9.7 — 2022-02-01
- 0.9.6 — 2022-02-01
- 0.9.5 — 2022-02-01
- 0.9.4 — 2022-01-30
- 0.9.3 — 2022-01-30
- 0.9.2 — 2022-01-26
- 0.9.1 — 2022-01-26

## README

# 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 `rgpio` library 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:

1. Install Homebridge using `npm install -g homebridge`
2. Install this plugin `npm install -g @townsen/homebridge-ds18b20`
   Alternatively, if you want to run the plugin directly from this repository then
   in this plugin directory issue:

    npm install
    sudo npm link

3. Update your configuration file - see below for an example
4. If accessing remote devices install `python3-rgpio`

### Setup the OS hosting the 1-wire devices

1. Setup the correct GPIO pin in `/boot/config.txt` with `dtoverlay=w1-gpio,gpiopin=22`.
2. Alternatively dynamically load it with `dtoverlay w1-gpio gpiopin=22 pullup=0`
3. If this will be accessed from a remote HomeBridge instance install the `rpgiod` package
   and edit the `/etc/defaults/rgpiod` file to remove the `-l` option. For security you
   may add the option `-n <homebridge-instance-ip>` to the configuration.

## Configuration

* `accessory`: "DS18B20"
* `name`: descriptive name
* `refresh`: 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'. `rgpiod` must be installed on
  the remote host and the `python3-rgpio` library 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.  The `name` and the `device_id` are used to name the sensor device,
  which is then used as the filename.

Simple Configuration

```json
{
  "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

---
_Source: https://npm.io/package/@townsen/homebridge-ds18b20 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
