DHT11, DHT22 Sensors


#66

You can highlight it all and click the pre-formatted text button at the top of the box. It looks like </>


#67

I’m also looking forward to the dht support. Have been using a pi for 3 years with mrtg and thingspeak with several dht22’s and just came across and immediately installed cayenne!
Jon Q


#68

As I am new to the all stuff, based on your experiences, do you think that with Arduino, Cayenne and DHT_Cay.txt code can I hang several (multiple) DHT22 sensors and make a viable automation project? I need several DHT sensors in the project.
Bestes, pls add me on the list.
thanks


#69

Welcome to Cayenne!

There are 2 options now. You can use Arduino and make custom code to send the values to the dashboard (scroll up for that) or you can also now do it with the Pi using MQTT. http://www.cayenne-mydevices.com/docs/#bring-your-own-thing-api


#70

Hi Adam,

I hope you are very well, I saw that now we can add the DHT11 with Raspberry Pi, that is a great knew, I tried to find some videos that help me to understand how could I add this client (DHT11), do you know if there is any information about it?.

Thanks in advance.


#71

Hey, so, i know I’m the 1billionth person to ask… But will this be supposed under “sensors” soon? I REALLY would love this and it seems like you’ve been saying its in the pipeline for a long while…


#72

It’s possible now with Node-RED/MQTT. I’ll make something up here in the next few days. If you want to try to figure it out on your own here is all the info you will need:


So install the node-red-contrib-dht-sensor node then put that node in to an mqtt output node with all your Cayenne credentials and it will show up on the dashboard.


#73

@craigfrancissfco @israelmx @copperslov @jquiros @chris.wood @woz @pallottamrc @jrustling @mikejunor_cayenne @ravter

Hi guys,

@adam created a great tutorial for adding the DHT11 / 22 sensor to the Cayenne dashboard using the Cayenne MQTT API. I realize this is probably not what you had in mind, but you can now read data from your DHT11 sensors, and send the values to Cayenne from the Raspberry Pi! I’m hoping you will give it a try, here is the post you can reference:


#74

@Christian @lobopt @somnet @roccodegrazia @linux87s @glasermrk @adytoader @raspberrycoulis @marthinus.swanepoel @mase.hacker

Hi guys,

@adam created a great tutorial for adding the DHT11 / 22 sensor to the Cayenne dashboard using the Cayenne MQTT API. I realize this is probably not what you had in mind, but you can now read data from your DHT11 sensors, and send the values to Cayenne from the Raspberry Pi! I’m hoping you will give it a try, here is the post you can reference:


#75

@hiren.shah @nicolasortuzari @faljeremy @brucecalder @timwellington @mat_oldaker @will @Mr.Allen @dzachareas @maurifree

Hi guys,

@adam created a great tutorial for adding the DHT11 / 22 sensor to the Cayenne dashboard using the Cayenne MQTT API. I realize this is probably not what you had in mind, but you can now read data from your DHT11 sensors, and send the values to Cayenne from the Raspberry Pi! I’m hoping you will give it a try, here is the post you can reference:


#76

Hi Bestes,

Great, thank you so much, just wonder if with the MQTT API we could see the widgets in iOS?, I know for sure that the web page will be, but not sure in the app, because I was playing with the ESP8266 and the MQTT API does not shows the widget in iOS but in the web does.

Have a great evening.


#77

You’re right, the apps do not have support for mqtt yet. It’s coming.


#79

Another DHT11 request please!

Thanks,

And IFTTT support please.


#80

Adding myself to the list. Did my best to use other examples for manually adding dht11, but I’m afraid that creating Arduino sketches is a bit above my head. Would be nice if the dht could just be added in the dashboard the way I added my actuators - that was pretty straightforward.


#81

Hi, thank you for the great apps.
Connected like a charm, even do not ask a password :slight_smile:

Could you please send docs for put custom data from DHT22 to Cayenne?

Thank you.


#82

This Works with NodeMcu with DHT22
You will have to remove all the / from the #include lines, I put them in so it displays here correctly. This is not my code, I pulled it out of another sketch after hours of pulling my hair out.

/#define CAYENNE_PRINT Serial // Comment this out to disable prints and save space

/#include <ESP8266WiFi.h>
/#include “CayenneDefines.h”
/#include “BlynkSimpleEsp8266.h”
/#include “CayenneWiFiClient.h”
/#include <DHT.h>
/#define DHTTYPE DHT22
/#define DHTPIN 4 //NODEMCU D2
/#define VIRTUAL_PIN V1
/#define VIRTUAL_PIN V2

DHT dht(DHTPIN, DHTTYPE, 20);
float humidity, temp_c;

long lastTempUpdate = 0;

// Cayenne authentication token. This should be obtained from the Cayenne Dashboard.
char token[] = “TOKEN”;

// Your network name and password.
char ssid[] = “YOUR SSID HERE”;
char password[] = “WIFI PASSWORD”;

IPAddress ip;

void setup()
{

Serial.begin(230400);
Cayenne.begin(token, ssid, password);
dht.begin();

}

// ==============( Void Loop ) ====================================

void loop() {
Cayenne.run();
unsigned long now = millis();
if ( now - lastTempUpdate > 60000 ) {

gettemperature();
Serial.print("Sending temperature:");
Serial.println(temp_c);
Serial.print("Sending humidity:");
Serial.println(humidity);
lastTempUpdate = now;

}

}

void gettemperature() {

humidity = dht.readHumidity();          // Read humidity (percent)
temp_c = dht.readTemperature();     // Read temperature as Farenheight


// Check if any reads failed and exit early (to try again).
if (isnan(humidity) || isnan(temp_c)) {
  Serial.println("Failed to read from DHT sensor!");
  return;
}
String TempC;
String Humid;
TempC = String(temp_c);
Humid = String(humidity);
Cayenne.virtualWrite(V1, temp_c);
Cayenne.virtualWrite(V2, humidity);

}


#83

Requesting support as well. Love Cayenne!!!


#84

Hey @lpporres1, what device are you using? It is possible, just takes a bit of coding.


#85

Seems like cayenne development for new sensors has been abandoned. DHT11 support is still not available, hopefully a Cayenne alternative is in the works!


#86

Welcome to Cayenne @marekorzeszko!

I’m not exactly sure where the agent is headed right now. Maybe @bestes can answer better? It will be released as open source very soon (if not already) but I’m not sure exactly what that means for us. Will we be able to add extensions and new sensors/actuators? If so the community can work at whatever pace we want to add sensors.

Regardless of the agent itself, there are currently 2 ways to get data from a DHT11 sensor on to your dashboard, Arduino and the MQTT API. I cover both ways here (MQTT through the Raspberry Pi):