Dahua day/night switch utility - DahuaSunriseSunset

Last edited:
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)
 
  • Like
Reactions: 105437
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:
  • Like
Reactions: 105437
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:
  • Like
Reactions: CCTVThomas
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
 
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?
 
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:
  • Like
Reactions: sage
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
 
  • Like
Reactions: Leroy60 and actran
I just started using the day/night utility program that was written by bp2008. When I use the simulate options, I can toggle between night/day profiles. However, when the actual time comes for the cameras to change profiles automatically, they’re not changing. Is this a common problem with easy remedy?
 
I just started using the day/night utility program that was written by bp2008. When I use the simulate options, I can toggle between night/day profiles. However, when the actual time comes for the cameras to change profiles automatically, they’re not changing. Is this a common problem with easy remedy?

Which GUI do you have? If it is the white/glue GUI the utility won't work for it.

If it is working when you simulate options in the utility, then you probably are missing a minus in your location settings and/or have the wrong location.
 
.The other threads that had the same issue had this error as well. I double checked my numbers my lat is positive and long is negative. I tried with offset and with no offset. My “UTC offset” is -4 hours. The “simulate” works great. Its actual use where I’m having issue. One thing I think may be a clue is that my hours are set:

Sunset at 8/26/2024 6:43:25 PM (time was offset -1 hr)

Sunrise at 8/27/2024 5:34:38 AM (time was offset -1 hr)

Edit: added pictures
 

Attachments

  • IMG_5934.jpeg
    IMG_5934.jpeg
    244.7 KB · Views: 20
  • IMG_5932.png
    IMG_5932.png
    1.7 MB · Views: 20
Last edited:
When hovering the mouse over the “cfg shortcut” on my desktop, there is a message that says sync pending. When the mouse is hovered over both the “.exe” and “errors txt” shortcuts there is a message that says error on both. The utility works when simulating both day and night but not in practice. Should I be allowing something or creating a rule?
 

Attachments

  • IMG_5944.jpeg
    IMG_5944.jpeg
    323.8 KB · Views: 11
  • IMG_5943.png
    IMG_5943.png
    1.1 MB · Views: 11
The sync pending thing is probably OneDrive or a similar cloud storage app. Unrelated to this.

Did you install and start the service? Those are the top 2 buttons in the user interface.
 
Yes sir, I installed and started the service. The service is also running in the background when closed iaw the task manager. The simulate buttons both work as advertised. Now, I can “simulate sunrise” and the camera zooms in and applies day time settings. If I open the .exe the camera reverts back to night time while the utility should be operating on the day profile.

Edit: the camera was set to 24-hour time. I changed it to 12 hour. Idk if that makes a difference?
 
Last edited:
I set up my 9 cameras to use the BlueIris PTZ/Control scheduling for changing from day to night and night to day.

I have it working on 7 out of 9 cameras.

One of the cameras (D54IR-ASE-S3) that isn't working uses the Blue/White GUI. Is there another method to schedule this?

The other camera that isn't working properly is a 5442T. My other 5442T are switching fine, but the one that isn't keeps flipping back and forth between night and day. I have the settings the same as the directions in post #1, as well as they are the same as the other 5442 cameras that are switching properly. When manually triggering the PTZ preset, it switches accordingly, so the URL is correct. Any suggestions?

ptz1.pngptz2.pngptz3.pngptz4.png


Edit: I may have the D54IR working correctly now by setting the camera to the self adaptive working mode.

Edit 2: Okay, through reading back a few pages, I thought that the issue was because I had special characters in my 5442 password. It turns out that the 5442 accidentally had the "auto-cycle patrol" option checked underneath the "PTZ/control -> preset position" submenu option in BI. This was causing it to cycle between PTZ presets, thus flipping between day/night mode.
 
Last edited: