Dahua day/night switch utility - DahuaSunriseSunset

With the help of @105437 I was able to reproduce the issue and find a solution. In this case I think my initial suspicion was right. It seems that with the code library I was using for sunrise/sunset calculation, if you use UTC timestamps and the event (sunset in this case) is near midnight, it could trigger this issue. Fortunately using timestamps in local time seems to solve the issue.

Version 1.7 is released.
 
With the help of @105437 I was able to reproduce the issue and find a solution. In this case I think my initial suspicion was right. It seems that with the code library I was using for sunrise/sunset calculation, if you use UTC timestamps and the event (sunset in this case) is near midnight, it could trigger this issue. Fortunately using timestamps in local time seems to solve the issue.

Version 1.7 is released.
Thanks Brian.
 
With the help of @105437 I was able to reproduce the issue and find a solution. In this case I think my initial suspicion was right. It seems that with the code library I was using for sunrise/sunset calculation, if you use UTC timestamps and the event (sunset in this case) is near midnight, it could trigger this issue. Fortunately using timestamps in local time seems to solve the issue.

Version 1.7 is released.
Thanks!!!
Hope it was not too hard to correct.
 
With the help of @105437 I was able to reproduce the issue and find a solution. In this case I think my initial suspicion was right. It seems that with the code library I was using for sunrise/sunset calculation, if you use UTC timestamps and the event (sunset in this case) is near midnight, it could trigger this issue. Fortunately using timestamps in local time seems to solve the issue.

Version 1.7 is released.

Awesome - thanks for doing that - if we download this, is this considered "new" and we will need to input our cameras and settings again, or does it come in as a update and leaves our settings intact?

I guess that explains why my one camera that had wandered off the time zone was having an issue!
 
With the help of @105437 I was able to reproduce the issue and find a solution. In this case I think my initial suspicion was right. It seems that with the code library I was using for sunrise/sunset calculation, if you use UTC timestamps and the event (sunset in this case) is near midnight, it could trigger this issue. Fortunately using timestamps in local time seems to solve the issue.

Version 1.7 is released.
bp2008 thanks for all your hard work on DahuaSunriseSunset and UI3
New Release Version 1.8
1631763780537.png
 
Yes, thank you! Mine had just happened to have that happen today, so it forced me to update it LOL. All is good now.
 
Have a Dahua NVR plus a number of Dahua cameras. Have a new HFW 5849 that has a schedule (orange/black slider) for day/night and as others have stated it has to be manually updated to account for changes in sunset/sunrise. Is it correct to assume that this Windows program will require that a windows computer be on 24/7 for the program to properly operate?

Using a Hubitat: S2 Z-Wave Plus 700 Series Model C-7 Hub to control outside lighting that works well for sunrise/sunset plus an offset. Again would assume that integrating this hub for Dahua use is not a viable possibility.

At this time of year the sunset/sunrise times change by 40 minutes per week or at the rate of 5 min and 40 sec per day.

Thank you,

Jim
 
Last edited:
Using a Hubitat: S2 Z-Wave Plus 700 Series Model C-7 Hub to control outside lighting that works well for sunrise/sunset plus an offset. Again would assume that integrating this hub for Dahua use is not a viable possibility.

No, this utility does not support being remotely controlled. It would be mostly pointless because anything capable of sending a command to this utility should be able to send commands to the cameras directly.
 
Have a Dahua NVR plus a number of Dahua cameras. Have a new HFW 5849 that has a schedule (orange/black slider) for day/night and as others have stated it has to be manually updated to account for changes in sunset/sunrise. Is it correct to assume that this Windows program will require that a windows computer be on 24/7 for the program to properly operate?

Using a Hubitat: S2 Z-Wave Plus 700 Series Model C-7 Hub to control outside lighting that works well for sunrise/sunset plus an offset. Again would assume that integrating this hub for Dahua use is not a viable possibility.

At this time of year the sunset/sunrise times change by 40 minutes per week or at the rate of 5 min and 40 sec per day.

Thank you,

Jim
there is a home assistant Dahua IP camera integration that would solve your issue, if using HA. Dunno's about HomeSeer or other platforms.
 
Noticed this comment on the Hubitat forum.

"I use Dahua POE cameras, choose these after doing some reading on ipcamtalk.com. They have worked very well for me. I use Blue Iris software for the cameras which integrates very well with Hubitat. The Blue Iris software allows for the sending of a local end-point trigger when motion is detected. For me, this is enough integration, but if you need more this is a popular Hubitat app BI Control - Local Blue Iris control."


Hubitat Link
 
  • Like
Reactions: TVille
I have Hubitat but haven't linked it to BI yet. The app linked is now 3 years old. I'd love to link them together.

Sent from my Pixel 4a using Tapatalk
 
I just wanted to double check... I have a DHI-NVR6A08-32-4KS2 Dahua NVR. I'd like to make use of this day/night utility. Would ANY simple Windows 10 PC support running this app? Purchase a cheap Intel i3 proc w/ 8GB memory on a desktop/mini that runs this and is always off and never goes into sleep mode, and that's basically it?
 
Hubitat C7 Hub Update

Made up a simple rule using the Rules Machine in the hub and the Hubitat changed the test Dahua camera from day to night and back again. Have not, at this point, fully tested the cameras using the hub for full day/night settings control. From initial testing it appears the Hubitat C7 Hub when using the Rules Machine can be used to control the switch from day to night for Dahua cameras at sun rise/set with a plus or minus time offset.
 
  • Like
Reactions: TVille
A cheap computer will work for the utility, but you will have to install the computer on the NVR POE port side as the cameras are put on a 10.x.x.x IP address range, so it wouldn't talk to the computer on the other side of the NVR.
 
  • Like
Reactions: Flintstone61
No, this utility does not support being remotely controlled. It would be mostly pointless because anything capable of sending a command to this utility should be able to send commands to the cameras directly.
I am trying to us an Arduino Uno with an ambient light sensor to change the cameras into night mode when it gets too dark due clouds during the day. The problem I am having that Dahua cameras use Digest Authentication. I have not been able to get that type of authentication to work from the Arduino, there is not much documention out there for this type of authentication in regards to the Arduino.

Being able to control your utility remotely would be awesome.