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

More than one #4

Open
javr97 opened this issue Oct 22, 2021 · 5 comments
Open

More than one #4

javr97 opened this issue Oct 22, 2021 · 5 comments

Comments

@javr97
Copy link

javr97 commented Oct 22, 2021

I would like to add more than one sensor, how could I do it?

@jburhenn
Copy link
Contributor

I'd suggest you try editing the cayenne_dht.plugin file to add the additional sensors at the bottom with init_args set to use the correct sensor and pin values. Something like:

[DHT Temperature2]
enabled=true
channel=2
module=cayenne_dht
class=CayenneDHT
init_args={"sensor": <sensor number>, "pin": <pin number>}
read=get_temperature

[DHT Humidity2]
inherit=DHT Temperature2
enabled=true
channel=3
read=get_humidity

I'm not 100% sure if that will work since I haven't tested it but that would be a place to start.

@javr97
Copy link
Author

javr97 commented Oct 22, 2021

I already tried that way and it didn't work

@jburhenn
Copy link
Contributor

Did you modify the channels and section names so they don't conflict? If so, I'm not sure what else to suggest.

@javr97
Copy link
Author

javr97 commented Oct 23, 2021

exactly as your answer shows

@jburhenn
Copy link
Contributor

Do you get a specific error in the /var/log/myDevices/cayenne.log file when you try it?

I guess you could try duplicating the cayenne-plugin-dht folder and modifying the file and class names so they don't conflict but that seems like a bit of overkill and I'm not sure if it would work. Another option would be to try and make a test app with the underlying Adafruit_DHT package and see if that allows multiple DHT sensors in one app. If it doesn't than it probably won't work in the Cayenne agent.

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

2 participants