HMS Function

2024-09-09
No Rating

Functional Overview

The purpose of opening the HMS function in the cloud API is to display device problems in the cloud, improve users' perception and processing capabilities of risks, and ensure job security.

Note: HMS reports complete alarm information. If an alarm reported at the last HMS reporting disappears at current HMS reporting, it means this alarm is resolved.

Alarm copy query

Users have to splice the Copy Key from the fields of HMS function API. According to the Copy Key, users can obtain the alarm copy by querying the Copy Key from the alarm copy query json file. Because of the different alarming devices, the rules of splicing are also different.

  • Alarm copy query json file: hms.jsonopen in new window

  • Splicing rules and examples:

    • The {code} represents alarm code. The {in_the_sky} represents whether the device is in flight. They are API fields of the HMS function. The API fields of HMS function and its explanation can be obtained from Server API > HMS Functionopen in new window.

    • If it is an alarm from DJI Dock, dock_tip_ should be spliced before {code}, which means dock_tip_{code}. Take an example:

      • The error code is 0x16100083, the Copy Key is dock_tip_0x16100083
    • If it is an alarm from the aircraft, the user needs to splice the Copy Key by themselves.
      Aircraft splicing logic: fpv_tip_{code}_{in_the_sky}.
      Take an example, the error code is 0x16100083:

      • If the in_the_sky is 0, it means whether the aircraft is in flight or on the ground, the Copy key is the same: fpv_tip_0x16100083.
      • If the in_the_sky is 1, when the aircraft is in flight, the Copy key is fpv_tip_0x16100083_in_the_sky. when the aircraft is on the ground, the Copy key is fpv_tip_0x16100083.

Alarm copy replacement

Based on the alarm copy query json file: hms.jsonopen in new window, there are some words like "%alarmid", "%index" needs to be replaced.

The replacement rules and examples:

  • The contents that are used to replace can be obtained from the API fields args of HMS Function. The explanation of the args field, the completed variables enumeration of the args field, and the explanation of variables can refer to HMS Functionopen in new window. For example, the variables have alarmid, sensor_index, component_index and so on.

  • Aircraft warning copy rules:

    1. If the text has a "%alarmid", replace it with a specific hexadecimal alarmid, such as 0x16100001.
    2. If the text has a "%index", replace it with sensor_index + 1.
    3. If the text has a "%component_index", replace it with component_index + 1.
    4. If the text contains "%battery_index" and sensor_index is 0, use "left" to replace "%battery_index", otherwise, use "right" to replace.
  • DJI Dock warning copy rules:

    1. If the text contains "%dock_cover_index" and sensor_index is 0, use "left" to replace "%dock_cover_index", otherwise, use "right" to replace.
    2. If the text contains "%charging_rod_index", when sensor_index is 0, replace "%charging_rod_index" with "front". When sensor_index is 1, use "back" instead. When sensor_index is 2, use "left" instead. When sensor_index is 3, use "right" instead.

Interaction timing

The device uploads the alarm information of DJI Dock equipment and aircraft to the cloud through the health alarm protocol (Topic: thing/product/{gateway_sn}/events Method: hms). And the complete alarm copy is presented on the web interface.

Detailed API Realization

HMS Managementopen in new window

  • Health Alarm
If you have any comments or confusion about our documentation, you can click here to give feedback and we will get back to you as soon as possible.