API to turn on light for the IPC-HDW3849H-AS-PV

Pacs

n3wb
Joined
Feb 9, 2021
Messages
14
Reaction score
0
Location
Australia
Got it. Here's all the commands for the IPC-HDW3849H-AS-PV to turn on the illuminator, warning lights, and siren:

Check status of warning lights and speakers

Turn warning lights (red/blue lights)
ON:
OFF:
Play sound (siren)
ON:
OFF:
Turn light (illuminator)
ON:
OFF:
Where [0][1] is [ChannelNo][ConfigNo]
ChannelNo: integer, array index starts from 0, which means video channel (equals to video channel index -1, and so 0 means channel 1).
ConfigNo: array index, can be 0, 1 or 2. 0 means config for day, 1 means config for night, and 2 means config for normal scene.

Hi Guys,

Any chance you could help to find the illuminator commands for DH-IPC-HDW3849HP-AS-PV-0280B-S3 these don't seem to work on this model.

Any help would be greatly appreciated.

Thank you
 

Doland

n3wb
Joined
Apr 17, 2022
Messages
5
Reaction score
3
Location
Canada
Hi Guys,

Any chance you could help to find the illuminator commands for DH-IPC-HDW3849HP-AS-PV-0280B-S3 these don't seem to work on this model.

Any help would be greatly appreciated.

Thank you
hi Pacs,

Sorry, I see this is an old post, but in case you are still having issues, you may want to try the following:

username and password can be inserted into the front of the http request.
#username#:#password#@#ipaddress#:#port#/cgi-bin/configManager.cgi?action=setConfig&Lighting[0][1].Mode=Manual
#username#:#password#@#ipaddress#:#port#/cgi-bin/configManager.cgi?action=setConfig&Lighting[0][1].Mode=Off

example:
admin:mypassword@192.168.1.108:443/cgi-bin/configManager.cgi?action=setConfig&Lighting[0][1].Mode=Manual
admin:mypassword@192.168.1.108:443/cgi-bin/configManager.cgi?action=setConfig&Lighting[0][1].Mode=Off

note that some aspects of the url are case sensitive. i tried "Mode=manual" lower case "M" at first, and it failed causing quite a lot of confusion for me.
 

kobebeef

Pulling my weight
Joined
Mar 13, 2016
Messages
207
Reaction score
229
How can Dahua VTO or ASI through API or get visitor QRCode?
 

toribola

n3wb
Joined
Sep 24, 2020
Messages
10
Reaction score
0
Location
France
Hi,

Here is the result of the command on my HDW3849H-AS-PV-S3 :


It will probably help to manage the while light.


$ curl --digest -u "user:pass" -g ""
table.Lighting_V2[0][0][0].Correction=50
table.Lighting_V2[0][0][0].LightType=InfraredLight
table.Lighting_V2[0][0][0].MiddleLight[0].Angle=50
table.Lighting_V2[0][0][0].MiddleLight[0].Light=50
table.Lighting_V2[0][0][0].Mode=Auto
table.Lighting_V2[0][0][0].Sensitive=3
table.Lighting_V2[0][0][1].Correction=50
table.Lighting_V2[0][0][1].LightType=WhiteLight
table.Lighting_V2[0][0][1].Mode=Auto
table.Lighting_V2[0][0][1].NearLight[0].Angle=50
table.Lighting_V2[0][0][1].NearLight[0].Light=50
table.Lighting_V2[0][0][1].PercentOfMaxBrightness=100
table.Lighting_V2[0][0][1].Sensitive=3
table.Lighting_V2[0][0][2].AIMixLightSwitchDelay=60
table.Lighting_V2[0][0][2].Correction=50
table.Lighting_V2[0][0][2].LightType=AIMixLight
table.Lighting_V2[0][0][2].Mode=Auto
table.Lighting_V2[0][0][2].PercentOfMaxBrightness=100
table.Lighting_V2[0][0][2].Sensitive=3
table.Lighting_V2[0][1][0].Correction=50
table.Lighting_V2[0][1][0].LightType=InfraredLight
table.Lighting_V2[0][1][0].MiddleLight[0].Angle=50
table.Lighting_V2[0][1][0].MiddleLight[0].Light=50
table.Lighting_V2[0][1][0].Mode=Auto
table.Lighting_V2[0][1][0].Sensitive=3
table.Lighting_V2[0][1][1].Correction=50
table.Lighting_V2[0][1][1].LightType=WhiteLight
table.Lighting_V2[0][1][1].Mode=Auto
table.Lighting_V2[0][1][1].NearLight[0].Angle=50
table.Lighting_V2[0][1][1].NearLight[0].Light=50
table.Lighting_V2[0][1][1].PercentOfMaxBrightness=100
table.Lighting_V2[0][1][1].Sensitive=3
table.Lighting_V2[0][1][2].AIMixLightSwitchDelay=60
table.Lighting_V2[0][1][2].Correction=50
table.Lighting_V2[0][1][2].LightType=AIMixLight
table.Lighting_V2[0][1][2].Mode=Auto
table.Lighting_V2[0][1][2].PercentOfMaxBrightness=100
table.Lighting_V2[0][1][2].Sensitive=3
table.Lighting_V2[0][2][0].Correction=50
table.Lighting_V2[0][2][0].LightType=InfraredLight
table.Lighting_V2[0][2][0].MiddleLight[0].Angle=50
table.Lighting_V2[0][2][0].MiddleLight[0].Light=50
table.Lighting_V2[0][2][0].Mode=Auto
table.Lighting_V2[0][2][0].Sensitive=3
table.Lighting_V2[0][2][1].Correction=50
table.Lighting_V2[0][2][1].LightType=WhiteLight
table.Lighting_V2[0][2][1].Mode=Auto
table.Lighting_V2[0][2][1].NearLight[0].Angle=50
table.Lighting_V2[0][2][1].NearLight[0].Light=50
table.Lighting_V2[0][2][1].PercentOfMaxBrightness=100
table.Lighting_V2[0][2][1].Sensitive=3
table.Lighting_V2[0][2][2].AIMixLightSwitchDelay=60
table.Lighting_V2[0][2][2].Correction=50
table.Lighting_V2[0][2][2].LightType=AIMixLight
table.Lighting_V2[0][2][2].Mode=Auto
table.Lighting_V2[0][2][2].PercentOfMaxBrightness=100
table.Lighting_V2[0][2][2].Sensitive=3
 

camviewer43

Getting the hang of it
Joined
Mar 14, 2020
Messages
176
Reaction score
50
Location
US
This is pretty useful. Is there a good way of finding these commands for lights in general? Like if I have other models?
 

SubtleOrc

n3wb
Joined
Jan 26, 2023
Messages
5
Reaction score
0
Location
Brisbane Australia
Does anyone have any command to trigger the audible warning (ie: You are under survellience) on the new TIOC 2.0 cameras?
I have the strobe lights and the actual siren working using commands from earlier in this thread.
 

Cold-Lemonade

Pulling my weight
Joined
Apr 1, 2021
Messages
156
Reaction score
134
Location
Boston
The following works to turn on the audio file that you've selected inside the camera. I use this on my IPC-T5241H-AS-PV.

http://username:password@camera_ip_address/cgi-bin/coaxialControlIO.cgi?action=control&channel=2&info[0].Type=2&info[0].IO=1
 

Thanamite

Young grasshopper
Joined
Jan 7, 2022
Messages
45
Reaction score
17
Location
New York

alecz

Young grasshopper
Joined
May 16, 2023
Messages
53
Reaction score
10
Location
Montreal
This command worked perfectly with my Dahua Color-X 4K camera. This is how I run it with curl:
  • curl --anyauth -u "admin:<password>" "http://<ipaddress>/cgi-bin/configManager.cgi?action=setConfig&Lighting\[0\]\[1\].Mode=Auto"
Thank you very much.
In the browser:

This works for my Dahua HDW2439T-AS-LED-S2 or 5442 LED only partially: it changes the config (I can confirm in the camera's UI), but it does not "activate" it. In other words it changes config from Auto to Off, but the lights don't turn off.
How to apply the changes?

EDIT:

The forum has some older threads that suggest
/cgi-bin/configManager.cgi?action=setConfig&Lighting[0][1].Mode=Off
but (at least for newer cameras), need to use Lighting_V2
/cgi-bin/configManager.cgi?action=setConfig&Lighting_V2[0][0][0].Mode=Off
 
Last edited:

cosmicman

n3wb
Joined
Nov 23, 2022
Messages
6
Reaction score
4
Location
USA
Thanks to other members for exposing the config manager API; that was really helpful.

Here's my contribution. What I will be sharing is a proof of concept that it is possible to have Blue Iris send a http request to a local lightweight C# API application that can change your camera settings using the information shared in this thread.

My Test Setup
Cameras

IPC-Color4K-T
Tioc 2 8MP bullet camera.

System
Blue Iris v5.8.8.3
HP Elitedesk mini i7 8700
SanDisk Pro 6TB G-Drive
Windows 10 latest build
* I also have CodeProject AI and the API app running on the system as well.

API Application
The API application was setup to target just the IPC-Color4K-T camera. The app has a single API endpoint that was configured to change the camera's LED lighting mode and brightness. The camera login credentials are stored in the app, so all you need to do is have Blue Iris send a http request to the app's API endpoint and it'll do the rest.

Note: What's nice about C# API application is it has swagger ui as default. This allows you to test your endpoints before adding them to Blue Iris.

This is the API endpoint: {lightMode}/{brightness}.
{lightMode} accept a value of: Auto, Manual, or Off
{brightness} accept a value between 1 and 100.

When everything is setup and running, Blue Iris sends http requests to the API application. The app will then build the actual camera's http request (i.e. ). The application also sends the proper login credentials.

The Test
Here's how I test the API application endpoint. Both the Color4K-T and Tioc 2 8MP cameras were added to Blue Iris. I have the Color4K-T next to me while the Tioc 2 8MP bullet camera is in my living room. When motion is trigger on the Tioc 2 8MP camera, the Color4K-T LED lights will turn on. After the trigger resets, then the camera LED lights turn off.

Configure the Cameras
In Blue Iris, I setup the Tioc 2 8MP bullet camera to detect motion in the Trigger tab. Then added the above API endpoint as a pre-alert action with values to turn on the Color4K-T LED lights and set the brightness to 1 (lowest).

The end point shown in the below screenshot http input field:
pre_alert.jpg


In the camera's Alert tab > On reset, I added the below action to turn off the camera after all actions have run.

The end point shown in the below screenshot http input field:
alert_on_reset.jpg


Results
That's it. When someone appears in the living room and motion is detected and triggered, the pre-alert http action is fired, this turns on the Color4K-T LED lights and set the brightness level to 1. After the trigger ends, the reset action fires and turns off the LED lights.


Additional Information and Screenshots
Here's the API application running in the background listening. (API endpoint mentioned above uses a hostname set in the host file instead of localhost).

cam_api_app.jpg


Swagger UI

API Application has Swagger as default, so you can test your endpoints before adding them to Blue Iris.

swagger.jpg



Other methods to test/change camera configuration.
Postman works too, if you don't want to build your own API application. It will also do the authentication for you (digest authentication). You can save your endpoints and store your credentials.

Postman1.pngPostman2.png


If You Don't Know Which Setting to Change
When I didn't know which settings I need to change, I did some trial and error, by opening Edge, navigate to the camera login page, open developer tools then navigate to the Network activity section. Login to the camera and navigate to the camera settings page. Change a setting then look at the Network activity, select the latest requests and view the Payload. Copy the Payload to notepad++ to view all settings and find the setting I just changed.
 

Attachments

cosmicman

n3wb
Joined
Nov 23, 2022
Messages
6
Reaction score
4
Location
USA
Chromium brower's develoepr tools can help find some of the settings. Look at the request payload.

I.e. Color4K-T camera settings, after changing Illuminator from off to Auto.

You can also copy the value path and with some trial and error, get the correct field for your http request:

i.e.
params.table[0][0][0].MiddleLight[0].Light ... would become => Lighting_V2[0].table[0][0][0].MiddleLight[0].Light

JSON:
{
  "name": "Lighting_V2",
  "table": [
    [
      [
        {
          "Correction": 50,
          "LightType": "WhiteLight",
          "MiddleLight": [
            {
              "Angle": 50,
              "Light": 1
            }
          ],
          "Mode": "Auto",
          "PercentOfMaxBrightness": 100,
          "Sensitive": 3
        }
      ],
      [
        {
          "Correction": 50,
          "LightType": "WhiteLight",
          "MiddleLight": [
            {
              "Angle": 50,
              "Light": 50
            }
          ],
          "Mode": "Auto",
          "PercentOfMaxBrightness": 100,
          "Sensitive": 3
        }
      ],
      [
        {
          "Correction": 50,
          "LightType": "WhiteLight",
          "MiddleLight": [
            {
              "Angle": 50,
              "Light": 50
            }
          ],
          "Mode": "Auto",
          "PercentOfMaxBrightness": 100,
          "Sensitive": 3
        }
      ],
      [
        {
          "Correction": 50,
          "LightType": "WhiteLight",
          "MiddleLight": [
            {
              "Angle": 50,
              "Light": 50
            }
          ],
          "Mode": "Auto",
          "PercentOfMaxBrightness": 100,
          "Sensitive": 3
        }
      ],
      [
        {
          "Correction": 50,
          "LightType": "WhiteLight",
          "MiddleLight": [
            {
              "Angle": 50,
              "Light": 50
            }
          ],
          "Mode": "Auto",
          "PercentOfMaxBrightness": 100,
          "Sensitive": 3
        }
      ],
      [
        {
          "Correction": 50,
          "LightType": "WhiteLight",
          "MiddleLight": [
            {
              "Angle": 50,
              "Light": 50
            }
          ],
          "Mode": "Auto",
          "PercentOfMaxBrightness": 100,
          "Sensitive": 3
        }
      ],
      [
        {
          "Correction": 50,
          "LightType": "WhiteLight",
          "MiddleLight": [
            {
              "Angle": 50,
              "Light": 50
            }
          ],
          "Mode": "Auto",
          "PercentOfMaxBrightness": 100,
          "Sensitive": 3
        }
      ],
      [
        {
          "Correction": 50,
          "LightType": "WhiteLight",
          "MiddleLight": [
            {
              "Angle": 50,
              "Light": 50
            }
          ],
          "Mode": "Auto",
          "PercentOfMaxBrightness": 100,
          "Sensitive": 3
        }
      ],
      [
        {
          "Correction": 50,
          "LightType": "WhiteLight",
          "MiddleLight": [
            {
              "Angle": 50,
              "Light": 50
            }
          ],
          "Mode": "Auto",
          "PercentOfMaxBrightness": 100,
          "Sensitive": 3
        }
      ]
    ]
  ],
  "options": []
}
 
Last edited:

cosmicman

n3wb
Joined
Nov 23, 2022
Messages
6
Reaction score
4
Location
USA
Here's how to change Tioc 2.0 alarm tone. Important to note that this actually changes the default alarm tone setting in Camera > Audio > Alarm Tone page. If you want this to be temporary, you will need to send two http requests to reset it back to default.

Example below shows how to change alarm tone to "You are under surveillance.wav":

Http Request - Note: param value needs to be encoded.
http://<ip>/cgi-bin/configManager.cgi?action=setConfig&Sound.AlarmSound=/usr/data/audiofiles/audios/You are under surveillance.wav

Check the setting was changed:
http://<ip>/cgi-bin/configManager.cgi?action=getConfig&name=Sound


JSON payload showing what fields are available:

JSON:
{
  "method": "configManager.setConfig",
  "params": {
    "name": "Sound",
    "table": {
      "AlarmSound": "/usr/data/audiofiles/audios/alarm.wav",
      "AlarmSoundDuration": 600,
      "AlarmSoundVolume": 100,
      "SilentMode": false,
      "SoundTipsPlayEnable": true
    },
    "options": []
  },
  "id": 709,
  "session": "a6c6cf3bc909ceddf86371a4b9489f82"
}
 

Alaska Country

Getting comfortable
Joined
Jun 10, 2021
Messages
437
Reaction score
632
Location
Alaska
This API can be modified to include user, password and specific camera as follows:

Code:
http://username:password@192.168.55.56/cgi-bin/configManager.cgi?action=getConfig&name=All
Replace the user name and password and the camera IP with your own. Paste into FireFox and there should be a rather lengthily display of config settings for that specific camera.
 

Alaska Country

Getting comfortable
Joined
Jun 10, 2021
Messages
437
Reaction score
632
Location
Alaska
Thanks cosmicman for posting the how to on finding parts of a Dahua API using existing tools in the MS Edge browser.

Used your process to assist in determining what makes the "Sync PC" button work in the date and time setting section of a Dahua camera. The output from Edge follows:

Code:
{"method":"global.getCurrentTime","params":null,"id":399,"session":"c3a1957203f527c169676fbcb6ecf689"}

{"method":"global.setCurrentTime","params":{"time":"2024-03-12 18:57:36","tolerance":5},"id":398,"session":"c3a1957203f527c169676fbcb6ecf689"}
The results would indicate that a GET statement is used to first check the current time and date. Then stores that information.

The SET statement uses the stored date and time and actually sets the camera to this time and date.

An API URL can be generated to set the time for an individual Dahua camera.

Code:
http://username:password@192.168.55.12/cgi-bin/global.cgi?action=setCurrentTime&time=2024-03-12%2000:10:00
Following the 12 in the date is a "%20" which represents a space. The time is 00:10:00 or 10 minutes after midnight.

Change the user name, password and camera IP and place in FireFox. The time will be updated for that specific camera. The downside of this method is that the date and time must be entered manually.

An added function, would be to sync all cameras using this basic API. This would require replacing the time and date with variables generated by your selected application. Gave this a try with a Hubitat C7 hub with the following code being used to generate a HTTP Get statement:

Code:
http://username:password@192.168.55.12/cgi-bin/global.cgi?action=setCurrentTime&time=%date%%20%now%
The nice part of using date and now, in this context, is that the format for date and now can be changed to match the requirement of the Dahua camera.

Each camera can thus be updated, as needed, or triggered as a periodic event every ten minutes or desired time interval.
 

cosmicman

n3wb
Joined
Nov 23, 2022
Messages
6
Reaction score
4
Location
USA
If you use http://<ip>/cgi-bin/configManager.cgi?action=getConfig&name=All to get a list of configurations, you could also change the http request:

from
http://<ip>/cgi-bin/configManager.cgi?action=setConfig&Lighting_V2[0].table[0][0][0].Mode=Manual&Lighting_V2[0].table[0][0][0].MiddleLight[0].Light=1

to
http://<ip>/cgi-bin/configManager.cgi?action=setConfig&All.Lighting_V2[0][0][0].Mode=Manual&All.Lighting_V2[0][0][0].MiddleLight[0].Light=1
 
Top