Support Sinocare CW286 bluetooth bathroom scales #861
Merged
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.
This PR adds support for the Sinocare CW266 Digital bluetooth bathroom scale.
This scale appears to be similar in operation to the scale added in #706 with regard to the contents of this comment which basically says the scale only uses the manufacturer data field to broadcast data using bluetooth's Advertising mechanism and does not offer a proper service for accessing these values. The same is true for this scale and I suspect the reason for this is that this sinocare scale has a rather short timeout of about 10 seconds before it turns off, making it hard for a user to connect and get the data before it turns itself off.
Also from that thread it appears that this is the second scale to operate this way
To my knowledge and the best of my wireshark/deduction skills based on the wiki (which to me seems like it may be a little out of date regarding the process of getting the bluetooth packet capture) this scale only supports advertising weight values. Because i couldnt find any solid evidence for the data format, this (and a checksum) is all i have implemented, but my limited testing seems to suggest that it works well enough.
Because of a lack of reliable indication that the scale is "done" measuring (i.e. users weight has stabilized) this implementation checks for this based on receiving a sequence of many identical weight values in a row. I admit this is not ideal and should be updated once better information about the operation of this scale is known.
Hopefully this explains the bulk of how this scale operates, let me know if you have questions or need me to make any changes!