Dahua day/night switch utility - DahuaSunriseSunset

Purduephotog

Getting the hang of it
Joined
Oct 30, 2016
Messages
204
Reaction score
77
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?
 

Sybertiger

Known around here
Joined
Jun 30, 2018
Messages
4,539
Reaction score
13,069
Location
Orlando
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.
 

whoami ™

Pulling my weight
Joined
Aug 4, 2019
Messages
230
Reaction score
224
Location
South Florida
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.
 

105437

BIT Beta Team
Joined
Jun 8, 2015
Messages
1,996
Reaction score
882
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
 

105437

BIT Beta Team
Joined
Jun 8, 2015
Messages
1,996
Reaction score
882
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

bp2008

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

105437

BIT Beta Team
Joined
Jun 8, 2015
Messages
1,996
Reaction score
882
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?
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,539
Reaction score
2,765
If anyone is running a Linux box I can share my script I use to change my cameras over for sunrise/sunset.
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,448
Reaction score
47,574
Location
USA
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?
 

105437

BIT Beta Team
Joined
Jun 8, 2015
Messages
1,996
Reaction score
882
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.
 
Joined
May 1, 2019
Messages
2,215
Reaction score
3,504
Location
Reno, NV
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.
 

105437

BIT Beta Team
Joined
Jun 8, 2015
Messages
1,996
Reaction score
882
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!
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,448
Reaction score
47,574
Location
USA
My utility is working fine. I had one day in all the time this happened and it was a time issue.
 

TVille

Getting comfortable
Joined
Apr 26, 2014
Messages
672
Reaction score
1,639
Location
Virginia
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.
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,448
Reaction score
47,574
Location
USA
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.
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,539
Reaction score
2,765
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.
 
Joined
Aug 8, 2018
Messages
7,386
Reaction score
25,889
Location
Spring, Texas
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?
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,539
Reaction score
2,765
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?
Yup. No issue at all on a RPi.
 
Top