mirror of
https://github.com/merbanan/rtl_433.git
synced 2026-04-23 11:07:09 -04:00
Add protocol definition for oregon scientific THN129 temp only sensor. (#469)
* Add protocol definition for oregon scientific THN129 temp only sensor. * remove temp F line from decoder output.
This commit is contained in:
committed by
Benjamin Larsson
parent
0bb4ac244f
commit
49a0885ec5
@@ -19,6 +19,7 @@
|
||||
#define ID_WGR800 0x1984
|
||||
#define ID_WGR968 0x3d00
|
||||
#define ID_UV800 0xd874
|
||||
#define ID_THN129 0xcc43 // THN129 Temp only
|
||||
|
||||
float get_os_temperature(unsigned char *message, unsigned int sensor_id) {
|
||||
// sensor ID included to support sensors with temp in different position
|
||||
@@ -351,6 +352,22 @@ static int oregon_scientific_v2_1_parser(bitbuffer_t *bitbuffer) {
|
||||
|
||||
// RF Clock message ??
|
||||
}
|
||||
return 1;
|
||||
} else if (sensor_id == ID_THN129) {
|
||||
if ((validate_os_v2_message(msg, 137, num_valid_v2_bits, 12) == 0)) {
|
||||
float temp_c = get_os_temperature(msg, sensor_id);
|
||||
data = data_make(
|
||||
"time", "", DATA_STRING, time_str,
|
||||
"brand", "", DATA_STRING, "OS",
|
||||
"model", "", DATA_STRING, "THN129",
|
||||
"id", "House Code", DATA_INT, get_os_rollingcode(msg, sensor_id),
|
||||
"channel", "Channel", DATA_INT, get_os_channel(msg, sensor_id), // 1 to 5
|
||||
"battery", "Battery", DATA_STRING, get_os_battery(msg, sensor_id) ? "LOW" : "OK",
|
||||
"temperature_C", "Celcius", DATA_FORMAT, "%.02f C", DATA_DOUBLE, temp_c,
|
||||
NULL);
|
||||
data_acquired_handler(data);
|
||||
}
|
||||
|
||||
return 1;
|
||||
} else if (num_valid_v2_bits > 16) {
|
||||
if(debug_output) {
|
||||
|
||||
Reference in New Issue
Block a user