pimatic / rfcontroljs

nodejs modul with protocol support for different 433mhz switches and weather stations for the RFControl Arduino library.
GNU General Public License v3.0
49 stars 54 forks source link

added support for conrad rsl switches #104

Open thejatom opened 8 years ago

thejatom commented 8 years ago

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 commented 8 years ago

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 commented 8 years ago

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