Basic Functions
Basic function APIs are used to query and adjust device operating status, and do not include the triggering of audible and visual alarms itself.
Get Sound Configuration
Section titled "Get Sound Configuration"URL: http://<Alarm Light IP Address>/api/system/get_sound_conf
Request Method: GET
Additional Parameters: None
Successful Response Example:
{ "code": 200, "msg": "OK", "data": { "volume": { "method": 18, "id": "83f694bc8be08bff30c6c1e0df254ce9", "data": 20, // Volume value "res_code": 0 }, "tts": 1, // TTS synthesis flag: 1 for automatic, 2 for offline only "auto_mute": true // Whether to mute the speaker when headphones are inserted }}Set Volume
Section titled "Set Volume"URL: http://<Alarm Light IP Address>/api/system/set_vol
Request Method: POST
Data Type: form-data
Parameters:
| Parameter Name | Type | Description |
|---|---|---|
| value | int | Volume level, range 0~31, please strictly adhere to this |
Successful Response Example:
{ "code": 200, "msg": "OK", "data": { "method": 19, "id": "3bc704df1863d16d430b59dbde33f6e6", "data": "ok", "res_code": 0 }}Skip Current Playback
Section titled "Skip Current Playback"Purpose: Stop the current playback content (optionally delete periodic playback), and play the next one directly (if any).
Note: If the skipped playback is an infinite loop, it will be deleted directly.
URL: http://<Alarm Light IP Address>/api/api/play_next
Request Method: POST
Data Type: form-data
Parameters:
| Parameter Name | Type | Example | Description |
|---|---|---|---|
| is_delete | text | 0 | 1: Delete periodic playback; 0: Disable deletion of periodic playback |
Successful Response Example:
{ "code": 200, "msg": "OK", "data": { "method": 61, "id": "1703a60c360835dfb88f42bbbf91266a", "data": "OK", "res_code": 0 }}Clear Playback Queue
Section titled "Clear Playback Queue"Purpose: Clear the playback queue waiting to be announced.
Address: http://<Alarm Light IP Address>/api/api/clear_queue
Request Method: GET
Parameters: This interface has no parameters.
Successful Response Example:
{ "code": 200, "msg": "OK", "data": { "method": 60, "id": "ec79e09e56cb8717da42b7714556e96d", "data": "OK", "res_code": 0 }}Clear Specified Alert
Section titled "Clear Specified Alert"URL: http://<Alarm Light IP Address>/api/system/set_vol
Request Method: POST
Data Type: form-data
Parameters:
| Parameter Name | Type | Description |
|---|---|---|
| clear_opt | array | Clear specified types of alerts: 1: Clear periodic playback; 2: Clear infinite loop playback; 3: Clear pending playback queue; Example: [1,2,3] |
Successful Response Example:
{ "code": 200, "msg": "OK", "data": { "method": 64, "id": "29ce6dd94fe605c4a2452ec0280742b0", "data": "OK", "res_code": 0 }}Get Pending Playback Queue Length
Section titled "Get Pending Playback Queue Length"Purpose: Get the number of requests queued and waiting to be announced; the currently playing announcement is not included.
URL: http://<Alarm Light IP Address>/api/api/get_play_queue_size
Request Method: GET
Parameters: None
Successful Response Example:
{ "code": 200, "msg": "OK", "data": { "method": 62, "id": "d5bc9edc6479bc7c017e5c9e645eb340", "data": 0, // Number of pending announcements "res_code": 0 }}Legacy Alarm Light API
Section titled "Legacy Alarm Light API"Purpose: This API is provided for users of the “Black Cat Detective Smart Network Alarm Light” to ensure compatibility with legacy interfaces.
Simply map the original IP address to this alarm light to achieve the original functionality.
Modify Standby Style
Section titled "Modify Standby Style"Purpose: Used to modify the style displayed by the alarm light in standby status.
URL: http://<Alarm Light IP Address>/api/system/set_standby_mode
Request Method: POST
Data Type: form-data
Parameters:
| Parameter Name | Type | Example | Description |
|---|---|---|---|
| style | string | 3 | The style displayed by the alarm light in standby mode. |
| color | json | [“#FF00ff”] | The color displayed by the alarm light in standby mode. |
| flag | int | 3 | 0: Single color, never changes; 0.5: Single color, gradually changes; 1 ~ 2: 0 - 360 degree hue gradient. The top LED layer is the initial color, and the bottom layer is the hue after adding the specified degrees. The middle layers are gradient colors. |
| wait_time | int | 10 | How long after the standby style is interrupted by another alert before it returns to the standby style. |
Successful Response Example:
{ "code": 200, "msg": "OK", "data": { "method": 23, "id": "f3d4e9894b8951d74024dc879471ef8b", "data": "ok", "res_code": 0 }}