Skip to content

Commit

Permalink
Plugin_046: Xiron: don't reject the measurement if humidity is > 100%
Browse files Browse the repository at this point in the history
My sensor may return humidity over 100% when the sensor is saturated,
clamp the data instead of rejecting the measurement altogether.

Also mention that "Xiron" protocol is known as "Nexus-TH" in other
sources
  • Loading branch information
anarsoul committed Aug 5, 2024
1 parent ef56edf commit fc23cb7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions RFLink/Plugins/Plugin_046.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* E = Always 1111 ?
* F = Always 0000 0000 ?
*
* Xiron Message Format:
* Xiron Message Format (also known as Nexus-TH in other sources):
* 01101110 10 00 000011101101 1111 00110011
* AAAAAAAA BB CC DDDDDDDDDDDD EEEE FFFFFFFF
* ID ?? Ch Temperature ? Humidity
Expand Down Expand Up @@ -178,8 +178,10 @@ boolean Plugin_046(byte function, const char *string)
}
if (type == 1)
{
if (humidity > 100)
return false; // humidity out of range ( > 100)
// Certain sensors return humidity higher than 100% when the sensor is saturated.
// Clamp it to 99% instead of rejecting the measurement
if (humidity >= 100)
humidity = 99;
}
//==================================================================================
// Output
Expand Down

0 comments on commit fc23cb7

Please sign in to comment.