Dahua day/night switch utility - DahuaSunriseSunset

bp2008

Staff member
Joined
Mar 10, 2014
Messages
11,104
Reaction score
10,033
Location
USA
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.
 

looney2ns

IPCT Contributor
Joined
Sep 25, 2016
Messages
11,992
Reaction score
13,830
Location
Evansville, In. USA
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.
 

Old Timer

Known around here
Joined
Jul 20, 2018
Messages
1,000
Reaction score
2,015
Location
I'm ok
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.
 

wittaj

Known around here
Joined
Apr 28, 2019
Messages
6,712
Reaction score
9,881
Location
USA
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!
 

MikeLud1

Getting comfortable
Joined
Apr 5, 2017
Messages
229
Reaction score
432
Location
Brooklyn, NY
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
 

wittaj

Known around here
Joined
Apr 28, 2019
Messages
6,712
Reaction score
9,881
Location
USA
Yes, thank you! Mine had just happened to have that happen today, so it forced me to update it LOL. All is good now.
 

Alaska Country

Getting the hang of it
Joined
Jun 10, 2021
Messages
31
Reaction score
28
Location
Alaska
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:

wittaj

Known around here
Joined
Apr 28, 2019
Messages
6,712
Reaction score
9,881
Location
USA
Yes, on 24/7 or at least on at sunrise and sunset LOL :lmao:
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
11,104
Reaction score
10,033
Location
USA
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.
 

Holbs

Known around here
Joined
May 1, 2019
Messages
1,624
Reaction score
2,145
Location
Reno, NV
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.
 

Alaska Country

Getting the hang of it
Joined
Jun 10, 2021
Messages
31
Reaction score
28
Location
Alaska
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
 

TVille

Getting comfortable
Joined
Apr 26, 2014
Messages
421
Reaction score
939
Location
Virginia
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
 

JesseSR

Young grasshopper
Joined
Aug 21, 2021
Messages
41
Reaction score
14
Location
USA
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?
 

Alaska Country

Getting the hang of it
Joined
Jun 10, 2021
Messages
31
Reaction score
28
Location
Alaska
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.
 

wittaj

Known around here
Joined
Apr 28, 2019
Messages
6,712
Reaction score
9,881
Location
USA
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.
 
Top