Why a weather station?
One my search for a easy to install, easy to use and inexpensive way to understand the climate condition in my house I deceided to buy a wireless 433 MHz weather station from Conrad which is originally from Honeywell. Up to 5 wireless temperature & humidity sensors, one outside remote anemometer, and one outside remote rain gauge collect data which is send via USB to a java-program to the PC. This booklet gives a nice overview of the weather stations function. The full documentation and the software is available on the German Conrad product page „Funk-Wetterstation TE831X„.
Collecting the data on the PC with the weather station
Overview of Weather Station Software
The included software allows to view all information similar to the weather station itself on your PC screen. You can set up how often data should be stored and transmitted to the PC from 5 minute to 1 day intervall. The data is logged in two files in the program folder RECORDS.TXT
and RAINBASE.DAT
.
The weather station PC software is written mostly in java. Only the access to the USB-interface comes with a windows DLL and the start of the application uses a windows EXE.
Most important classes: Data.java, DataTh.java, Display.java
Most important java-variables:
temperature values i=0-5: temp[i], tempMax[i], tempMin[i], dewPoint[i], tempTrend[i]
humidity values i=0-5: humid[i], humidTrend[i]
others pressure, windChill, windSpeedCurrent, windBearing, rainHour
Adding the prefix in_
in front of a variable gives you all values in SI-units except windSpeed
in knots. Without the prefix the values are stored according to your installation set-up for units.
Adding code for the pachube feed
In the class Data.java
I added two objects
PApplet parent; DataOut pachubeDataOut;
and two methods :
public boolean initPachube(){ int i; pachubeDataOut = new DataOut(parent, "http://www.pachube.com/api/2056.xml", "[my_pachube_key_removed_here]"); for(i=0; i<=5; i++){ pachubeDataOut.addData(i,"temperature channel "+i, 15, +34); pachubeDataOut.setUnits(i, "Celsius","C","derivedSI"); } pachubeDataOut.addData(6,"temperature wind chill", -15, +34); pachubeDataOut.setUnits(6, "Celsius","C","derivedSI"); for(i=0; i<=5; i++){ pachubeDataOut.addData(7+i,"humidity channel "+i, 10, 79); pachubeDataOut.setUnits(7+i, "Percent","%","contextDependentUnits"); } pachubeDataOut.addData(13,"pressure", 950, 1049); pachubeDataOut.setUnits(13, "hecto Pascal","h Pa","derivedSI"); pachubeDataOut.addData(14,"wind speed", 0, 100); pachubeDataOut.setUnits(14, "kilo Meter per Hour","km/h","derivedSI"); pachubeDataOut.addData(15,"wind bearing", 0, 360); pachubeDataOut.setUnits(15, "Grad","","contextDependentUnits"); pachubeDataOut.addData(16,"rain in last hour", 0, 100); pachubeDataOut.setUnits(16, "mili meter","mm","basicSI"); return true; }
public void updatePachube(){ int response; int i;for(i=0; i<=5; i++){ pachubeDataOut.update(i, in_temp[i]); } pachubeDataOut.update(6, in_windChill); for(i=0; i<=5; i++){ pachubeDataOut.update(7+i, in_humid[i]); } pachubeDataOut.update(13, in_pressure); //converting wind speed from knots to km/h pachubeDataOut.update(14, in_windSpeedCurrent * 1.6093F); pachubeDataOut.update(15, in_windBearing); pachubeDataOut.update(16, in_rainHour); // updatePachube() updates by an authenticated PUT HTTP request response = pachubeDataOut.updatePachube(); // should be 200 if successful; 401 if unauthorized; 404 if feed doesn't exist System.out.println("pachube: " + response); }
The init-method is called form the Constructor and the update follows each data collection cycle. Just download the full java-file.
Decompiling and patching the original software
The most difficult part is the extraction of the java files it the Weather.jar
-library, adding the above code and the library for pachube eeml.jar
and the library for processing core.jar
. This documentation is still due…
Data Logging at Pachube
Pachube added the nice feature of logging data for more than 24h and pachube’s user dhunter developed the nice application Pachube Viz for comfortable visualization. Here you see one of the humidity curves collected by the weather station:
You can access all feeds with the typical pachube feed interface.