Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type of dht as configurable #10

Closed
nosekmarek opened this issue Oct 25, 2018 · 6 comments
Closed

type of dht as configurable #10

nosekmarek opened this issue Oct 25, 2018 · 6 comments

Comments

@nosekmarek
Copy link

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

@eliomex55
Copy link

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

@eliomex55
Copy link

eliomex55 commented Jan 7, 2019

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

@ankurp
Copy link
Owner

ankurp commented Jan 7, 2019

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

@ankurp
Copy link
Owner

ankurp commented Jan 7, 2019

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
Copy link

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
Copy link

Codi878 commented Jan 16, 2019

Hello @ankurp

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

Can You help with this error ?

Thank You

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants