Dahua day/night switch utility - DahuaSunriseSunset

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,006
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
15,521
Reaction score
22,657
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,352
Reaction score
2,945
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

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,437
Reaction score
47,561
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

IPCT Contributor
Joined
Apr 5, 2017
Messages
2,141
Reaction score
4,118
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

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,437
Reaction score
47,561
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 comfortable
Joined
Jun 10, 2021
Messages
437
Reaction score
632
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

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,437
Reaction score
47,561
Location
USA
Yes, on 24/7 or at least on at sunrise and sunset LOL :lmao:
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,006
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.
 
Joined
May 1, 2019
Messages
2,215
Reaction score
3,504
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 comfortable
Joined
Jun 10, 2021
Messages
437
Reaction score
632
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
672
Reaction score
1,639
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

Getting the hang of it
Joined
Aug 21, 2021
Messages
134
Reaction score
83
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 comfortable
Joined
Jun 10, 2021
Messages
437
Reaction score
632
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

IPCT Contributor
Joined
Apr 28, 2019
Messages
24,437
Reaction score
47,561
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.
 

Fubduck

Getting the hang of it
Joined
Jul 10, 2018
Messages
109
Reaction score
72
Location
colorado
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.
 
Top