Skip to content

Conversation

@thejatom
Copy link

No description provided.

@thejatom
Copy link
Author

thejatom commented Jul 26, 2016

yeah, the weather station - the sample code to send DHT11 sensor data from arduino to pimatic is:

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();

void setup() {
  Serial.begin(9600);
  mySwitch.enableTransmit(3);
}

void loop() {
  char os[37];
  prepareMsg(265,61,os);
  char *o = os;
  mySwitch.send(o);
  delay(5000);
}

void prepareMsg(int temp, int hum, char\* buf) {
  String tempstr=String(temp,BIN);
  int len=tempstr.length();
  for (int i=0; i<(12-len); i++) { tempstr="0"+tempstr; }
  String humstr=String(hum,BIN);
  len=humstr.length();
  for (int i=0; i<(8-len); i++) { humstr="0"+humstr; }
  String outstr=String("0101100011011100"+tempstr+humstr);
  outstr.toCharArray(buf,37);
}

@mwittig
Copy link
Contributor

mwittig commented Jul 28, 2016

Can you please add a few links to the products you have been using. Would also be noce if can describe the setup for temperature/humidity sensor in some more detail. If I understand this correctly your setup sends temperature/humidity from homeduino to a RSL device?!

@thejatom
Copy link
Author

thejatom commented Sep 3, 2016

No, in fact I have arduino with rf transmitter and dht-11 sensor.
And just wanted to transmit temp/humidity to pimatic but I could not find any predefined protocol that can be transmitted by arduino

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

Successfully merging this pull request may close these issues.

2 participants