Add support for Ecowitt WH43 AQI device to fineoffset.c #3195
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 forbattery_ok
to be 1.2, instead of capped at 1.0.