Skip to content

OSNP Temperature Sensor

briksoftware edited this page Apr 28, 2014 · 1 revision

A Temperature Sensor is a device dedicated to temperature measurement only. A Temperature Sensor must report the temperature using a single unit of measure out of all defined ones. Conversion, if needed, will be performed at the Hub.

Supported Commands:

  • Configure
  • Get Data

Get Data Options

No options are supported, this device always returns the current temperature.

Get Data Response fields

These fields are encoded inside the Data (0xA1) field of the Get Data response.

Tag Length Description
0x80 1 Unit of Measure
0x81 1-n Divider
0x82 1-n Temperature

The Unit of Measure field is encoded on one byte, and can have one of the following values:

Value Description
0x00 Kelvin
0x01 Celsius
0x02 Fahrenheit

The Divider field is a signed integer of arbitrary length. The Hub should divide the Temperature by this value to obtain the final Temperature value.

The Temperature field is a signed integer of arbitrary length indicating the measured temperature.

For example, to report a temperature of 32.57 Celsius, a device would send a Divider of 100 and a Temperature of 3257. Using this kind of encoding frees the device from having to do floating point calculations and allows to interface devices with any kind of measurement precision.

Supported Configuration Options

Tag Length Description
0x82 1-n Calibration Offset

The Calibration Offset option sets the offset the Temperature Sensor should apply to its Temperature field in the Get Data response. This field must be formatted exactly in the same way the device formats it as response to the Get Data command.

For example, if the device encodes its Temperature value on 2 bytes with the precision of 0,1 degrees Celsius, and we want to offset its output by +0,5 degrees, this field would be encoded as: 0x82 0x02, 0x00, 0x05. Conversely, if we want to adjust by -1,2 degrees, the field would be encoded as: 0x82 0x02, 0xFF, 0xF4.

Clone this wiki locally