Skip to content

Commit

Permalink
Fix rain ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
ProfBoc75 committed Aug 10, 2024
1 parent c7a69fc commit 46b83e3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/devices/vevor_7in1.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ static int vevor_7in1_decode(r_device *decoder, bitbuffer_t *bitbuffer)
int wind_raw = ((b[8] << 8) | b[9]) - 257; // need to remove 0x0101.
float speed_kmh = wind_raw / 10.0f ; // wind_raw / 36.0f for m/s
int gust_raw = b[10];
float gust_kmh = gust_raw / 1.5f ; // gust_raw / 1.5f / 3.6f m/s
float gust_kmh = gust_raw / 1.5f ; // gust_raw / 1.5f / 3.6f m/s, + 0.1f offset from the weather display
int direction_deg = (((b[11] & 0x0f) << 8) | b[12]) - 257; // need to remove 0x101.
int rain_raw = ((b[13] << 8) | b[14]) - 257; // need to remove 0x101.
float rain_mm = rain_raw * 0.43f;
float rain_mm = rain_raw * 0.233f; // calculation is 0.43f but display is 0.5f
int uv_index = (b[15] & 0x1f) - 1;
int light_lux = ((b[16] << 8) | b[17]) - 257; // need to remove 0x0101.
int lux_multi = (light_lux & 0x8000) >> 15;
Expand Down Expand Up @@ -164,8 +164,8 @@ static char const *const output_fields[] = {
r_device const vevor_7in1 = {
.name = "Vevor Wireless Weather Station 7-in-1",
.modulation = FSK_PULSE_PCM,
.short_width = 90,
.long_width = 90,
.short_width = 87,
.long_width = 87,
.reset_limit = 9000, // keep message is one row because of a possible gap in the message if LUX values are zeros
.decode_fn = &vevor_7in1_decode,
.fields = output_fields,
Expand Down

0 comments on commit 46b83e3

Please sign in to comment.