ebaauw / homebridge-rpi

Homebridge plugin for Raspberry Pi.
Apache License 2.0
311 stars 19 forks source link

Feature request: support for temperature sensors #47

Closed j0ha closed 4 years ago

j0ha commented 4 years ago

Hi! I think it would be another great feature to have the support for temperature/humanity sensors like the DHT11 or DHT22 with logging in the eve history.

ebaauw commented 4 years ago

I’ll be happy to, if you can tell me how these connect and how to read them.

j0ha commented 4 years ago

Yes sure. The DHT11 and the DHT22 are both sensors which can communicate with the raspberry or other devices like an arduino over a serial signal. The serial signal is delivered by one single pin. The sensor has there additional pins of which are two for powering and one is not in use. More details here: https://components101.com/dht11-temperature-sensor

The best way to retrieve the data from the sensor is the BCM2835 library, which is often used by other homebridge plugins which retrieve data from this sensor kind such as homebridge-dht

ebaauw commented 4 years ago

Don’t think I can integrate these. A single-pin serial protocol requires a precise clock, which cannot be done in NodeJS. The library you mention contains C++ code to read the sensor. I don’t want to use that for homebridge-rpi.

Why cannot you use homebridge-dht?

ebaauw commented 2 years ago

See #139.