Official Ruuvi App: Weather Station

I have some error in decode function. Why?

The line 4 should have a bit-shift, possibly

var uTemp = (((decoded64[2] & 127) << 8) | decoded64[3]);

Edit: something more is done on the line below, it would be helpful if the entire code would be shown.
That line might be for taking the sign bit, in which case it should be

var uTemp = (((decoded64[2] & 127) >> 7) &1;

var decoded64=msg.payload;
//node.log(decoded64)
var humidity = decoded64[1] * 0.5;
var uTemp = ((decoded64[2] & 127) >> 7) & 1;
var temp = tempSign === 0 ? uTemp/256.0 : -1 * uTemp/256.0;
var tempF = temp * 1.8 + 32;
var air_pressure = ((decoded64[4] << 8) + decoded64[5]) + 50000;
var res={};
res.Temp=temp;
res.Humidity=humidity;
res.Pressure=air_pressure/100;
//node.log( res)
var newMsg={ payload: res };
return newMsg;

It’s a little bit strange for me. I don’t understand lack of var tempSign, and the temp, humidity and pressure format. Temp has decimal place, or it is only integer? THX for help! Nem

Please refer to specification for details (and let me know if something needs clarification!)

I think the code has a bug in temperature sign handling, the way ruu.vi site does it is:

var uTemp = (((decoded[3] & 127) << 8) | decoded[2]);
var tempSign = (decoded[3] >> 7) & 1;
var temp = tempSign === 0 ? uTemp/256.0 : -1 * uTemp/256.0;
var tempF = temp * 1.8 + 32;

var decoded64=msg.payload;
//node.log(decoded64)
var humidity = decoded64[1] * 0.5;
var uTemp = (((decoded64[2] & 127) << 8) | decoded64[3]);
var tempSign = (decoded64[2] >> 7) & 1;
var temp = tempSign === 0 ? uTemp/256.0 : -1 * uTemp/256.0;
var tempF = temp * 1.8 + 32;
var air_pressure = ((decoded64[4] << 8) + decoded64[5]) + 50000;
var res={};
res.Temp=temp;
res.Humidity=humidity;
res.Pressure=air_pressure/100;
//node.log( res)
var newMsg={ payload: res };
return newMsg;

This is the working version. I work now fractional part of temperature reading.

Please note that the base weather station does not send fractions

Ok, thx! I hope the future versions can send fraction values, too!

Another use case that may be relevant to other users.

An app to decode the sensor data with no Wifi connection.

Which language is this please?

Node-red function, javascript. From message 45.

Temp measurements off by 10-15C in sauna. Is there a way to calibrate the sensors?

You tried this node, or just trying theory?

The firmware itself would require recompiling for calibration on sensor side, it would be possible to do the calibration on receiver software but we don’t have a ready-made example of this yet.

The temperature error sounds quite large, tags have been used to log saunas with reasonable results: https://graphs.2kgwf.fi/dashboard/db/sauna . Are you sure the error is not caused by tag placement (near stove or ventilation shaft, perhaps?)

Did you let sensor to acclimate before trusting the data? Conditions in plastic containers changes slowly comparing to outer conditions.

The weather station app just received a major update:

  1. Added support to RuuviTag basic
  2. Added β€œsensortag”-mode, where tag sends all sensor readings (including accelerometer) in binary. Switch between modes by pressing β€œB”. Green led blinks in URL mode, Red led blinks in sensortag mode.
  3. Added random identifier character to URL mode. This should help people to identify the tag if they have several tags nearby.

Please check out the update at https://ruu.vi/setup , and let me know if you find any issues.

Format of both messages seems to have changed?
I will check if I can see what has changed, but it would be great if you could document new formats.

The sensortag format should be exactly same, please let me know if there is some issue.

The URL mode now has β€œ4” as first byte, and and ID character at the end of URL. Documentation is on Github.

The format β€œ4” seems to now also include temperature fractions. Is that intentional?

The format includes the fractions, however the fraction should always read as β€œ0”.

I seem to be now getting fraction parts different than 0.
For me, that is fine, I do not need to write new code to access the format β€œ3”.

2017-04-17 1:32:09 (1492435929) beacon=makuuhuone (fbe375e302e0), t=21 C, P=1021 hPa, r=26 %
2017-04-17 1:32:09 (1492435929) beacon=vierashuone (e013b4dff14b), t=23.046875 C, P=1021 hPa, r=20 %

Just wanted to let you know in case this was not intentional