Ok.... so the Dahua sunrise / sunset utility written by bp2008 is a great utility and does 80% of what I need. The problem with it is that it does not do a focus "watchdog" and re-apply the focus commands as needed. I modified this script written by the person in the quote below to keep one of my LPRs in focus at night. The problem is that I don't know how to modify the script to work with the bp2008 utility. You see, if I could have the scrip below check the current schedule setting and apply X focus IF schedule = DAY and Y focus IF schedule = Night I would be golden. Unfortunately I don't know how to do that. Right now my LPR stays blurry during the day because I prioritize night video. This is at my church. Unfortunately just running the bp2008 utility by itself does no good with the Z12 starlight because the camera looses focus on its own day and night. It really is irritating that Dahua can't acknowledge and fix this problem but that's another subject. And it's not because "its not designed for LPR duty" because it does it in the daytime. So if I bought this camera to watch grass grow at 100' away I wouldn't be able to do it. Totally unacceptable in 2018. Thanks for any and all help! Andrew
Figured I would post this in case it is helpful for anyone determining how often they need to refocus.(It turns out that my camera really does not loose focus very often.) You have to have AutoHotKey installed. Place the code in a text file with an .ahk extension. The code will check the current focus, compare it to your desired focus, and write to a log file whether the program needed to change the focus on the camera or if you were already in focus. I plan to run this every hour for a week and then I'll know when I typically loose focus and just run it during those times. You will need to modify the code to include your specific focus and zoom levels, mine are 0.778333 and 0.865225 respectively. You'll also need to enter your own IP and USERNAME and PASSWORD. (I'm not a programmer and so it's probably not the most elegant way to do it, but it worksThe Log file it creates will look like:
Nov-15 11:00PM Focus Unchnaged
Nov-15 11:00PM Focus Unchnaged
Nov-15 11:00PM Focus Reset
Nov-15 11:01PM Focus Unchnaged
Nov-16 05:41AM Focus Unchanged
The AutoHotKey Code:
poststrings =
(Ltrim
http://USERNAME:YOURPASSWORD@YOURIP/cgi-bin/devVideoInput.cgi?action=getFocusStatus
)
loop, parse, poststrings, `n,`r
{
poststring := A_LoopField
URLDownloadToFile,%poststring%, LPR_Focus_Status.txt
}
Sleep, 2000
FormatTime, time, A_now, MMM-d hh:mmtt
FileReadLine, FocusRawData, LPR_Focus_Status.txt, 1
StringTrimLeft, CurrentFocus, FocusRawData, 13
ifEqual, CurrentFocus, 0.778333
{
FileAppend, %Time% Focus Unchanged `n, LPR_Focus_Log.txt
Exitapp
}
else {
poststrings =
(Ltrim
http://USERNAME:YOURPASSWORD@YOURIP...tion=adjustFocus&focus=0.778333&zoom=0.865225
)
loop, parse, poststrings, `n,`r
{
poststring := A_LoopField
URLDownloadToFile,%poststring%, LPR_Test_and_Set_Response.txt
FileAppend, %Time% Focus Reset `n, LPR_Focus_Log.txt
}
}