Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Ecowitt WH43 AQI device to fineoffset.c #3195

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

andrewjmcginnis
Copy link

The code for the Fine Offset/Ecowitt WH0290/WH41/PM25 devices in fineoffset.c is this close to supporting the similar Ecowitt WH43. The WH43 uses a longer packet, due in part to the 24-bit ID (vs 8-bit for the 41), which then offsets the location of the battery, PM2.5/10, CRC, and Checksum bits. Both device classes use the same aa2dd4 preamble, and identify themselves in the first byte b[0], allowing logic to parse and determine what and where the data resides in the packet.
I changed the code to allow the WH41 or WH43 to be decoded, as well as adding some output that is present in the WH45 and WH46 decoders, namely the power source, via ext_power. Battery status logic also was changed, as the existing code allowed for battery_ok to be 1.2, instead of capped at 1.0.

-I changed some of the existing output for data_make(), to include the ext_power source Yes/No, since that is used in the WH45 and WH46 decoders, and is equally present in the WH41/43 data.
-I changed battery_ok to use the 45/46 format of MIN(battery_bars * 0.2f, 1.0f) because it was otherwise allowing for a Battery Level reading of 1.2 when plugged into USB power.
-Family is present in the current WH0290 decoder data_make(), so I left it here as well. The WH45/46 decoders do not show it, so it may be removed/commented out.
-I changed the "um" to "µm" because the micro character is easy enough to add as the proper prefix.
-I left "Estimate of 10µm Coarse Particulate Matter" as-described, because I do not know that the WH41 has changed it's sensor from the Honeywell to the Sensirion SPS30. The WH45/46 decoders don't call the PM10 of the SPS30 an estimation in the way that the Honeywell is here, with the comment

"The sensor specification statement states that PM10 values are estimated from distribution profiles of PM0.5, PM1.0, and PM2.5 measurements, but the datasheet does a specify a degree of accuracy for the values unlike the Honeywell sensor."
moved the -R code lines to another branch (WH43_-R)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant