ankurp / homebridge-pi-thermostat

Homebridge Plugin to make Raspberry Pi into Thermostat
https://www.npmjs.com/package/homebridge-pi-thermostat
39 stars 23 forks source link

type of dht as configurable #10

Closed nosekmarek closed 5 years ago

nosekmarek commented 6 years ago

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

eliomex55 commented 5 years ago

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

eliomex55 commented 5 years ago

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

ankurp commented 5 years ago

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

ankurp commented 5 years ago

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, ...

eliomex55 commented 5 years ago

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.

Codi878 commented 5 years ago

Hello @ankurp

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

Can You help with this error ?

Thank You