Dahua day/night switch utility - DahuaSunriseSunset

105437

BIT Beta Team
Joined
Jun 8, 2015
Messages
2,118
Reaction score
1,019
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,118
Reaction score
1,019
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
1
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,118
Reaction score
1,019
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
44
Reaction score
42
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
 

International784

Getting the hang of it
Joined
Apr 7, 2023
Messages
293
Reaction score
93
Location
USA
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?
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
26,833
Reaction score
52,323
Location
USA
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.
 

International784

Getting the hang of it
Joined
Apr 7, 2023
Messages
293
Reaction score
93
Location
USA
.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

Last edited:

International784

Getting the hang of it
Joined
Apr 7, 2023
Messages
293
Reaction score
93
Location
USA
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

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,752
Reaction score
14,266
Location
USA
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.
 

International784

Getting the hang of it
Joined
Apr 7, 2023
Messages
293
Reaction score
93
Location
USA
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:

flatface

Young grasshopper
Joined
Apr 29, 2023
Messages
30
Reaction score
12
Location
North America
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:
Top