Dahua day/night switch utility - DahuaSunriseSunset

105437

BIT Beta Team
Joined
Jun 8, 2015
Messages
2,074
Reaction score
964
Last edited:

Cor K Dikland

Getting the hang of it
Joined
Apr 25, 2019
Messages
100
Reaction score
37
Location
Ontario, Canada
I did a test on one camera by sending this command to it. Working Mode is set to Customized Scene. When I send the night command below, it doesn't change the camera to the Night profile. Any thoughts on what to check? I do get the "OK" response in the browser window.

NIGHT
That URL works for me except it sets the Day/Night Mode to Color. I use the same URL except I use DayNightColor=1 (or 2 with SwitchMode=0)
 

Cor K Dikland

Getting the hang of it
Joined
Apr 25, 2019
Messages
100
Reaction score
37
Location
Ontario, Canada
Yup. It should set your camera to night mode and Day/Night Color to B&W. Well, at least it does mine :)

BTW: I could not ever get the Day/Night color to change to anything but Auto or B&W no matter whatvalue I set DayNightColor to. I "fixed" this by manual setting the desired Day night Color for night time (or Day time) then hitting "Apply" I now can set Color for Day and B&W for night. I no longer can set this option via this URL to Auto. Not a problem for me but YMMV
 
Last edited:

105437

BIT Beta Team
Joined
Jun 8, 2015
Messages
2,074
Reaction score
964
Yup. It should set your camera to night mode and Day/Night Color to B&W. Well, at least it does mine :)
OK, thanks. I tried that and it did change to night mode, but it also changed several of my profile settings for exposure, backlight, etc. which is not gonna work for me. For example, it changed the day/night profile setting to auto instead of black-and-white, so I can't really see a result by testing during the day of changing to night mode
 
Last edited:

Cor K Dikland

Getting the hang of it
Joined
Apr 25, 2019
Messages
100
Reaction score
37
Location
Ontario, Canada
OK, thanks. I tried that and it did change night mode, but it also changed several of my profile settings for exposure, backlight, etc. which is not gonna work for me. For example, it changed the day night profile setting to auto instead of black-and-white so I can't really see a result by testing during the day of changing to night mode
See my edit of my last post above
 

sage

n3wb
Joined
Jun 11, 2023
Messages
3
Reaction score
0
Location
australia
Maybe a dumb question, but why are we using the api calls via BI with the new GUI cameras? does the custom scene time schedule on the camera not working reliably or something?
 

105437

BIT Beta Team
Joined
Jun 8, 2015
Messages
2,074
Reaction score
964
Maybe a dumb question, but why are we using the api calls via BI with the new GUI cameras? does the custom scene time schedule on the camera not working reliably or something?
It works reliably but it's just tedious to set the times month to month considering the different sunrise and sunset times throughout the year. The API calls allow you to automate the Day/Night switch based on the sunrise/sunset... daily. I ended up giving up on the API calls since using them affected other camera settings. I ended up using the auto day/night switch built into the GUI.
 
Last edited:

CCTVThomas

Getting the hang of it
Joined
Nov 29, 2017
Messages
30
Reaction score
28
Yup. It should set your camera to night mode and Day/Night Color to B&W. Well, at least it does mine :)

BTW: I could not ever get the Day/Night color to change to anything but Auto or B&W no matter whatvalue I set DayNightColor to. I "fixed" this by manual setting the desired Day night Color for night time (or Day time) then hitting "Apply" I now can set Color for Day and B&W for night. I no longer can set this option via this URL to Auto. Not a problem for me but YMMV
Hi, check out this post, maybe that helps: #655
Be sure that working Mode is set to Customized Scene.
What model camera do you have? My T54IR-ZE-S3 & B54IR-Z4E-S3 both work fine with the commands.
This doesn't create any issue with my exposure, backlight, etc.

Here is the API to go to Night profile :

http://USER:pW@IPADDRESS/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[].NightOptions.SwitchMode=3&VideoInOptions[].NightOptions.DayNightColor=0

Here is the API to go to Day profile :

http://USER:pW@IPADDRESS/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[].NightOptions.SwitchMode=0&VideoInOptions[].NightOptions.DayNightColor=0


Night API call for auto color mode
http://USER:pW@IPADDRESS/cgi-bin/configManager.cgi?action=setConfig&VideoInOptions[].NightOptions.SwitchMode=3&VideoInOptions[].NightOptions.DayNightColor=1
 
Top