Dahua day/night switch utility - DahuaSunriseSunset

Can anyone that is still running the utility version check their utility log and see if you are having the same issue - I have had no reason to look at the log because I can tell my cameras have gone to night settings or day settings thanks to running LPR.

Tonight I was on the machine when sunset should occur and noticed my cameras hadn't changed yet, so I pull up the log and it shows it tries the sunrise first and goes thru each camera and then repeats sunrise until about a half hour later and then runs the sunset, so it is only delayed by about 30 minutes, but I can't figure out why it is doing this. Sunrise the next morning is fine. I deleted all the attempts below for simplicity, but I noticed it has been doing this since February, but worked fine previously up to that point.

I am guessing there is possibly some time code issue like what had happened before that was fixed in an update.

12/4/2022 5:18:34 PM TriggerSunsetActions
12/5/2022 8:14:14 AM TriggerSunriseActions
12/5/2022 4:47:14 PM TriggerSunriseActions
12/5/2022 5:17:10 PM TriggerSunriseActions
12/5/2022 5:17:10 PM Cancelled web request () due to the next event time being reached.
12/5/2022 5:18:13 PM Cancelled web request () due to the next event time being reached.
12/5/2022 5:18:28 PM TriggerSunsetActions


Took me a few months mostly because I haven't looked at it.

But setup all your profiles
0 is day
1 night
2 general etc

I use the profiles day/night for different settings, but night and general are the same, except the light is set to manual 100%.

Once you have done your profile setup, Save, and then change to self adaptive, and save again.

Now you can run
for day
Code:
curl -s -g --digest -u user:pass "http://ip/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=0"

night
Code:
curl -s -g --digest -u user:pass "http://ip/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=1"

night with illuminator
Code:
curl -s -g --digest -u user:pass "http://ip/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=2"

This works for all my Dahua cams on Web 5.0 running as Shell Commands from Home Assistant. Profile switching will not work via api if you are not in self adaptive mode., but you cant setup the profiles in self adaptive, so set them up first then switch to self adaptive. Here it is on my 4kt180 when I come into view dahua integration sends a human trigger to home assistant, home assistant then switches profile to general turning on the light.
View attachment 1000004084.mp4
 
Last edited:
Took me a few months mostly because I haven't looked at it.

But setup all your profiles
0 is day
1 night
2 general etc

I use the profiles day/night for different settings, but night and general are the same, except the light is set to manual 100%.

Once you have done your profile setup, Save, and then change to self adaptive, and save again.

Now you can run
for day
Code:
curl -s -g --digest -u user:pass "http://ip/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=0"

night
Code:
curl -s -g --digest -u user:pass "http://ip/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=1"

night with illuminator
Code:
curl -s -g --digest -u user:pass "http://ip/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=2"

This works for all my Dahua cams on Web 5.0 running as Shell Commands from Home Assistant. Profile switching will not work via api if you are not in self adaptive mode., but you cant setup the profiles in self adaptive, so set them up first then switch to self adaptive. Here it is on my 4kt180 when I come into view dahua integration sends a human trigger to home assistant, home assistant then switches profile to general turning on the light.

This is most excellent. Thank you! I know you weren't responding to my post asking about the curl commands but I tried yours and they work perfectly!

Today's project will be setting up the script on my OpenWRT router to do the automatic profile switch. With the clocks going back an hour on Sunday the timing to do a test is perfect!

Thanks again
 
View attachment 177868

Can anyone tell me where this app comes from. I downloaded an app (General ConfigTool V5) from the Dahua site but it certainly doesnt look like this.

This thread is a stand-alone utility that only works for Dahua OEM with the old GUI (the grey GUI like you posted).

The newer cameras with the white GUI will not work with this stand-alone utility.

Whatever it was that you downloaded really shouldn't be used LOL and rarely nobody uses that and goes directly into the camera GUI.
 
The person who wrote the software hasn't updated it in about 2 years. (Although if it works, that doesn't really matter.) The author also moved to a different method. Which one is the preferred method?

If you use BlueIris, I would say the BI event/PTZ method (what the author eventually switched to) is the better choice. It basically uses the same commands as the stand alone service, but you are using BI instead of relying on the stand alone service. It removes one more piece of software and failure point from the equation.

I still have the stand alone utility installed because I actually use it to find the precise focus and zoom settings that I then use in my BI web commands. But I don't leave the utility running as a service and I don't use it to change the cameras settings.
 
  • Like
Reactions: looney2ns
If you use BlueIris, I would say the BI event/PTZ method (what the author eventually switched to) is the better choice. It basically uses the same commands as the stand alone service, but you are using BI instead of relying on the stand alone service. It removes one more piece of software and failure point from the equation.

I still have the stand alone utility installed because I actually use it to find the precise focus and zoom settings that I then use in my BI web commands. But I don't leave the utility running as a service and I don't use it to change the cameras settings.
My problem is that the only way I could get this to work is use the Dahua utility Profile Management utility once then this url worked fine (Via BI, Hubitat Hub or browser address bar, etc)

and it would continue to work until I made any changes to basically any camera setting using the Web utility. Once I hit apply the above URL returned error. I would have to start all over again using the Dahua ConfigTool app. Obviously this is not ideal.
 
My problem is that the only way I could get this to work is use the Dahua utility Profile Management utility once then this url worked fine (Via BI, Hubitat Hub or browser address bar, etc)

and it would continue to work until I made any changes to basically any camera setting using the Web utility. Once I hit apply the above URL returned error. I would have to start all over again using the Dahua ConfigTool app. Obviously this is not ideal.
Never mind. This is NOT the way to go. I should have looked into this a bit further and even though the above will (inconsistently) work, @wittaj has found a much better solution here
 
Is there a way to configure the newer cameras like the dahua IPC-Color4K-T180 that runs the new web UI to change the day/night profile via PTZ controls in Blueiris like the old dahua cameras?
 
If you are using an older cameras with Web 4 then the BI Windows sunrise/set utility works fine. However, for the newer Web 5 cameras it will not function.

One work around for Web 5 is to use the PTZ BI hack or use a home automation system to process the HTTP API GET (SET) codes for camera mode switching from day to night, etc.

Could you please elaborate on that? I'm trying the PTZ on my webui 5 camera IPC-Color4K-T180, but it does not work, All my other cameras like the IPC-T5442TM-AS work fine with the PTZ function. I believe the commands must be different.
 
Is there a way to configure the newer cameras like the dahua IPC-Color4K-T180 that runs the new web UI to change the day/night profile via PTZ controls in Blueiris like the old dahua cameras?

not sure about eptz controls but the example I gave above in the video you will see a IPC-Color4kT180 being changed profiles by API calls, just follow my examples above ^^
 
Could you please elaborate on that? I'm trying the PTZ on my webui 5 camera IPC-Color4K-T180, but it does not work, All my other cameras like the IPC-T5442TM-AS work fine with the PTZ function. I believe the commands must be different.

Yes the API commands are different between the old GUI (grey screen) and the new GUI (white screen).
 
Recently purchased an Intel nuc to run the DahuaSunriseSunset software. I am grateful that software developers have created this software, the software itself works great!
I have two questions, is it necessary that the NUC needs access to the internet for the DahuaSunriseSunset to function properly?
If so, does anyone happen to know which UDP / TDP ports DahuaSunriseSunset needs to function?
Because I would like to give the NUC no further access to the internet or possibly as limited access as possible

Question two is about power management for the NUC. Should I set the NUC to never sleep? or does this not affect the DahuaSunriseSunset software.

Thank you!
 
Recently purchased an Intel nuc to run the DahuaSunriseSunset software. I am grateful that software developers have created this software, the software itself works great!
I have two questions, is it necessary that the NUC needs access to the internet for the DahuaSunriseSunset to function properly?
If so, does anyone happen to know which UDP / TDP ports DahuaSunriseSunset needs to function?
Because I would like to give the NUC no further access to the internet or possibly as limited access as possible

Question two is about power management for the NUC. Should I set the NUC to never sleep? or does this not affect the DahuaSunriseSunset software.

Thank you!
Not familiar with this SW but I assume it changes the camera's profile. I perform this via a script I wrote running on a (Hubitat) hub which is on the same LAN as the cameras. No internet is required as long as everything is on the same LAN.
 
Recently purchased an Intel nuc to run the DahuaSunriseSunset software. I am grateful that software developers have created this software, the software itself works great!
I have two questions, is it necessary that the NUC needs access to the internet for the DahuaSunriseSunset to function properly?
If so, does anyone happen to know which UDP / TDP ports DahuaSunriseSunset needs to function?
Because I would like to give the NUC no further access to the internet or possibly as limited access as possible

Question two is about power management for the NUC. Should I set the NUC to never sleep? or does this not affect the DahuaSunriseSunset software.

Thank you!

Which cameras? Keep in mind this utility will not work with newer Dahua cameras on the new GUI (white/blue) and only works on the grey/black GUI.