HMS Function
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.json
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 Function.
If it is an alarm from DJI Dock,
dock_tip_
should be spliced before {code}, which meansdock_tip_{code}
. Take an example:- The error code is
0x16100083
, theCopy Key
isdock_tip_0x16100083
- The error code is
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 is0x16100083
:- If the
in_the_sky
is 0, it means whether the aircraft is in flight or on the ground, theCopy key
is the same:fpv_tip_0x16100083
. - If the
in_the_sky
is 1, when the aircraft is in flight, theCopy key
isfpv_tip_0x16100083_in_the_sky
. when the aircraft is on the ground, theCopy key
isfpv_tip_0x16100083
.
- If the
Alarm copy replacement
Based on the alarm copy query json file: hms.json, 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 theargs
field, the completed variables enumeration of theargs
field, and the explanation of variables can refer to HMS Function. For example, the variables havealarmid
,sensor_index
,component_index
and so on.Aircraft warning copy rules:
- If the text has a "%alarmid", replace it with a specific hexadecimal alarmid, such as 0x16100001.
- If the text has a "%index", replace it with sensor_index + 1.
- If the text has a "%component_index", replace it with component_index + 1.
- 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:
- If the text contains "%dock_cover_index" and sensor_index is 0, use "left" to replace "%dock_cover_index", otherwise, use "right" to replace.
- 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
- Health Alarm