Page 1 of 1

Anyone have a list of JSON commands

Posted: 15 Apr 2020, 19:43
by jbarr
I can certainly take the time to reverse engineer several completed watch faces that I like, but it would be nice to have a definitive list of JASON commands available and useful for the Mi Band 4 watch faces.

Suggestiosns?

Re: Anyone have a list of JSON commands

Posted: 16 Apr 2020, 14:41
by Jackall Digital
This is not my effort, I got it on the forum and it requires the MiBandWFTool1.4.2, if you want to use other tools the syntax may be a little bit different (ie. instead of "Steps->Number" it's "Steps->Step"). I added a couple of //comments and I think this file has most of the things. I only ran across ImageGoal (vice versa) property in one of the watch faces but forgot what the correct syntax is.

Feel free to add to this post if I'm missing anything.

You can also search "Jackall Digital how to makemi band 4 watch face" where I have a total of 5 videos on how to make them.

Code: Select all

{
  "Background": {
    "Image": {
      "X": 0,
      "Y": 0,
      "ImageIndex": 0
    }
  },
  "Time": {
    "Hours": {
      "Tens": {
        "X": 12,
        "Y": 34,
        "ImageIndex": 1,
        "ImagesCount": 3
      },
      "Ones": {
        "X": 62,
        "Y": 34,
        "ImageIndex": 4,
        "ImagesCount": 10
      }
    },
    "Minutes": {
      "Tens": {
        "X": 12,
        "Y": 102,
        "ImageIndex": 14,
        "ImagesCount": 6
      },
      "Ones": {
        "X": 62,
        "Y": 102,
        "ImageIndex": 20,
        "ImagesCount": 10
      }
    },
    "Seconds": {
      "Tens": {
        "X": 0,
        "Y": 102,
        "ImageIndex": 30,
        "ImagesCount": 10
      },
      "Ones": {
        "X": 10,
        "Y": 102,
        "ImageIndex": 30,
        "ImagesCount": 10
      }
    },
    "DelimiterImage": {
      "X": 57,
      "Y": 65,
      "ImageIndex": 10
    }
  },
  "Activity": {
    "Steps": {
      "Number": {
        "TopLeftX": 19,
        "TopLeftY": 202,
        "BottomRightX": 54,
        "BottomRightY": 213,
        "Alignment": "TopLeft",
        "Spacing": 1,
        "ImageIndex": 30,
        "ImagesCount": 10
      },
      "StepsImageIndex": 38
    },
    "Calories": {
      "Number": {
        "TopLeftX": 19,
        "TopLeftY": 183,
        "BottomRightX": 59,
        "BottomRightY": 195,
        "Alignment": "TopLeft",
        "Spacing": 1,
        "ImageIndex": 30,
        "ImagesCount": 10
      },
      "SuffixImageIndex": 103
    },
    "Pulse": {
      "Number": {
        "TopLeftX": 19,
        "TopLeftY": 218,
        "BottomRightX": 59,
        "BottomRightY": 230,
        "Alignment": "TopLeft",
        "Spacing": 1,
        "ImageIndex": 30,
        "ImagesCount": 10
      },
      "NoDataImageIndex": 32
    },
    "Distance": {
      "Number": {
        "TopLeftX": 60,
        "TopLeftY": 218,
        "BottomRightX": 116,
        "BottomRightY": 229,
        "Alignment": "Right",
        "Spacing": 1,
        "ImageIndex": 30,
        "ImagesCount": 10
      },
      "SuffixImageIndex": 92,
      "DecimalPointImageIndex": 91
    }
  },
  "Date": {
    "MonthAndDay": {          //use separate or oneline, don't use both
      "Separate": {
        "Month": {
          "TopLeftX": 98,
          "TopLeftY": 76,
          "BottomRightX": 118,
          "BottomRightY": 92,
          "Alignment": "Center",
          "Spacing": 0,
          "ImageIndex": 30,
          "ImagesCount": 10
        },
        "Day": {
          "TopLeftX": 76,
          "TopLeftY": 34,
          "BottomRightX": 96,
          "BottomRightY": 50,
          "Alignment": "Center",
          "Spacing": 1,
          "ImageIndex": 30,
          "ImagesCount": 10
        }
      },
      "OneLine": {
        "Number": {
          "TopLeftX": 65,
          "TopLeftY": 63,
          "BottomRightX": 115,
          "BottomRightY": 77,
          "Alignment": "TopRight",
          "Spacing": 2,
          "ImageIndex": 11,
          "ImagesCount": 10
        },
        "DelimiterImageIndex": 21
      },
      "TwoDigitsMonth": true,
      "TwoDigitsDay": true
    },
    "WeekDay": {
      "X": 85,
      "Y": 115,
      "ImageIndex": 61,
      "ImagesCount": 21
    },
    "DayAmpm": {
      "X": 95,
      "Y": 145,
      "ImageIndexAMCN": 82,
      "ImageIndexPMCN": 83,
      "ImageIndexAMEN": 0,
      "ImageIndexPMEN": 0
    }
  },
  "StepsProgress": {    //there is also "ImageGoal" or "GoalImage" property that can be used under StepsProgress. It's used to display the daily achievement
    "Linear": {
      "StartImageIndex": 84,
      "Segments": [
        {
          "X": 10,
          "Y": 206
        },
        {
          "X": 20,
          "Y": 206
        },
        {
          "X": 30,
          "Y": 206
        },
        {
          "X": 40,
          "Y": 206
        },
        {
          "X": 50,
          "Y": 206
        },
        {
          "X": 60,
          "Y": 206
        },
        {
          "X": 70,
          "Y": 206
        },
        {
          "X": 80,
          "Y": 206
        },
        {
          "X": 90,
          "Y": 206
        },
        {
          "X": 100,
          "Y": 206
        }
      ]
    },
    "Circle": {
      "CenterX": 63,
      "CenterY": 203,
      "RadiusX": 29,
      "RadiusY": 29,
      "StartAngle": 0,
      "EndAngle": 360,
      "Width": 3,
      "Color": "0xFFFFFF"
    },
    "SolidImage": {
      "Start": {
        "X": 2,
        "Y": 150
      },
      "End": {
        "X": 117,
        "Y": 150
      },
      "ImageIndex": 58,
      "Background": {
        "X": 2,
        "Y": 150,
        "ImageIndex": 59
      }
    }
  },
  "Status": {
    "DoNotDisturb": {
      "Coordinates": {
        "X": 4,
        "Y": 9,
        "BoxWidth": 17,
        "Alignment": "Left",
        "Order": 1
      },
      "ImageIndexOn": 94,
      "ImageIndexOff": 94
    },
    "Lock": {
      "Coordinates": {
        "X": 21,
        "Y": 9,
        "BoxWidth": 17,
        "Alignment": "Left",
        "Order": 1
      },
      "ImageIndexOn": 95,
      "ImageIndexOff": 95
    },
    "Bluetooth": {
      "Coordinates": {
        "X": 38,
        "Y": 9,
        "BoxWidth": 12,
        "Alignment": "Left",
        "Order": 1
      },
      "ImageIndexOn": 96,
      "ImageIndexOff": 96
    },
    "Battery": {
      "BatteryConfig": {
        "BoxWidth": 0,
        "Alignment": 0,
        "Order": 0
      },
      "Text": {
        "TopLeftX": 65,
        "TopLeftY": 11,
        "BottomRightX": 85,
        "BottomRightY": 21,
        "Alignment": "TopRight",
        "Spacing": 1,
        "ImageIndex": 97,
        "ImagesCount": 10
      },
      "Icon": {
        "X": 94,
        "Y": 9,
        "ImageIndex": 107,
        "ImagesCount": 9
      }
    }
  },
  "AnalogDialFace": {    //make clock hands usin 2D points (x,y) - the center of the clock hands is point (0,0) 
    "Hours": {
      "OnlyBorder": false,
      "Color": "0xFFFFFF",
      "Center": {
        "X": 60,
        "Y": 120
      },
      "Shape": [
        {
          "X": 3,
          "Y": 0
        },
        {
          "X": 11,
          "Y": 0
        },
        {
          "X": 13,
          "Y": -3
        },
        {
          "X": 43,
          "Y": -3
        },
        {
          "X": 45,
          "Y": 0
        },
        {
          "X": 43,
          "Y": 4
        },
        {
          "X": 13,
          "Y": 4
        },
        {
          "X": 11,
          "Y": 1
        },
        {
          "X": 3,
          "Y": 1
        }
      ],
      "CenterImage": {
        "X": 56,
        "Y": 116,
        "ImageIndex": 60
      }
    },
    "Minutes": {
      "OnlyBorder": false,
      "Color": "0xFFFFFF",
      "Center": {
        "X": 60,
        "Y": 120
      },
      "Shape": [
        {
          "X": 3,
          "Y": 0
        },
        {
          "X": 11,
          "Y": 0
        },
        {
          "X": 13,
          "Y": -3
        },
        {
          "X": 57,
          "Y": -3
        },
        {
          "X": 59,
          "Y": 0
        },
        {
          "X": 57,
          "Y": 4
        },
        {
          "X": 13,
          "Y": 4
        },
        {
          "X": 11,
          "Y": 1
        },
        {
          "X": 3,
          "Y": 1
        }
      ],
      "CenterImage": {  //image that goes over that clock hands, like a "cap" or "lid", you only need one center image per analogdialface
        "X": 56,
        "Y": 116,
        "ImageIndex": 60
      }
    },
    "Seconds": {
      "OnlyBorder": false,
      "Color": "0xFDA917",
      "Center": {
        "X": 60,
        "Y": 120
      },
      "Shape": [
        {
          "X": -11,
          "Y": -1
        },
        {
          "X": 59,
          "Y": -1
        },
        {
          "X": 59,
          "Y": 0
        },
        {
          "X": -11,
          "Y": 0
        }
      ],
      "CenterImage": {
        "X": 56,
        "Y": 116,
        "ImageIndex": 60
      }
    }
  },
  "Other": {
    "Animation": {         //this is where cool animations go. dependign on image size, color and quantity the watch face can be laggy and drain battery faster
      "AnimationImage": {
        "X": 0,
        "Y": 20,
        "ImageIndex": 30,
        "ImagesCount": 10,
        "X3": 0
      },
      "Speed": 0,
      "RepeatCount": 1000,
      "x2": 200
    }
  },
  "Heart": {
    "Scale": {          //loads images based on actual pulse/heart value so this is not an animation.
      "StartImageIndex": 116,
      "Segments": [
        {
          "X": 10,
          "Y": 229
        },
        {
          "X": 27,
          "Y": 229
        },
        {
          "X": 44,
          "Y": 229
        },
        {
          "X": 61,
          "Y": 229
        },
        {
          "X": 78,
          "Y": 229
        },
        {
          "X": 95,
          "Y": 229
        }
      ]
    }
  }
}

Re: Anyone have a list of JSON commands

Posted: 20 Aug 2020, 00:31
by rajmund_zarny
Quick question.
Is it possible to change the background?
Let's say every hour, in mi band 4.
Has anyone tried it at all.

Re: Anyone have a list of JSON commands

Posted: 21 Aug 2020, 19:02
by Jackall Digital
rajmund_zarny wrote: 20 Aug 2020, 00:31
Quick question.
Is it possible to change the background?
Let's say every hour, in mi band 4.
Has anyone tried it at all.
A background is a single png image (0000.png), hence this can not be done.

You can send a suggestion to the makers of mi band but I doubt it would be high on their priority list, mainly because they would need to come up with a solution to your "problem" since they can't make any changes that would break all of the older watch faces. That is my opinion anyway.

Re: Anyone have a list of JSON commands

Posted: 15 Jan 2021, 21:22
by Oroumov
Hi Jackall,

Thanks for all the good work, and all the explanations I found everywhere from you.
Is there a complete JSON file (like a few messages above here), but applicable to Mi Band 5 ?
I'm looking for a way to understand all the possible JSON commandes applicable to it.

Also, I found some watchfaces that I opened and I don't understand some of the elements, so it might help me to understand how it works. (for example, for Battery, how many images are allowed ? and how do you define how the real battery level maps to your images depending on how many you have and so on...?)

One last question, how do you use the "triggers" that you mentioned in post "list of things you can do in a watchface" ?

Thanks for your help !

Re: Anyone have a list of JSON commands

Posted: 18 Jan 2021, 00:19
by Jackall Digital
Hey @Oroumov,

I don't know about Mi Band 5 properties. Best you can do is go over the existing watch faces and see how other people have implemented the elements. Maybe someone used an element no one else has used as is not recorded, like the "goal image" for the mi band 4.

As for the battery, I honestly haven't tested it. I think that the final (empty) battery image displays at 15% battery level and all the other battery images are automatically arranged. I know it works with 5 or 10 images, but I also don't see why it wouldn't work with more than 10 images - only way to find out is to try.

As for the triggers. This is all about imagination. My "what to do" watch face displays some text when the hours start with 0, 1 and 2. You could also use this with the "image goal" (or is it goal image?) and display something. i remember a very unique watch face, I forgot what it's called or who made it, but it was an illustration of a cactus in a room with a window - BT would for instance turn the light on/off which changed the whole look and feel of the watch face.

Re: Anyone have a list of JSON commands

Posted: 18 Jan 2021, 20:25
by Oroumov
Ah, thanks a lot for the details. I'll make sure to try things, and I'll report back (might take a while though)
Thanks for the help and hints !

Re: Anyone have a list of JSON commands

Posted: 09 Jul 2021, 17:24
by TheZein
Anyone has any idea how to show cellphone's location in the smartaband's watchface ?

-

Posted: 09 Nov 2021, 21:23
by Aaronfet
Matter of fact is this available anywhere? I only bought a box and no check list was found and I am not sure if it was just that box or the company Topps never made a check list for this set.

Re: Anyone have a list of JSON commands

Posted: 11 Jan 2024, 18:42
by Wizerl
rajmund_zarny wrote: 20 Aug 2020, 00:31
Quick question.
Is it possible to change the background?
Let's say every hour, in mi band 4.
Has anyone tried it at all.
Hi. A very late response, but I tried it and it is possible, but quite difficult due to very limited space on the watch or at least program I have used. You can check my "Annie of the stars" watchface where I did this kind of thing. I just made hours numbers as separate background images that could play at specific hours that won't collide with other elements. Just a trick with the existing code