Dahua day/night switch utility - DahuaSunriseSunset

reeves1985

Pulling my weight
Joined
Sep 13, 2015
Messages
776
Reaction score
241
The day/night schedule is still broken in the new firmware because it greys out the colour/B&W and auto drop-down.

Not a problem to most but for me it's driving me mad as I've got no way to force the camera into B&W other that schedule which is useless as UK daylight and dark times can vary so much.

I run an NVR so can't even use the utility

I've got too much ambient light for the camera itself to go b&W but I'd prefer it in B&W
 

myipcam

Getting the hang of it
Joined
Dec 23, 2018
Messages
132
Reaction score
33
Location
USA
Finally, I am at the point to tackle this profile switching business. I have Dahua IPC-HDW5231R-ZE camera and (correct me if wrong) thought that it would have a "LDR" or Light Dependent Resistor aka, Light Sensor to sense the ambient light and allow for switching profiles.

My design is a little different in that, I am trying to have the camera provide the trigger. Ideally, IF the camera already has a LDR and it CAN switch profiles based on lighting conditions, it would be perfect to use camera's trigger to drive rest of home automation. For example, turn on some lights (porch, driveway etc.) at sunset/low light for couple hours and turn them off afterwards. The trigger is what I need. Turning off is not an issue as the Home automation can be programmed to do that.

Other options I was able to come up with for automation:
1) Use a javascript type solution to calculate sunset/sunrise etc., based on already well published data AND using the coordinates of location and offset time (+/-) as required.
-- The only problem is if it is cloudy and becomes dark earlier than expected, it will be triggered at a later time. Not end of world but not clean either.
2) Use an Arduino to wire an LDR and get data that way. -- This will work without a doubt but requires running wires outside, Arduino, power supply, Ethernet interface,.. tune/adjust levels etc. and overall a bit more work than I want to do (call me lazy :)).

3) lastly, there are some WiFi sensors available but that is the last option... which I am gravitating more towards even though I don't want to...
 

105437

BIT Beta Team
Joined
Jun 8, 2015
Messages
1,995
Reaction score
881
@bp2008... I'm trying to get the service to automatically start when I reboot the BI Windows 10 workstation. So far I've tried "Automatic" and it doesn't start. Any thoughts or ideas? Thanks
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,005
Location
USA
The Install Service button already configures the service to start automatically, and to restart if it crashes. I suspect if it isn't appearing to work then it is probably crashing instantly upon service startup or you may have moved the executable since installing the service.

Try uninstalling and reinstalling the service (through the buttons in the application UI) and if it continues to be a problem, see if there is a log file in the same folder as the exe.
 

105437

BIT Beta Team
Joined
Jun 8, 2015
Messages
1,995
Reaction score
881
The Install Service button already configures the service to start automatically, and to restart if it crashes. I suspect if it isn't appearing to work then it is probably crashing instantly upon service startup or you may have moved the executable since installing the service.

Try uninstalling and reinstalling the service (through the buttons in the application UI) and if it continues to be a problem, see if there is a log file in the same folder as the exe.
Thanks @bp2008... I noticed it after a reboot yesterday and last night the cameras didn't change to Night mode. Everything is installed in the original location so maybe its crashing. I'll check the syslog and see what I can find.
 

drdre84

n3wb
Joined
Jun 30, 2019
Messages
14
Reaction score
2
Location
australia
ipc hdw4631c-a x 6
nvr 4208-8p

i have an issue with motion detect triggering (going off) when the cameras switch between day / night mode at around 7am and 8pm.
idmss sends the alert every day on the hour when the day / night switch occurs.

does anyone know how to fix this . or would the only work around be turn motion detect off for the few minutes it switches between.?
 

bigrob444

Getting the hang of it
Joined
Apr 8, 2017
Messages
52
Reaction score
48
If anyone uses Hubitat for home automation, this can be done through there super easy.
 

Kamakzie

Pulling my weight
Joined
Aug 1, 2017
Messages
243
Reaction score
124
So there is an actual benefit to changing this setting? To me it looked like all the numbers were the same between normal/day/night.
 

bigrob444

Getting the hang of it
Joined
Apr 8, 2017
Messages
52
Reaction score
48
So there is an actual benefit to changing this setting? To me it looked like all the numbers were the same between normal/day/night.
The benefit is that if you have multiple cameras they all change from color to black and white (assuming you have different profiles/colors setup for day/night) at the exact same time. No dealing with one in direct sunlight vs one in the shadows.
 

Rhodesy

Getting the hang of it
Joined
Mar 8, 2018
Messages
175
Reaction score
36
So there is an actual benefit to changing this setting? To me it looked like all the numbers were the same between normal/day/night.
Or in my case, at night I zoom 2 of my cameras to a preset focus so that i can obtain better images under the poorer light conditions at night.
 

Kamakzie

Pulling my weight
Joined
Aug 1, 2017
Messages
243
Reaction score
124
Oh okay the reason I asked was because all my settings are set to 50 on all of the modes. Do you have to do some tweaking?
 

Rhodesy

Getting the hang of it
Joined
Mar 8, 2018
Messages
175
Reaction score
36
Log in to camera at night and set up as you like. You can set up for the best picture possible.
Even if I dont wish to change zoom as on some cameras, I do a minor zoom to know the SS is working.
 

DLONG2

Known around here
Joined
May 17, 2017
Messages
763
Reaction score
454
I had tried the Dahua Sunrise Sunset utility some time ago, and don't run it. But this AM while looking at the files stored on my OneDrive for the Blue Iris projects, I noticed a text file named 'dahuasunrisesunsetErrors' with a file size of 35 GB, with a modification date of yesterday. This text file is in the same folder as the application. Can you look into what may be causing this bloated log file to be present?

Edit: I saw that the application was running on the BI machine as a background process.
Edit: Was able to disable the service.

Curious how a log file can grow to 35 GB.
 
Last edited:

aristobrat

IPCT Contributor
Joined
Dec 5, 2016
Messages
2,982
Reaction score
3,180
Sounds like it got installed as a Windows service, which means it starts automatically every time your computer restarts without you having to do anything manually. I'd suggest running the .EXE again and seeing if there's an option to Uninstall the service.
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,005
Location
USA
Curious how a log file can grow to 35 GB.
I am guessing it was unable to connect to the camera(s) you had configured. I suspect I know where in the code was responsible. The automatic retry logic was missing its retry delay, so certain kinds of failures that happen very quickly could have caused the error log file to grow very rapidly.
 

bigrob444

Getting the hang of it
Joined
Apr 8, 2017
Messages
52
Reaction score
48
There should be a toggle to toggle on or off the logging. I had zero errors and the log file was still 3GB
 

bigrob444

Getting the hang of it
Joined
Apr 8, 2017
Messages
52
Reaction score
48
It had similar lines to this over and over

6/27/2019 3:13:12 PM TriggerSunriseActions
 
Top