Skip to content

Commit

Permalink
"XMTZC05HMKG" - Added information when value is steady and when the m…
Browse files Browse the repository at this point in the history
…easurement is the current measurement. My scale sends the measurement every scan interval and only flips that one bit.
  • Loading branch information
reifl committed Oct 19, 2024
1 parent a566bc3 commit dfdc6ab
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions src/devices/XMTZC05HMKG_json.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
const char* _XMTZC05HMKG_json = "{\"brand\":\"Xiaomi\",\"model\":\"Mi Body Composition Scale\",\"model_id\":\"XMTZC02HM/XMTZC05HM\",\"tag\":\"05\",\"condition\":[\"servicedata\",\"index\",1,\"22\",\"|\",\"servicedata\",\"index\",1,\"2a\",\"|\",\"servicedata\",\"index\",1,\"62\",\"|\",\"servicedata\",\"index\",1,\"6a\",\"&\",\"servicedata\",\"=\",26,\"&\",\"uuid\",\"contain\",\"181b\"],\"properties\":{\"weighing_mode\":{\"decoder\":[\"bit_static_value\",\"servicedata\",1,2,\"person\",\"object\"]},\"unit\":{\"decoder\":[\"static_value\",\"kg\"]},\"weight\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",22,4,true,false],\"post_proc\":[\"/\",200]},\"impedance\":{\"condition\":[\"servicedata\",3,\"6\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",18,4,true,false]}}}";
const char* _XMTZC05HMKG_json = "{\"brand\":\"Xiaomi\",\"model\":\"Mi Body Composition Scale\",\"model_id\":\"XMTZC02HM/XMTZC05HM\",\"tag\":\"05\",\"condition\":[\"servicedata\",\"index\",1,\"22\",\"|\",\"servicedata\",\"index\",1,\"2a\",\"|\",\"servicedata\",\"index\",1,\"20\",\"|\",\"servicedata\",\"index\",1,\"62\",\"|\",\"servicedata\",\"index\",1,\"6a\",\"&\",\"servicedata\",\"=\",26,\"&\",\"uuid\",\"contain\",\"181b\"],\"properties\":{\"weighing_mode\":{\"decoder\":[\"bit_static_value\",\"servicedata\",1,2,\"person\",\"object\"]},\"is_steady\":{\"decoder\":[\"bit_static_value\",\"servicedata\",2,1,false,true]},\"is_current_measurement\":{\"decoder\":[\"bit_static_value\",\"servicedata\",2,3,true,false]},\"unit\":{\"decoder\":[\"static_value\",\"kg\"]},\"weight\":{\"decoder\":[\"value_from_hex_data\",\"servicedata\",22,4,true,false],\"post_proc\":[\"/\",200]},\"impedance\":{\"condition\":[\"servicedata\",3,\"6\"],\"decoder\":[\"value_from_hex_data\",\"servicedata\",18,4,true,false]}}}";
/*R""""(
{
"brand":"Xiaomi",
"model":"Mi Body Composition Scale",
"model_id":"XMTZC02HM/XMTZC05HM",
"tag":"05",
"condition":["servicedata", "index", 1, "22", "|", "servicedata", "index", 1, "2a", "|", "servicedata", "index", 1, "62", "|", "servicedata", "index", 1, "6a", "&", "servicedata", "=", 26, "&", "uuid", "contain", "181b"],
"condition":["servicedata", "index", 1, "22", "|", "servicedata", "index", 1, "2a", "|", "servicedata", "index", 1, "20", "|", "servicedata", "index", 1, "62", "|", "servicedata", "index", 1, "6a", "&", "servicedata", "=", 26, "&", "uuid", "contain", "181b"],
"properties":{
"weighing_mode":{
"decoder":["bit_static_value", "servicedata", 1, 2, "person", "object"]
},
"is_steady":{
"decoder": ["bit_static_value", "servicedata", 2, 1, false, true]
},
"is_current_measurement":{
"decoder": ["bit_static_value", "servicedata", 2, 3, true, false]
},
"unit":{
"decoder":["static_value", "kg"]
},
Expand All @@ -24,14 +30,22 @@ const char* _XMTZC05HMKG_json = "{\"brand\":\"Xiaomi\",\"model\":\"Mi Body Compo
}
})"""";*/

const char* _XMTZC05HMKG_json_props = "{\"properties\":{\"weighing_mode\":{\"unit\":\"string\",\"name\":\"weighing_mode\"},\"unit\":{\"unit\":\"string\",\"name\":\"unit\"},\"weight\":{\"unit\":\"kg\",\"name\":\"weight\"},\"impedance\":{\"unit\":\"Ω\",\"name\":\"impedance\"}}}";
const char* _XMTZC05HMKG_json_props = "{\"properties\":{\"weighing_mode\":{\"unit\":\"string\",\"name\":\"weighing_mode\"},\"is_steady\":{\"unit\":\"bool\",\"name\":\"is_steady\"},\"is_current_measurement\":{\"unit\":\"bool\",\"name\":\"is_current_measurement\"},\"unit\":{\"unit\":\"string\",\"name\":\"unit\"},\"weight\":{\"unit\":\"kg\",\"name\":\"weight\"},\"impedance\":{\"unit\":\"Ω\",\"name\":\"impedance\"}}}";
/*R""""(
{
"properties":{
"weighing_mode":{
"unit":"string",
"name":"weighing_mode"
},
"is_steady": {
"unit": "bool",
"name": "is_steady"
},
"is_current_measurement": {
"unit": "bool",
"name": "is_current_measurement"
},
"unit":{
"unit":"string",
"name":"unit"
Expand Down

0 comments on commit dfdc6ab

Please sign in to comment.