Dahua day/night switch utility - DahuaSunriseSunset

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
 
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...
 
@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
 
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.
 
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.
 
@bp2008... here's what I found in the syslog.
 

Attachments

  • Screen Shot 2019-07-06 at 9.47.12 PM.png
    Screen Shot 2019-07-06 at 9.47.12 PM.png
    347.7 KB · Views: 59
  • Screen Shot 2019-07-06 at 9.47.36 PM.png
    Screen Shot 2019-07-06 at 9.47.36 PM.png
    366.1 KB · Views: 57
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.?
 
If anyone uses Hubitat for home automation, this can be done through there super easy.
 
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.
 
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.
 
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.
 
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?
 
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.
 
  • Like
Reactions: bigrob444
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:
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.
 
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.
 
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.

For what its worth, this bug is fixed in version 1.4.1. bp2008/DahuaSunriseSunset
 
  • Like
Reactions: looney2ns
There should be a toggle to toggle on or off the logging. I had zero errors and the log file was still 3GB