0.2.0 • Published 4 years ago

homebridge-sensor-th v0.2.0

Weekly downloads
23
License
ISC
Repository
github
Last release
4 years ago

实现传感器接到树莓派,并接入 homebridge 的功能.

可以获取到当前传感器的温度和湿度数据:

img

img

参数

支持的传感器(type)

Adafruit_Python_DHT 支持三种传感器:

  • DHT11(type=11)
  • DHT22(type=22)
  • AM2302(type=22)

通过 homebridge config.json 中的 type 进行选择(默认为 11)

引脚(source)

传感器信号源接到树莓派上的引脚.

通过 homebridge config.json 中的 source 进行选择,遵循 GPIO/BCM 方式(默认为 4)

检测类型 (dataType)

通过 homebridge config.json 中的 dataType 进行选择,默认为 0(温度)

  • 0 温度

  • 1 湿度

使用方法

安装 homebridge-sensor-th

# 使用 npm

npm i -g homebridge-sensor-th

配置 homebridge 的 config.json中的 accessories

如下:

{
  "accessories": [
    {
      "accessory": "SensorPlugin",
      "name": "湿度检测",
      "dataType": 1,
      "source": "选填,默认为 4",
      "type": "选填,可选值 11 | 22 | 2302 默认为 11"
    },
    {
      "accessory": "SensorPlugin",
      "name": "温度检测",
      "dataType": 0,
      "source": "选填,但是与上面的配置必须相同",
      "type": "选填,但是与上面的配置必须相同"
    }
  ]
}
0.2.0

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.2

4 years ago

0.1.2-test

4 years ago

0.1.4

4 years ago

0.1.3

4 years ago

0.1.5

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago