Dahua day/night switch utility - DahuaSunriseSunset

Discussion in 'Dahua' started by bp2008, Mar 29, 2017.

Share This Page

  1. bp2008

    bp2008 Staff Member

    Joined:
    Mar 10, 2014
    Messages:
    8,064
    Likes Received:
    4,896
    I wanted to use stronger noise reduction at night and weaker during the day, but Dahua seems to have made a mess of the profile management. There doesn't seem to be a way to have the camera switch automatically between Day and Night profiles when the camera changes between "Color" and "Black & White" mode.

    The Profile Management tab has a "Normal" mode which is evidently supposed to do this (IPC/Camera Configuration - Dahua Wiki). But I just tried it. It doesn't do that at all. Choosing "Normal" just makes the camera use a third profile, which is neither "Day" or "Night" but a separate third profile called "Normal", which stores settings independently of the "Day" and "Night" profiles.

    Dahua engineers must live in a world where it is perfectly acceptable to say:
    or
    Now I know why Nayr has his profile management scripted externally, but even that seems to be a mess: Switch Dahua Day/Night Profile via IPC HTTP API

    Update

    I've written Windows software to take care of this.

    GitHub - bp2008/DahuaSunriseSunset: A Windows Service which changes the profile of dahua cameras between Night and Day at each sunset and sunrise.
     
    Last edited: Nov 28, 2017
    TVT73, Mike, tech101 and 10 others like this.
  2. hmjgriffon

    hmjgriffon Known around here

    Joined:
    Mar 30, 2014
    Messages:
    3,383
    Likes Received:
    973
    Location:
    North Florida
    It's actually very easy to switch the profile with a script, I'm thinking about doing it with one of my cameras so I can give it a little bit of wdr during the day and turn it off at night, day profile and night profile

    Sent from my Nexus 6P using Tapatalk
     
  3. TVT73

    TVT73 Pulling my weight

    Joined:
    Aug 29, 2016
    Messages:
    401
    Likes Received:
    102
    Location:
    Germany
    I also can´t understand, why this silly simple day/night switching together with ir-cut is possible, i can´t imagine that it would be difficult to program.:banghead:
     
  4. Fastb

    Fastb Known around here

    Joined:
    Feb 9, 2016
    Messages:
    1,194
    Likes Received:
    696
    Location:
    Seattle, Wa
    I too was very puzzled by the profiles. I also concluded that whatever profile is chosen, it's in use 24/7. So there are 3 profiles, 2 of which are useless. Unless I write a script to brute-force a profile change by some non-NVR entity sending a command string.

    If the profiles were switchable, maybe by scheduling "Day" and "Night", that would be a useful NVR feature, right out-of-the-box. For the varifocal Starlight Cams, it would be reaaly nice to have the cam's "Focus" parameter change as well. Right now, we can pick one focus value, and it's used 24/7. Even though the cam's image is clearest with a different focus setting for night and for day.

    Maybe the same script that changes the profile could also change the focus setting?

    Fastb
     
  5. TVT73

    TVT73 Pulling my weight

    Joined:
    Aug 29, 2016
    Messages:
    401
    Likes Received:
    102
    Location:
    Germany
    @Fastb
    i would like you to invite to a issue ticket for the focus day/night problem. I am very sad about this problem, and maybe we need to be more to get dahua working on it. I am glad about to find other users who agree this issue!
     
  6. aristobrat

    aristobrat IPCT Contributor

    Joined:
    Dec 5, 2016
    Messages:
    1,821
    Likes Received:
    1,444
    My 5231s let me schedule when I want the profiles to change between night and day?

    Not a perfect solution, as when it gets dark changes daily, but it sounds like some Dahua cameras might not even have that option?
     
  7. fenderman

    fenderman Staff Member

    Joined:
    Mar 9, 2014
    Messages:
    29,354
    Likes Received:
    8,717
    every camera has that option something must be wrong with the firmware......problem is you dont want to mess with it year round...
     
  8. hmjgriffon

    hmjgriffon Known around here

    Joined:
    Mar 30, 2014
    Messages:
    3,383
    Likes Received:
    973
    Location:
    North Florida
    I just set this up today for an outdoor camera to give it a little bit of WDR during the day in domoticz, simple script:


    HTML:
    commandArray = {}
    
    -- Switch cameras to day profile
    if (timeofday['Daytime']) then
            commandArray['OpenURL']='http://user:pwd@10.0.0.125/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=0'
    
    -- Switch cameras to night profile
    elseif (timeofday['Nighttime']) then
            commandArray['OpenURL']='http://user:pwd@10.0.0.125/cgi-bin/configManager.cgi?action=setConfig&VideoInMode[0].Config[0]=1'
    end
    
    return commandArray

    All I have to do now is add URL's for any other cameras I want to change profiles with, and this will change based on sunrise and sunset. :)
     
    aristobrat likes this.
  9. nayr

    nayr IPCT Contributor

    Joined:
    Jul 16, 2014
    Messages:
    9,350
    Likes Received:
    5,223
    Location:
    Denver, CO
    IIRC BlueIris can switch between day/night profiles at Sunrise/Sunset
     
  10. hmjgriffon

    hmjgriffon Known around here

    Joined:
    Mar 30, 2014
    Messages:
    3,383
    Likes Received:
    973
    Location:
    North Florida
    I think he is looking for profiles on the camera but then what exactly they are trying to do is a little confusing lol.
     
  11. bp2008

    bp2008 Staff Member

    Joined:
    Mar 10, 2014
    Messages:
    8,064
    Likes Received:
    4,896
    Blue Iris can automate many predefined things at sunrise or sunset, even silly things like "Pan left" or "Mode 50Hz". Changing a Dahua camera's profile to Day or Night is not one of the options.
     
  12. nayr

    nayr IPCT Contributor

    Joined:
    Jul 16, 2014
    Messages:
    9,350
    Likes Received:
    5,223
    Location:
    Denver, CO
    IR On - Night Profile / IR Off - Day Profile

    Give it a shot, IR Auto I think is Normal Profile
     
    hmjgriffon likes this.
  13. hmjgriffon

    hmjgriffon Known around here

    Joined:
    Mar 30, 2014
    Messages:
    3,383
    Likes Received:
    973
    Location:
    North Florida
    IR controls don't work on my dahua turrets but it does work on the two hikvision cams I have. But other things do work like PTZ presets in BI change the PTZ presets I have created in the PTZ camera, heh.
     
  14. nayr

    nayr IPCT Contributor

    Joined:
    Jul 16, 2014
    Messages:
    9,350
    Likes Received:
    5,223
    Location:
    Denver, CO
    Since IR control on Dahua's is really just switching profiles it requires you to setup your Day profile to Forced Color, Night Profile to Forced B&W and Normal Profile to Auto (default) directly on the cameras WebUI for that kind of behavior, out of the box all 3 profiles are Auto switch based off light sensor so that button dont seem to do anything unless you setup variation in the profiles.
     
    hmjgriffon likes this.
  15. bp2008

    bp2008 Staff Member

    Joined:
    Mar 10, 2014
    Messages:
    8,064
    Likes Received:
    4,896
    Actually, it seems that IR On / Off commands from Blue Iris change just the Day & Night mode option, not the currently selected profile. I hate that Blue Iris even has an IR toggle button, because clicking it toggles between IR On and Off, and to get back to Auto mode which is what you want in 99.99% of cases, you have to dig back into the camera's web interface and set it there. Or I guess you could schedule an IR Auto command to happen in the near future. But there is no button that I know of that will simply issue this command.
     
  16. fenderman

    fenderman Staff Member

    Joined:
    Mar 9, 2014
    Messages:
    29,354
    Likes Received:
    8,717
    You can get back to auto by simply holding down the toggle button...this works on both the mobile app and server.
     
  17. bp2008

    bp2008 Staff Member

    Joined:
    Mar 10, 2014
    Messages:
    8,064
    Likes Received:
    4,896
    Aha, thanks for letting me know. Now that I know this I may consider implementing the button in UI2, except if I do it, it will be a toggle button with 3 toggle states... or a dropdown box or something. The most common option shouldn't be the one that is almost an easter egg.
     
    fenderman and hmjgriffon like this.
  18. nayr

    nayr IPCT Contributor

    Joined:
    Jul 16, 2014
    Messages:
    9,350
    Likes Received:
    5,223
    Location:
    Denver, CO
    If only there was some sort of manual or help file that could be used to document this stuff in; we could call it the.. ermm, BlueIris Bible?
     
    awsum140, aristobrat and hmjgriffon like this.
  19. fenderman

    fenderman Staff Member

    Joined:
    Mar 9, 2014
    Messages:
    29,354
    Likes Received:
    8,717
    To be fair, its not in the help file itself, its in a 2013 release note..
    3.26.00 - May 30, 2013

    • Several new buttons have been added to the main UI in the PTZ area. These include focus near/far, IR lights, as well as Listen and Talk. Note that each of these functions are initially functional only for a small subset of cameras such as the Foscam 89xx (and its dozens of compatibles) as well as the Agasio 522/622 (and its dozens of compatibles). If your camera is not among these, yet supports these features, Blue Iris support may be in the works.

    • Clicking the IR button will toggle between on and off, while holding it down will switch to "auto" mode if the camera supports this functionality and Blue Iris knows the corresponding command to send to the camera.
     
  20. bp2008

    bp2008 Staff Member

    Joined:
    Mar 10, 2014
    Messages:
    8,064
    Likes Received:
    4,896
    Hah. I even searched the help file for that, but after the button wasn't mentioned in the "Camera Properties - PTZ" topic that contained a screenshot of the IR button (among others), I thought it was simply not documented.

    In hindsight I should have scrolled through the What's New topic too because Ken often describes features in there and nowhere else.