Switch on / off Infrared with http command

Cor

Getting the hang of it
May 5, 2017
171
17
Greetings,

I just installed a Dahua IPC-HDW4631C-A (has Onvif). I would like to turn on and off the IR with a http command , directly in the camera , or via Blue iris. This to controll the IR via my home automation.

Does anyone know if this is possible? If yes , How to do this?

Many thanks,
Cor
 
For Blue Iris, try these
{ip_addressANDport}/admin?camera={cam-short-name}&ptz=34 ... off
{ip_addressANDport}/admin?camera={cam-short-name}&ptz=35 ... on
{ip_addressANDport}/admin?camera={cam-short-name}&ptz=36 ... auto

But beware that these commands do not actually turn the IR On/Off, but rather
34 ('off') sets Dahua 'DayNight' mode to 'Color'
35 ('on') sets Dahua 'DayNight' mode to 'B/W'
36 ('auto') sets Dahua 'DayNight' mode to 'Auto'

You might want to check out DahuaSunriseSunset.
 
Last edited:
@ Jaydeel: Thank , will try that in the weekend.

Not changing the IR to on/off , but the day/night mode, does that have other consequences as to only the IR?

Thanks,
Cor
 
For Blue Iris, try these
{ip_addressANDport}/admin?camera=DW1&ptz=34 ... off
{ip_addressANDport}/admin?camera=DW1&ptz=35 ... on
{ip_addressANDport}/admin?camera=DW1&ptz=36 ... auto

But beware that these commands do not actually turn the IR On/Off, but rather
34 ('off') sets Dahua 'DayNight' mode to 'Color'
35 ('on') sets Dahua 'DayNight' mode to 'B/W'
36 ('auto') sets Dahua 'DayNight' mode to 'Auto'

You might want to check out DahuaSunriseSunset.


I have just tried the codes , but no joy yet.
I do get a reply from blue iris , like : signal green, profile 2 etc
http://192.168.68.20:84/admin?camera=Kitchen&ptz=35

is the code correct "ptz=35" , is that not for a PTZ command?
The camera settings , in profile management , which setting does it need , so blue iris can change it?
"normall"-"full time"- "schedule".

Thanks,
Cor
 
I've just re-tested and verified that these commands work for me.

Are your web-server's authentication settings set up like this?
(Settings > Web server > 'Advanced...')
upload_2019-9-9_13-33-27.png

If so, you will need append your credentials to the command:
http://192.168.68.20:84/admin?camera=Kitchen&ptz=35&user=admin&pw=admin

Or you can to change the settings and restart the Blue Iris service. (Mine is 'Non-LAN only' & checked).

Also, let's confirm that you are specifying the cam-short-name in the command. If you are, then when you use the command http://192.168.68.20:84/admin?camera=Kitchen, you should see the following...
Code:
signal=green
profile=1
lock=0
camera=cam-long-name

is that not for a PTZ command?
If you mean a preset command, then no. The preset command is:
/admin?camera=x&preset=n Goto PTZ preset n on camera x (short name)

The 'ptz=' command appears to be used for some of the non-preset items on the camera right-click context menu.
The Blue Iris 5 Help PDF lists only the following:
/admin?camera=x&ptz=n PTZ command n on camera x (short name)
where n=0,1... for left,right,up,down,center,zoom+,zoom-


The IR 'ptz=' commands are, as far as I know, officially undocumented. I found them a few years ago via google.
 
Last edited:
Thanks,

I just tried again. I do get a response in my browser:
signal=green
profile=2
lock=1
camera=Kitchen


But no change in IR -light , when I switch it on or off in the GUI from the camera I do see the IR light comming on or off.
What settings do I need to set in GUI of the camera?
-in Profile management I have: Normall - full time- schedule.
-in conditions IR-light I have set: day : OFF , night: "manuel 80%"

But with these settings; I don;t see a change in the camera.

Thanks,
Cor
 
In Blue Iris, i have set my 5231R-ZE to turn on and off the IR lights.

In Blue Iris, i went to the camera settings of the specified camera -> PTZ/Control

There i enabled the check mark for Pan/Tilt/Zoom, and under Network IP, i choose *Custom HTTP* and then clicked on the Edit button to the right.

Under Function,
  • IR LEDs ON , with /page?args set to: /cgi-bin/configManager.cgi?action=setConfig&Lighting[0][0].Mode=Manual
  • IR LEDS Off , with /page?args set to: /cgi-bin/configManager.cgi?action=setConfig&Lighting[0][0].Mode=Off
 
Last edited: