Dahua day/night switch utility - DahuaSunriseSunset

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,007
Location
USA
You don't need to set zoom/focus unless you want to set zoom and focus (and obviously you need to have a camera with a motorized varifocal lens).

Setting the profile is just one command, nothing is required before or after.
 

trock

Young grasshopper
Joined
Feb 7, 2016
Messages
41
Reaction score
2
I have the dahua utility setup and running. The sunrise/sunset times are correct when I verify the times. I left the focus and the zoom blank as i do not want to change any of the values. I have different settings for the NIght/Day in the dahua settings since I am "attempting" to capture license plates and the settings are different for the night time capture. However, it appears that most of the time it does not change from the day to night profile. I also noticed that my focus is out of adjustment the following morning.

I have also used the capture "Current Zoom/Focus" and manually set the focus/zoom for both the day and night profile, however that did not change anything. The service is running and the IP:username, etc are correct in the configuration.

Any ideas?

Thanks in advance.
 

trock

Young grasshopper
Joined
Feb 7, 2016
Messages
41
Reaction score
2
I have the dahua utility setup and running. The sunrise/sunset times are correct when I verify the times. I left the focus and the zoom blank as i do not want to change any of the values. I have different settings for the NIght/Day in the dahua settings since I am "attempting" to capture license plates and the settings are different for the night time capture. However, it appears that most of the time it does not change from the day to night profile. I also noticed that my focus is out of adjustment the following morning.

I have also used the capture "Current Zoom/Focus" and manually set the focus/zoom for both the day and night profile, however that did not change anything. The service is running and the IP:username, etc are correct in the configuration.

Any ideas?

Thanks in advance.
I want to add that when I manually "Simulate Sunrise/Sunset" it will change the profile from Day to Night....
 

bitmite

n3wb
Joined
Apr 9, 2017
Messages
7
Reaction score
5
I want to add that when I manually "Simulate Sunrise/Sunset" it will change the profile from Day to Night....
I have to have the application (sunrise/sunset app) and the service for mine to activate, the windows service alone doesn't seem to work form me currently.
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,007
Location
USA
I want to add that when I manually "Simulate Sunrise/Sunset" it will change the profile from Day to Night....
Check the log file. It should be making a log entry upon each sunrise/sunset, and if there are any errors when it tries to change the profile, those should be logged too.

I have to have the application (sunrise/sunset app) and the service for mine to activate, the windows service alone doesn't seem to work form me currently.
The service manager window does not run the scheduled profile changes. That is 100% the responsibility of the service, so having the window open shouldn't have any effect at all on how the service behaves.
 

tomw

Getting the hang of it
Joined
Nov 30, 2015
Messages
114
Reaction score
22
Thankyou OP for this tool! very handy!
 

trock

Young grasshopper
Joined
Feb 7, 2016
Messages
41
Reaction score
2
Check the log file. It should be making a log entry upon each sunrise/sunset, and if there are any errors when it tries to change the profile, those should be logged too.



The service manager window does not run the scheduled profile changes. That is 100% the responsibility of the service, so having the window open shouldn't have any effect at all on how the service behaves.
Here are the log files:

2/27/2018 5:46:00 AM TriggerSunriseActions
2/27/2018 7:21:00 PM TriggerSunsetActions
2/27/2018 8:11:16 PM TriggerSunsetActions
2/28/2018 5:45:00 AM TriggerSunriseActions
2/28/2018 7:22:00 PM TriggerSunsetActions
3/1/2018 5:44:00 AM TriggerSunriseActions
3/1/2018 6:59:09 PM DahuaSunriseSunset 1.2.1.0 Service OnStop
3/1/2018 6:59:13 PM DahuaSunriseSunset 1.2.1.0 Service OnStart
3/1/2018 6:59:14 PM TriggerSunriseActions
3/1/2018 7:00:43 PM TriggerSunsetActions
3/1/2018 7:22:00 PM TriggerSunsetActions
3/2/2018 5:43:00 AM TriggerSunriseActions
3/2/2018 6:54:42 PM DahuaSunriseSunset 1.2.1.0 Service OnStop
3/2/2018 6:54:45 PM DahuaSunriseSunset 1.2.1.0 Service OnStart
3/2/2018 6:54:45 PM TriggerSunriseActions

I just checked and the profile is still set to day, it never changed to night. I also verified that the service is running and that the application is open....

After looking more closely at the log it looks like it triggered the "day" profile at 6:54PM?? I checked the application and the sunrise time is 6:24AM and the sunset time is set to 6:24PM.
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,007
Location
USA
Upon service start, it specifically does set the profile to whatever it thinks it should be at the current time. Are you sure you have your times right?
 

trock

Young grasshopper
Joined
Feb 7, 2016
Messages
41
Reaction score
2
Upon service start, it specifically does set the profile to whatever it thinks it should be at the current time. Are you sure you have your times right?
When I click "View rise/set" this is what is displayed:

Sunrise at 3/3/2018 6:42:00 AM
Sunset at 3/3/2018 6:24:00 PM
 

Tinman

Known around here
Joined
Nov 2, 2015
Messages
1,209
Reaction score
1,473
Location
USA
Maybe check and see that in the cam's "profile management" you have "full" selected and not schedule.
 

trock

Young grasshopper
Joined
Feb 7, 2016
Messages
41
Reaction score
2
Maybe check and see that in the cam's "profile management" you have "full" selected and not schedule.
Correct, I have full selected. Currently set at full "day". When I manually select Simulate Sunrise or Sunset it does change the profile....not sure what's going on..

Sent from my SM-G955U1 using Tapatalk
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,007
Location
USA
It is calling literally the same code when the triggered by the schedule or when triggered manually, so the result should be identical :/
 

trock

Young grasshopper
Joined
Feb 7, 2016
Messages
41
Reaction score
2
Why are the logs indicating a trigger for sunrise at 6:54PM? It is currently set for sunset at 6:24PM....I did the uninstall and reinstall however that did not fix the issue....

Sent from my SM-G955U1 using Tapatalk
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,007
Location
USA
Because

Upon service start, it specifically does set the profile to whatever it thinks it should be at the current time.
and you had just started the service.

If you stop and start the service right now, what does the log show at the end?

Also what country are you in? There might be regional quirks that I am unaware of.
 

trock

Young grasshopper
Joined
Feb 7, 2016
Messages
41
Reaction score
2
Because



and you had just started the service.

If you stop and start the service right now, what does the log show at the end?

Also what country are you in? There might be regional quirks that I am unaware of.
USA, Eastern
I just stopped and started the service. It should have trigger the sunset...

3/3/2018 6:38:36 PM DahuaSunriseSunset 1.2.1.0 Service OnStop
3/3/2018 6:39:06 PM DahuaSunriseSunset 1.2.1.0 Service OnStart
3/3/2018 6:39:06 PM TriggerSunriseActions
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,007
Location
USA
Argh. You know what I think this is, I think you have set a -1 hour offset for sunrise and +1 hour offset for sunset. When you click "View rise/set", you see the raw calculated rise and set times before offsets are added. So if you have configured a 1 hour sunset offset the scheduler believes your 3/3/2018 sunset is 7:24 PM even though the GUI shows 6:24, and that would explain the behavior.
 

achalmersman

Pulling my weight
Joined
Jan 26, 2017
Messages
267
Reaction score
116
Location
Delaware USA
Am I right in ASSuming this only sends a focus command once? Im having issues with a 5231 Z12 loosing focus. Even during the day with no subjects

Sent from my VS990 using Tapatalk
 

Moose

n3wb
Joined
Feb 24, 2017
Messages
27
Reaction score
6
I’ve got a question for auto launching on windows startup. I’ve got the GUI set to run when windows logs in. How would I then configure it to start the service?


Sent from my iPhone using Tapatalk Pro
 
Top