Switching between color and black & white

hmjgriffon

Known around here
Mar 30, 2014
3,369
976
North Florida
Anyone know the http api command for this? I'm lookin through ftp://ftp.wintel.fi/drivers/dahua/SDK-HTTP_ohjelmointi/DAHUA_IPC_HTTP_API_V1.00x.pdf but not sure which one does it. Or do I have to just switch between day and night profile?
 
I use this to switch between day and night, and just have the parameters set the way I want (on the camera) for each mode:

Code:
if ($mode eq "night")
    {
    
    $mode_url="http://$camera_data{user}:$camera_data{pass}\@$camera_data{host}:$camera_data{port}/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=1";
    
    }


if ($mode eq "day")
    {
    
    $mode_url="http://$camera_data{user}:$camera_data{pass}\@$camera_data{host}:$camera_data{port}/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=0";
        
    }
 
  • Like
Reactions: hmjgriffon
I use this to switch between day and night, and just have the parameters set the way I want (on the camera) for each mode:

Code:
if ($mode eq "night")
    {
    
    $mode_url="http://$camera_data{user}:$camera_data{pass}\@$camera_data{host}:$camera_data{port}/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=1";
    
    }


if ($mode eq "day")
    {
    
    $mode_url="http://$camera_data{user}:$camera_data{pass}\@$camera_data{host}:$camera_data{port}/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=0";
        
    }
Yeah I've decided to just switch profiles instead of that one setting, I'm curious though, how are you using your code, home automation?

Sent from my Nexus 6P using Tapatalk
 
Yeah I've decided to just switch profiles instead of that one setting, I'm curious though, how are you using your code, home automation?

Sent from my Nexus 6P using Tapatalk

Yes. I have built up a "smart house" over the years. The code is from my automation server. We call her "Crystal".
 
  • Like
Reactions: hmjgriffon
@hmjgriffon

Here's the latest version (1.56) of the API doc

Dammit! Can't figure out how to escape the link to keep it from eating parts of it.
Use this.

ftp://92.247.81.210/FTP/Dahua/Integration%20and%20Development%20Materials/dahua_http_api_for_ipc_v1.56.pdf
 
Last edited:
  • Like
Reactions: cb8