Dahua day/night switch utility - DahuaSunriseSunset

Look as if I'll be taking advantage of this too. My camera only focuses 'near'- anything less than 'near' is out of focus- massively so. Autofocus fails at all ranges... it would be funny if it wasn't brand new.

as an aside, it seems to only let me local OR NAS, not both. That's... new?
 
Noticed this morning that some of my cams were still sitting in IR mode. I took a look at the DahuaSunriseSunsetErrors log and noted the following:

1629645432697.png
Any idea as to why the DahuaSunriseSunset utility decided to run the Sunset script instead of the sunrise script this morning? You can see it was running without a problem alternating between sunrise and sunset until this morning.
 
  • Wow
Reactions: sebastiantombs
Noticed this morning that some of my cams were still sitting in IR mode. I took a look at the DahuaSunriseSunsetErrors log and noted the following:

View attachment 99314
Any idea as to why the DahuaSunriseSunset utility decided to run the Sunset script instead of the sunrise script this morning? You can see it was running without a problem alternating between sunrise and sunset until this morning.
Same thing happened to me two days ago. Mine switched to night about 4hrs early. I didnt look at the log tho, I just rebooted and didnt think twice about it. Seems to be working fine since.
 
I have recently been having issues with this utility after running fine for a very long time. This morning, all cams were still in IR mode. I rebooted and that didn't fix the issue. I uninstalled the utility service and then re-installed it. Checked the log and it showed below. No idea what has changed. Seems like it is backward.

9/5/2021 9:41:26 AM DahuaSunriseSunset 1.6.0.0 Service OnStop
9/5/2021 9:41:41 AM DahuaSunriseSunset 1.6.0.0 Service Manager Startup
9/5/2021 9:41:56 AM DahuaSunriseSunset 1.6.0.0 Service OnStart
9/5/2021 9:41:56 AM TriggerSunsetActions
 
It's really strange, I can't figure out what's going on. During the day each time I stop and start the service it runs the trigger for sunset.

9/5/2021 1:41:28 PM DahuaSunriseSunset 1.6.0.0 Service Manager Startup
9/5/2021 1:42:25 PM DahuaSunriseSunset 1.6.0.0 Service OnStop
9/5/2021 1:42:29 PM DahuaSunriseSunset 1.6.0.0 Service OnStart
9/5/2021 1:42:29 PM TriggerSunsetActions

Also, when I view the next sunrise/sunset... it doesn't show today's sunset occurring next. Is this normal?

1630864058279.png
 

Attachments

  • 1630863974034.png
    1630863974034.png
    28.4 KB · Views: 8
My best guess is the code library that calculates sunrise and sunset times is buggy. As I haven't used this app in years, I am not inclined to put more time and effort into it.
 
  • Like
Reactions: Flintstone61
My best guess is the code library that calculates sunrise and sunset times is buggy. As I haven't used this app in years, I am not inclined to put more time and effort into it.
Thanks @bp2008... how do you set your cameras to switch day/night? Not by sunrise/sunset, just the sensor in the camera?
 
If anyone is running a Linux box I can share my script I use to change my cameras over for sunrise/sunset.
 
Thanks @bp2008... how do you set your cameras to switch day/night? Not by sunrise/sunset, just the sensor in the camera?

Unfortunately Dahua still hasn't figured this out and thus the reason for this utility to begin with!

If you use the sensor, it will simply use your day settings and simply switch color to B/W. This only works for the unknowing user that leaves everything at default/auito. Most of us use different shutter speeds day and night and contrast, etc. are different as well.

You either use this utility or go in to the camera and use the schedule feature, but that will require you to go in periodically to change when it is nighttime based on changing sunsets and sunrises.

I bet in your case, your time must be off just a bit and when it runs it is confused? Are you using NTP to sync all the devices?
 
Unfortunately Dahua still hasn't figured this out and thus the reason for this utility to begin with!

If you use the sensor, it will simply use your day settings and simply switch color to B/W. This only works for the unknowing user that leaves everything at default/auito. Most of us use different shutter speeds day and night and contrast, etc. are different as well.

You either use this utility or go in to the camera and use the schedule feature, but that will require you to go in periodically to change when it is nighttime based on changing sunsets and sunrises.

I bet in your case, your time must be off just a bit and when it runs it is confused? Are you using NTP to sync all the devices?
It's really strange, been working great forever and all of the sudden it started failing. All of my cameras use the same NTP server.
 
If you have Home Assistant home automation (free), a LUX light sensor (found in weather stations) and the Dahua Home Assistant integration... you can do lots of things! Including auto sunrise/sunset based on the LUX.
 
  • Like
Reactions: bp2008
If you have Home Assistant home automation (free), a LUX light sensor (found in weather stations) and the Dahua Home Assistant integration... you can do lots of things! Including auto sunrise/sunset based on the LUX.
I use Smartthings for all of my home automations. I need to search for a Dahua integration. Thanks!
 
  • Like
Reactions: bp2008
My utility is working fine. I had one day in all the time this happened and it was a time issue.
 
If anyone is running a Linux box I can share my script I use to change my cameras over for sunrise/sunset.
I'd love to see that. Definitely a Linux newbie, but hey...

I'm running Linux Mint as my daily driver now. Works great, simple to setup.
 
What was the nature of your time issue?

One of my cams somehow got off the wrong time zone and it was missing the correct day/night setting, which doesn't make sense because the utility simply says oh it is sunrise change to day setting, so maybe it was purely coincidental, but when I corrected the time zone, the problem went away.
 
I'd love to see that. Definitely a Linux newbie, but hey...

I'm running Linux Mint as my daily driver now. Works great, simple to setup.
 
Thanks @biggen for that. I am currently the utility on Windows without a problem. But ultimately one must know that it will fail for good, maybe with WIN11.

When that happens to me, I will use your utility. I believe that I could run that on a Raspberry Pi?