Dahua day/night switch utility - DahuaSunriseSunset

I looked into that before but I think what I found was the ability to toggle the IR filter, not the camera's profile.
 
Does it matter whether the profile in the camera is set to normal, full time, or schedule? I have a ptz, SD29204S-GN that I have configured but it isn't toggling anything that I can tell when I simulate sunrise or sunset. I have tried all 3 settings in the camera, it's got to be something simple I am missing.
 
Looks like that was probably my problem, thanks. I'll try it out tonight and tomorrow.
 
I noticed this morning that something switched at sunrise but it was still black and white. I logged into the camera and saw it had switched to "normal" so I had to switch it to full time - day. I've noticed that it seems to keep getting switched to "normal" so I'll keep looking at it to see what I have that's wrong.
 
I just set this up today for an outdoor camera to give it a little bit of WDR during the day in domoticz, simple script:


HTML:
commandArray = {}

-- Switch cameras to day profile
if (timeofday['Daytime']) then
        commandArray['OpenURL']='http://user:pwd@10.0.0.125/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=0'

-- Switch cameras to night profile
elseif (timeofday['Nighttime']) then
        commandArray['OpenURL']='http://user:pwd@10.0.0.125/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=1'
end

return commandArray


All I have to do now is add URL's for any other cameras I want to change profiles with, and this will change based on sunrise and sunset. :)

Do these commands turn WDR On and Off? And if that is correct, does WDR maintain the previous range setting?

Thanks.

Mark
 
While I was on my vacation recently I built a tiny windows service, complete with a configuration GUI, that can change between Day and Night profiles on multiple Dahua cameras.

Anyone may install and use this (on a Windows system, anyway) without having to mess around with configuration files.

GitHub - bp2008/DahuaSunriseSunset: A Windows Service which changes the profile of dahua cameras between Night and Day at each sunset and sunrise.

Thanks again! FYI, this also works for a Lorex 8MP camera I have.
 
Nice stuff BP2008!
The only problem that I'm experiencing is that the sunrise/sunset times are the wrong way around. (The Netherlands) For now I've setup my "Day settings" in the "Night profile" and vice versa.
 
Nice stuff BP2008!
The only problem that I'm experiencing is that the sunrise/sunset times are the wrong way around. (The Netherlands) For now I've setup my "Day settings" in the "Night profile" and vice versa.

That is odd! Probably something to do with the sunrise and sunset calculations. You wouldn't believe how hard it is to find code that calculates it correctly in all cases.
 
The profile switching only works to the cams himselves, if they were behind a poe nvr it´s not possible anymore. In generally it should be possible to control the nve by http api too, but I noticced on all firmwares of nvr 4xxx-p-4ks2 and 5xxx-p-4ks2 a broken (missing) profile scheduler. Within these firmwares we have 3 config settings (beeing thought comparable as day/night/normal), but trying to control them by http api will result in broken nvr configs and undefined settings until restoring picture defaults.
 
While I was on my vacation recently I built a tiny windows service, complete with a configuration GUI, that can change between Day and Night profiles on multiple Dahua cameras.
Anyone may install and use this (on a Windows system, anyway) without having to mess around with configuration files.
GitHub - bp2008/DahuaSunriseSunset: A Windows Service which changes the profile of dahua cameras between Night and Day at each sunset and sunrise.

@bp2008 Thanks for creating this utility. I set it up and it ran as expected on my IPC-HFW5231E-Z12 but the focus didn't change. When I set focus manually using "cgi-bin/devVideoInput.cgi?action=adjustFocus&focus=0.766667&zoom=0.865225" I have to run it twice about 90 seconds apart to get the focus to adjust. Any recommendations on how to solve this problem?
 
@bp2008 Thanks for creating this utility. I set it up and it ran as expected on my IPC-HFW5231E-Z12 but the focus didn't change. When I set focus manually using "cgi-bin/devVideoInput.cgi?action=adjustFocus&focus=0.766667&zoom=0.865225" I have to run it twice about 90 seconds apart to get the focus to adjust. Any recommendations on how to solve this problem?

I noticed the command is rather unreliable, and that is why the app sends the command 3 or 4 times, several seconds apart. I don't know what more I could do (within reason) to make it work.
 
I noticed the command is rather unreliable, and that is why the app sends the command 3 or 4 times, several seconds apart. I don't know what more I could do (within reason) to make it work.

Could you add a "seconds between focus commands" field? That way I could set it to 60-90 in my configuration and anyone else could set it to what works for them. It's a very useful utility and other than the strange behavior of my camera it works great. Thanks
 
Could you add a "seconds between focus commands" field? That way I could set it to 60-90 in my configuration and anyone else could set it to what works for them. It's a very useful utility and other than the strange behavior of my camera it works great. Thanks

Done. Try version 1.2 and see if it works better.
 
Thanks again @bp2008 for this amazing tool. Question: will the sunset/sunrise offset field take a decimal number? I.e., can I specify 30 minutes with .5 hours?
 
You should rename this thread something like "Dahua day night switch utility - DahuaSunriseSunset" so more people can find it.