2.1.1 • Published 3 years ago

homebridge-sht3x v2.1.1

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
3 years ago

homebridge-sht3x

Build Status NPM Version JavaScript Style Guide

Homebridge plugin for the Sensirion SHT3x humidity and temperature sensor. Uses raspi-node-sht31 to communicate with the device and fakegato-history to show historical data graphs when using the Eve app.

Breakout boards for the SHT31 sensor are available from Adafruit or AliExpress.

This plugin has only been tested on a Raspberry Pi, but should work with any Linux-based board supported by i2c-bus, including C.H.I.P., BeagleBone, or Intel Edison.

Refer to your board documentation for instructions on how to enable the I²C interface and how to connect an I²C device. The i2c-bus documentation also includes a few examples.

Installation

Node.js v10.17.0 or greater is required.

This assumes Homebridge has already been installed. If not, see the Homebridge documentation for more information.

If using Homebridge Config UI X, search for the plugin in the Plugin screen, and install it from there. Otherwise you can install it manually with:

sudo npm install -g homebridge-sht3x

Configuration

If using Homebridge Config UI X, you can configure the plugin from the graphical settings editor, or you can edit the config.json file manually.

The minimal accessory configuration, containing only the required attributes, is as follows:

"accessories": [
  {
   "accessory": "SHT3x",
   "name": "SHT31"
  }
]

See config-sample.json for a complete example.

The following table shows the list of supported configuration parameters:

AttributeDescription
accessoryAccessory name registered with Homebridge. Has to be "SHT3x".
nameDisplay name for the sensor. Can be anything you want.
addressI²C address of the sensor. Possible values are "0x44" (default) or "0x45".
busI²C bus number. Defaults to 1. See the I²C setup section below.
intervalTime interval at which the device is polled, in seconds (default: 60).
historyOptions passed to fakegato-history as an object. Empty by default.

I²C setup

The default I²C bus number (1) is used by most Raspberry Pi models, except for the early Raspberry Pi Model B (256MB) which uses bus number 0. On other boards, available buses typically are 1 or 2 on a C.H.I.P., 0, 1, or 2 on a BeagleBone, and 1 or 6 on an Intel Edison. Consult your board documentation for details, and run i2cdetect -l to list the available I²C buses.

The I²C address for the SHT3x sensor is 0x44 by default, or 0x45 if the ADDR pin is connected to logic high.

History persistence

By default Fakegato saves history to memory, and data not yet downloaded by the Eve app will be lost when Homebridge is restarted. If you want to save history to disk instead, add the following line to the accessory configuration:

"history": {"storage": "fs"}

Data will be saved in a JSON file located in the Homebridge directory (~/.homebridge by default unless redefined with the -U option) and read upon restart. In order to store the file elsewhere, use the path option:

"history": {
  "storage": "fs",
  "path": "/tmp"
}

See the Fakegato documentation for more information on available options.

Also note that Fakegato will automatically average out measurements and log an entry to history every 10 minutes. If you want the history feature to work reliably and avoid holes in the data, interval should be no more than 600.

Screenshots

2.1.1

3 years ago

2.1.0

3 years ago

2.0.0

4 years ago

1.1.7

4 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago