ankurp/homebridge-pi-thermostat

type of dht as configurable

Closed this issue · 6 comments

Could you make the line of 184 --> dhtSensor.read(configurableVariabl, [...] ???
I need to change the value to 11

Hello, I need to read the temperature from a DHT11 sensor. How can I do?

@ankurp, here you can find my error: [2019-1-7 19:44:17] [Pi Thermostat] ERROR Getting temperature

This would require a code change. I can made a change so that it is configuration driven.

I have updated the package in this repo to version 1.2.0. You can set "dhtSensorType": 11 in your config file for this accessory and it will use 11 in dhtSensor.read(11, ...

Hello @ankurp , I reinstalled your package and modified the config file as suggested but still having the same error:

[Pi Thermostat] ERROR Getting temperature

I tested myself the sensor and node-dht-sensor module with this code:

const sensor = require('node-dht-sensor');

setInterval(() => {
    readSensor(11,4) 
}, 3000);


function readSensor(model,pin){
    sensor.read(model, pin, function(err, temperature, humidity) {
        if (!err) {
            console.log("Temp is: ", temperature, "Hum is: ", humidity)
            
        }
        else {
            console.log(err, temperature, humidity)
            
        }
    })
}

This is working as expected.

Can you help me to troubleshoot your plugin? Am I doing something wrong?
I often use DHT11 sensor with other homebridge modules and I have no issues.

Thanks in advance.

Hello @ankurp

I have dht22 and I also have some time - [Pi Thermostat] ERROR Getting temperature.

Can You help with this error ?

Thank You