-
Notifications
You must be signed in to change notification settings - Fork 43
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
Proposal for dual 'stabilised' recognition change for XMTZC04HM - WIP #71
Conversation
XMTZC04HM stabilised change to 'a'
XMTZC05HM Stabilised addition with 'a'
Thanks, @DigiH for all these research, unfortunately my XMTZC04HM doesn't advertize the
and even several minutes after. |
@1technophile oh yes, in that case a nested OR for 2 and a, together with the AND for the 181d uuid is needed. It's a bit of a shame, as the 2 is so easily missable unless you have a very short TimeBtwRead, whereas the a, at least on my XMTZC05HM with its 20 minutes broadcasting, give a definite hit every time. Did you ever get a firmware update for your version of the XMTZC04HM through the Mi Fit app? Or depending on its hardware revision it might not have ever received one. It could also be interesting to make a posting in the community forum to collect the experiences of other XMTZC04HM or XMTZC05HM users, together with their firmware versions and stabilised 2 a behaviour. Another thing which always confuses me when communicating about the scales is the weird naming convention when not using the model IDs. {"id":"","mac_type":0,"name":"MI SCALE2","manufacturerdata":"5701c8478cd2fc19","rssi":-79,"servicedata":"22e632b2...","servicedatauuid":"0x181d","brand":"Xiaomi","model":"Miscale_v1","model_id":"XMTZC04HM","unit":"kg","weight":XX} Since there are/were version 1 (XMTZC01HM and XMTZC02HM) and version 2 of both the Mi (weight only) Scale (XMTZC04HM) and the Mi Body Composition Scale (XMTZC05HM) https://www.china-gadgets.de/xiaomi-waagen/ it might be an idea to clarify the model names with any future decoder updates. So PR on hold until a nested AND OR condition is possible. I don't suppose two decoders with the different conditions would already work, because of the identical model_id?!? As I'm still working on the advanced XMTZC05HM features decoder implementation I will also implement a stabilised condition there once it's done, to avoid unstabilised messages coming through. I even had to fix an unstabilised 8 in the tests of this PR which I unintentionally added when reimplementing the impedance feature ;) Thanks |
I don't think so I updated it. So this maybe the cause for the different behaviour, in all the case I would like to keep it with the current firmware.
Indeed, maybe more accessible than in github,github is also quite well indexed
Agreed, the name comes from the scale itself for info.
Interesting, never heard about the first 2
Can you take a look to CGG1_json.h, it may be the way to go |
Sorry, I meant naming the "model":"Miscale_v1" which is being assigned in the decoder, something like "Mi Weight Scale" (XMTZC04HM) and "Mi Body Scale" (drop the Composition to make it shorter for XMTZC05HM)
Oh yes, that looks very interesting! Thanks! It might also be a solution for my current stumbling block with cramming all the new XMTZC05HM features for both kg and lbs into one decoder. |
Not the best late night activity ;) but definitely gave me a lot more insight. It would be great if you @1technophile could test the DigiH-StabilisationChanges branch with your always 2 MiScale, and @kgarrels with his preferred a behaviour, still seeing the occasional 2 messages as well now. Thanks |
WIP - on hold. Going through the XMTZC04HM manual, it has the same possibility of differentiating between weighing people or small objects/items as I'm implementing in the XMTZC05HM decoder.
Wouldn't it be good to also have this in the XMTZC04HM decoder? @kgarrels @1technophile or anyone else with a XMTZC04HM on for testing to see which servicedata index indicates this difference? My assumption form the XMTZC04HM servicedata I've seen so far would be the same index 1 showing 6 (kg weighing) or 7 (lbs weighing) for objects.
Thanks |
Hey, for 9.55kg, With an object with the lcd ON
After some time With or without the object lcd OFF
|
thanks, so actually on index 0, where 2/a indicate a person. @github768484 would you be willing to run a lbs test? |
Yes. I'll test with lbs @DigiH |
* Extension of XMTZC05HM decoder - Pulled back _XMTZC05HM_json_props into XMTZC05HM_json.h - Renamed "model" to more informative "Mi_Body_Scale_2" and amended description in the docs - Implemented 'stabilised' only decoding for XMTZC05HM - Recognises 'stabilised' 2 (scale display active) and 'stabilised' a (scale display deactivated) to guarantee published 'stabilised' reading without the need for very short TimeBtwRead - New 'mode' attribute to indicate if the weighing was of a person or a small object (if this option is activated in the scale's settings). This allows filtering to only record person readings in HA or openHAB - Only publish 'impedance' attribute if the weighing of a person was done barefoot and the impedance value could be recorded correctly I suspect that the 1st version of the Mi Body Composition Scale (XMTZCO2HM) is also being recognised by this decoder, and should therefor be mentioned in the docs and published model_id, but without confirmation of XMTZCO2HM owners this is just a guess. * Extend properties conditions to use "OR" and "AND" params. * XMTZC05HM final adjustments Small final changes • abbreviated property names for discovery inclusion • decoder back to original _XMTZC05HM_json Co-authored-by: h2zero <[email protected]>
XMTZC04HM stabilised change to 'a'
Latest XMTZC04HM Update for testing with multiple model and property conditions. Should work fine with kg for person and object weighing recognition, possibly also already for lbs, but needs testing and for person and object lbs weighings.
…/decoder into DigiH-StabilisationChanges
Oops, that wasn't the intention, but cleaner start to continue this here |
Proposal for 'stabilised' recognition change for XMTZC04HM and introduction of 'stabilised' check for XMTZC05HM
While discussing with @kgarrels and his initial recognition issues for logging the issue
1technophile/OpenMQTTGateway#1166 (comment)
and reading postings on the community forum, like
https://community.openmqttgateway.com/t/looking-for-tips-on-more-reliable-mi-scale-weight-reading/1743/3
and with my own testing with the XMTZC05HM, where even with my TimeBtwRead set to 20 seconds often misses the '2' stabilised reading, and finding the following for the XMTZC05HM
I would like to propose this change for the XMTZC04HM scale and to introduce it for XMTZC05HM to avoid many misses of "2" stabilised weighings.
The only difference is that the scales transmits the "a" service data for 20 minutes (XMTZC05HM), so depending on the TimeBtwRead setting this will produce multiple identical publishings. While this wouldn't be an issue for myslef or @kgarrels, it could introduce issues for others. But since the service data is identical in all those messages it could also easily be filtered.
I'd like to use this PR for discussing this change and how others with XMTZC04HM or XMTZC05HM feel about this.
Thanks
Checklist: