@@ -158,19 +158,20 @@ Samples with 0.9V battery (last 3 samples contain 1 manual bucket tip)
158
158
Ecowitt WS68 Anemometer protocol with LUX and UVI.
159
159
160
160
Units confirmed from issue #2786 , LUX and UVI decoding as well
161
+ Wind unit and decoding from issue #2867
161
162
162
163
Data layout:
163
164
164
- TYPE:8h ?8h ID:16h LUX:16h BATT:8h WDIR_H: 4h 4h8h8h WSPEED:8h WDIR_LO :8h WGUST:8h UVI:8h CRC:8h SUM:8h ?8h4h
165
+ TYPE:8h ?8h ID:16h LUX:16h BATT:8d ?1b WGUST_MSB:1b WDIR_MSB:1b WSPEED_MSB:1b ? 4h 8h8h WSPEED_LSB:8d WDIR_LSB :8h WGUST_LSB:8d UVI:8h CRC:8h SUM:8h ?8h4h
165
166
166
167
Some payloads:
167
- TT ??II II LLLL BB WDH WS WDLWG UV CCSS ???
168
- 68 0000 c5 0000 4b 0f ffff 00 5a 00 00 d0af 104
169
- 68 0000 c5 0000 4b 0f ffff 00 b4 00 00 79b2 102
170
- 68 0000 c5 0000 4b 0f ffff 7e e0 94 00 75ec 102
171
- 68 0000 c5 0000 4b 2f ffff 00 0e 00 00 8033 208
172
- 68 0000 c5 000f 4b 0f ffff 00 2e 00 00 d395 108
173
- 68 0000 c5 0107 4b 0f ffff 00 2e 00 02 a663 100
168
+ TT ?? IIII LLLL BB WH f ffff WSL WDL WGL UV CC SS ???
169
+ 68 00 00c5 0000 4b 0 f ffff 00 5a 00 00 d0 af 104
170
+ 68 00 00c5 0000 4b 0 f ffff 00 b4 00 00 79 b2 102
171
+ 68 00 00c5 0000 4b 0 f ffff 7e e0 94 00 75 ec 102
172
+ 68 00 00c5 0000 4b 2 f ffff 00 0e 00 00 80 33 208
173
+ 68 00 00c5 000f 4b 0 f ffff 00 2e 00 00 d3 95 108
174
+ 68 00 00c5 0107 4b 0 f ffff 00 2e 00 02 a6 63 100
174
175
175
176
*/
176
177
@@ -333,9 +334,9 @@ static int ambientweather_whx_decode(r_device *decoder, bitbuffer_t *bitbuffer)
333
334
int light_lux = lux_raw * 10 ;
334
335
int batt = b [6 ];
335
336
int batt_ok = batt > 0x20 ; // wild guess
336
- int wspeed = b [ 10 ];
337
- int wgust = b [ 12 ] ;
338
- int wdir = ((b [7 ] & 0x20 ) >> 5 ) | b [ 11 ] ;
337
+ int wspeed = (( b [ 7 ] & 0x10 ) << 4 ) | ( b [ 10 ]) ;
338
+ int wdir = (( b [ 7 ] & 0x20 ) << 3 ) | ( b [ 11 ]) ;
339
+ int wgust = ((b [7 ] & 0x40 ) << 2 ) | ( b [ 12 ]) ;
339
340
int uvindex = (int )b [13 ] * 0.1f ;
340
341
char extra [4 ];
341
342
snprintf (extra , sizeof (extra ), "%02x%01x" , b [16 ], b [17 ] >> 4 );
@@ -346,9 +347,9 @@ static int ambientweather_whx_decode(r_device *decoder, bitbuffer_t *bitbuffer)
346
347
"id" , "" , DATA_INT , id ,
347
348
"battery_raw" , "Battery Raw" , DATA_INT , batt ,
348
349
"battery_ok" , "Battery OK" , DATA_INT , batt_ok ,
349
- "light_lux" , "Lux" , DATA_FORMAT , "%u lux" , DATA_INT , light_lux ,
350
- "wind_avg_km_h " , "Wind Speed" , DATA_FORMAT , "%.1f km/h " , DATA_DOUBLE , ( double ) wspeed ,
351
- "wind_max_km_h " , "Wind Gust" , DATA_FORMAT , "%.1f km/h " , DATA_DOUBLE , ( double ) wgust ,
350
+ "light_lux" , "Lux" , DATA_FORMAT , "%u lux" , DATA_INT , light_lux ,
351
+ "wind_avg_m_s " , "Wind Speed" , DATA_FORMAT , "%.1f m/s " , DATA_DOUBLE , wspeed * 0.1f ,
352
+ "wind_max_m_s " , "Wind Gust" , DATA_FORMAT , "%.1f m/s " , DATA_DOUBLE , wgust * 0.1f ,
352
353
"uvi" , "UVI" , DATA_INT , uvindex ,
353
354
"wind_dir_deg" , "Wind dir" , DATA_INT , wdir ,
354
355
"data" , "Extra Data" , DATA_STRING , extra ,
@@ -377,8 +378,8 @@ static char const *const output_fields[] = {
377
378
"rain_mm" ,
378
379
"uvi" ,
379
380
"light_lux" ,
380
- "wind_avg_km_h " ,
381
- "wind_max_km_h " ,
381
+ "wind_avg_m_s " ,
382
+ "wind_max_m_s " ,
382
383
"wind_dir_deg" ,
383
384
"data" ,
384
385
"radio_clock" ,
0 commit comments