Dahua day/night switch utility - DahuaSunriseSunset

jrbeddow

Getting comfortable
Joined
Oct 26, 2021
Messages
370
Reaction score
485
Location
USA
Good catch, I actually was using the correct notation in BI. When I copied and deleted my user:pass I put in a typo.

I did end up figuring out my issue was enabling https on the camera. I had used a self signed (generated on the camera) cert, that i think was throwing an error in BI. I disabled https on the camera and things are working as expected. FWIW, I first tried running a https: web request and BI was throwing a Web: error: stream XXXX in the logs. I assume this was b/c of the self signed cert. Can anyone confirm and know how to get BI to accept the self signed cert for a web request?
I think you will find that most users here wouldn't bother with https and certificates on a device that should be fully isolated to local (LAN) traffic only. Sounds like way more trouble than it is worth.
 
Last edited:

Joshude

Young grasshopper
Joined
Jan 5, 2021
Messages
30
Reaction score
4
Location
Germany
I'm running DahuaSunriseSunset on 3 Dahua Cams. One of them is not switching day/night like the others. It's always ahead and switching into night-mode too soon.
Can i improve settings on DahuaSunriseSunset or BI to get better results?
 

kjinxx2

Pulling my weight
Joined
Dec 1, 2020
Messages
146
Reaction score
208
Location
USA
Wow - the Blue Iris command is genius! This is working perfectly! One note - it appears that your camera password can't contain an '@' or '.' The command does not successfully issue to the camera. However if I issue the command in web browser it works correctly. I changed my passwords and removed special characters, though it isn't ideal.

Is there any special escape characters I can include in the URL to indicate the the '@' is part of the password?

Thanks!
 

Alaska Country

Getting comfortable
Joined
Jun 10, 2021
Messages
437
Reaction score
632
Location
Alaska
Have been using the "Dahua-Sunrise-Sunset" utility with BI version 5 on a dual NIC Windows 10 system and it works well. The cameras all switch settings as required. Plus the cameras are on their own subnet and isolated from the internet.

The issue is that local sunup/sundown does not take into account sun vs clouds. Is there a method to use an external outside LUX (light sensor) that can trigger this utility on the dual NIC BI Windows 10 computer?

Did noticed, earlier in the thread, that one individual did use a PI plus a LUX sensor, but not sure of all of the technical details for installation and setup.

As a side note, previously used a Hubitat C7 hub for camera switching. However, this will only work if the cameras are on the same network as the hub. A LUX sensor could be added to the Hubitat hub for monitoring light levels and then perhaps somehow be used to trigger the sunrise/sunset utility in place of local sunrise and sunset as one idea.

Suggestions on what to consider and what works would be appreciated.
 

biggen

Known around here
Joined
May 6, 2018
Messages
2,539
Reaction score
2,765
Have been using the "Dahua-Sunrise-Sunset" utility with BI version 5 on a dual NIC Windows 10 system and it works well. The cameras all switch settings as required. Plus the cameras are on their own subnet and isolated from the internet.

The issue is that local sunup/sundown does not take into account sun vs clouds. Is there a method to use an external outside LUX (light sensor) that can trigger this utility on the dual NIC BI Windows 10 computer?

Did noticed, earlier in the thread, that one individual did use a PI plus a LUX sensor, but not sure of all of the technical details for installation and setup.

As a side note, previously used a Hubitat C7 hub for camera switching. However, this will only work if the cameras are on the same network as the hub. A LUX sensor could be added to the Hubitat hub for monitoring light levels and then perhaps somehow be used to trigger the sunrise/sunset utility in place of local sunrise and sunset as one idea.

Suggestions on what to consider and what works would be appreciated.
I'd say most of us don't concern ourselves with clouds. We just pick a time to switch from day to night. All my cameras switch to day/night exactly at sunrise/sunset. Only my LPR camera switches to night 45 minutes before sunset and then back to day 45 minutes after sunrise. That gives it plenty of ambient light to focus after the switch occurs.

I'm sure you could program up a custom utility that incorporates a LUX sensor. It just seems overly complicated to me.
 

perfect777

Young grasshopper
Joined
Mar 18, 2020
Messages
51
Reaction score
14
Location
KC
This is a really cool command - thanks for posting about the BI integration.

I do have a question / problem. I currently have several Loryta IPC-T5442TM-AS cameras. The BI "PTZ Presets" are working great - in that they switch between Day and Night like a charm. My problem is that the "Night" profile locks out the "color" mode - forcing the camera into an IR mode. I have enough street-light for my cameras that color is 100% preferred - even during night time.

Is there a solution to this? Ultimately, I'm trying to set different exposure settings for day and night. Having the same exposure settings 24/7 ruins the quality half the time.

I'll keep digging through this thread and see what I can find.
 

perfect777

Young grasshopper
Joined
Mar 18, 2020
Messages
51
Reaction score
14
Location
KC
Within the camera gui you need to change it from auto to color under the night profile for the day/night setting.
Unfortunately, the "Mode" choices in Day & Night are greyed out when the Night profile is enabled:

2022-07-26_0-49-16.jpg
 

ThomasCamFan

Pulling my weight
Joined
Dec 14, 2020
Messages
135
Reaction score
207
Location
USA
Is there any special escape characters I can include in the URL to indicate the the '@' is part of the password?
Maybe HTML URL encoding will solve this. Change the @ to %40

You also mentioned trouble if a . (period) was used. Its encoded value is %2E

- Thomas
 

SpacemanSpiff

Known around here
Joined
Apr 15, 2021
Messages
1,456
Reaction score
2,432
Location
USA
Eager to hear if the URL encoding will work , or not. Fearing the cleartext password will get 'passed on' without being decoded :/
 

Alaska Country

Getting comfortable
Joined
Jun 10, 2021
Messages
437
Reaction score
632
Location
Alaska
Using the sunset utility with BI on Windows 10. The set and rise times do not parallel the data from the utility under "Next Sunrise and Sunset".

For today (26th) the utility lists rise at 5:18:55 AM and set at 10:55:11 PM - Offset set to zero for both.

Actual sunrise camera switch occurred at 5:24:55 AM.

Computer clock set for correct time.

Why are the times so far off? Is there a fix?

i.e. could just offset the rise by 6 minutes as hack, but that does not solve the issue of why the times do not come close to matching. Will do more checking to see if the time stays at 6 minutes or varies, etc.
 
Top