Turn on Dahua LED via API?

camviewer43

Getting the hang of it
Mar 14, 2020
177
50
US
Is there a way to turn on the Dahua camera LEDs programmatically via an API call? Like for the IPC-Color4K-T, instead of setting a schedule or whatever, I'd like to send a API call to the camera to turn it on, at some level.
 
Yes, but if you have been following the 4K-T thread, you saw that the APIs for the new GUI are different than the older GUI, so it is a matter of someone trying to figure them out LOL. I figured them out to change the profiles as that is enough for my needs, but I will see if I can figure out the API.
 
Yes, but if you have been following the 4K-T thread, you saw that the APIs for the new GUI are different than the older GUI, so it is a matter of someone trying to figure them out LOL. I figured them out to change the profiles as that is enough for my needs, but I will see if I can figure out the API.

Oh, if you can share how you're doing the profiles, maybe that'll get me started. From what you said, it sounds like maybe you use a python script to do request.post with fields associated with the "button" on the interface?
 
  • Like
Reactions: sebastiantombs
My turn to contribute back to the community.

Please see attached screenshot.

Instructions I got from this thread

Dahua day/night switch utility - DahuaSunriseSunset


Day Mode (substitute ID/Password/IP Address for yours)

Code:
ID:PASSWORD@IPADDRESS/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[].NightOptions.SwitchMode=0&VideoInOptions[].NightOptions.DayNightColor=0

Night Mode (substitute ID/Password/IP Address for yours)

Code:
ID:PASSWORD@IPADDRESS/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[].NightOptions.SwitchMode=3&VideoInOptions[].NightOptions.DayNightColor=0
 

Attachments

  • PTZ.jpg
    PTZ.jpg
    374.9 KB · Views: 20
  • Schedule.jpg
    Schedule.jpg
    203.1 KB · Views: 21
Last edited:
I was able to turn on/off the LED in 4KT-180:

Code:
# Turn off Led:
  curl --digest --user  admin:pass 'http://192.168.100.5:10085/cgi-bin/configManager.cgi?action=setConfig&Lighting_V2\[0\]\[1\]\[0\].Mode=Off'
# Turn on Led:
  curl --digest --user  admin:pass 'http://192.168.100.5:10085/cgi-bin/configManager.cgi?action=setConfig&Lighting_V2\[0\]\[1\]\[0\].Mode=Auto'

Notes:
1. I assume you have direct connection to the camera, either via a POE switch or via Virtual host (NVR feature - blue e icon).
2. The illuminator is set to a none zero value
3. The camera is on the night profile (that's what the middle indices means - [1] = night profile).
4. Make sure to replace the IP and port (and the credentails) with your values.
 
  • Like
Reactions: TonyR