External, independent control of Dahua IR LEDs and Alarm output via API

Joined
Feb 16, 2020
Messages
9
Reaction score
6
Location
Slovenia
Hello,

I currently have IPC-T5442T-ZE and 2x IPC-B5442E-ZE, and in the process of ordering 6 more. I like T(urret) version more, but B(ullet) has alarm output - considering which one to buy based on the problems below.

1. I noticed that integrated IR LEDs are too spotlight focused, so I would like to use external ones. That is simple, just solder cables instead of internal LEDs and connect them to external LEDs. I tested these 850 nm 10 W and they work exceptionally well, and they consume less power than 730 nm while producing the same brightness. I will probably use 3 W versions and mount them apart, to achieve even better and more uniform coverage.

2. In addition to that, I would like to add some white external LEDs. I use Home Assistant (and Blue Iris) and I would program the automation so that IR LEDs are normally used at night, but when motion is detected, I would like to turn off (integrated) IR LEDs and turn on external white LEDs.
For last 2 days, I have a hard time searching for any API documentation about how to control internal IR LEDs and external Alarm output (for Bullet version) completely independently, that is from Node RED (MQTT, HTTP) from Home Assistant. Is this even possible?

I could just disable internal LEDs and attach both external IR LEDs and white LEDs to "smart WiFi switch" powered from the camera (ESP8266 running ESPHome FW), but this has additional problems:
A. Some of the cameras are located pretty far away (Cat.7 23 AWG PoE cable), where there is no WiFi signal, so I cannot use classic ESP8266 WiFi module with 2 relays.
B. If I would use ethernet module instead of WiFi (e.g. WT32-ETH01 which is ESP32 with RJ45 connector), then I would need PoE powered switch at every camera, splitting 1 PoE cable to the camera and relay module, and powering all 3 devices (switch, camera, ethernet relay board).
C. I would need some additional logic to decide when to turn on IR LEDs instead of leaving this decision to the camera doing this automatically.

These solutions seem kind of nonsense, considering that B5442E already has 2 controllable outputs. Just how to control them? Moreover, does the T5442T have any internal pins on the PCB, which I could use for Alarm output, despite the fact that they're not connected outside of the housing? In short, the perfect combination for me would be IPC-T5442T-ZE with 2 remotely-controllable GPIOs (soldering is OK, I'm electronic engineer).

Thank you!
 
Last edited:

eggsan

Getting comfortable
Joined
Jul 24, 2015
Messages
619
Reaction score
528
just in case you need to experiment with external relays (network controlled), it allows both wired/wireless control (app via p2p). Tested for about 2 months, quite reliable. Main intention to be used for remote gate opener, light and siren activation (deterrent). Not sure if any API docuamentation is available.

 

user8963

Known around here
Joined
Nov 26, 2018
Messages
1,465
Reaction score
2,315
Location
Christmas Island
. I noticed that integrated IR LEDs are too spotlight focused, so I would like to use external ones. That is simple, just solder cables instead of internal LEDs and connect them to external LEDs. I tested these 850 nm 10 W and they work exceptionally well, and they consume less power than 730 nm while producing the same brightness. I will probably use 3 W versions and mount them apart, to achieve even better and more uniform coverage.
are you using auto mode ? which firmware ?
 
Joined
Feb 16, 2020
Messages
9
Reaction score
6
Location
Slovenia
just in case you need to experiment with external relays (network controlled), it allows both wired/wireless control (app via p2p). Tested for about 2 months, quite reliable. Main intention to be used for remote gate opener, light and siren activation (deterrent). Not sure if any API docuamentation is available.

Thank you for the answer, however the (additional) hardware is not a problem, I make and program my own. Usually I flash ESPHome firmware for perfect integration with Home Assistant (and known API). But, I want to avoid using additional WiFi/Ethernet module, because of the A. and B. points in the original post.

are you using auto mode ? which firmware ?
Firmware is V2.820.15OG004.0.R, Build Date: 2021-07-29, from this post.
Currently I'm using Auto mode, but this can be set to Manual. Moreover, because of the point C. in the original post, is there an API which would tell me that "the camera would turn on the IR LEDs now, if the mode wouldn't be set to Manual", so I can detect this an turn the IR LEDs on manually at a proper time?
 

Alaska Country

Getting comfortable
Joined
Jun 10, 2021
Messages
449
Reaction score
657
Location
Alaska
Have not tested these HTTP calls. May work for some Dahua cameras and no go for others.

Turn on light
Code:
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Lighting[0][0].FarLight[0].Light=10&Lighting[0][0].NearLight[0].Light=90&Lighting[0][0].Mode=Manual
Shift the light to ZoomPrio mode
Code:
http://192.168.1.108/cgi-bin/configManager.cgi?action=setConfig&Lighting[0][0].Correction=50&Lighting[0][0].Mode=ZoomPrio
Parameters in URL

head = Lighting[ChannelNo][ConfigNo]
 

wittaj

IPCT Contributor
Joined
Apr 28, 2019
Messages
25,129
Reaction score
48,993
Location
USA
You need to dial the camera in to your field of view. Staying on auto/default will never result in acceptable performance, especially at night. Ghost and blur and IR washout is common with auto/default settings.

Blinding white from IR usually disappears once you get it off of auto and then you may not need external IR.

In my opinion, shutter (exposure) and gain are the two most important and then base the others off of it. Shutter is more important than FPS. It is the shutter speed that prevents motion blur, not FPS. 15 FPS is more than enough for surveillance cameras as we are not producing Hollywood movies. Match iframes to FPS. 15FPS is all that is usually needed.

Many people do not realize there is manual shutter that lets you adjust shutter and gain and a shutter priority that only lets you adjust shutter speed but not gain. The higher the gain, the bigger the noise and see-through ghosting start to appear because the noise is amplified. Most people select shutter priority and run a faster shutter than they should because it is likely being done at 100 gain, so it is actually defeating their purpose of a faster shutter.

But first, run H264, smart codec off, CBR, and 8192 bitrate to start. This should make it more crisp.

Go into shutter settings and change to manual shutter and start with custom shutter as ms and change to 0-8.3ms and gain 0-50 (night) and 0-30 (day)for starters. Auto could have a shutter speed of 100ms or more with a gain at 100 and shutter priority could result in gain up at 100 which will contribute to significant ghosting and that blinding white you will get from the infrared.

Now what you will notice immediately at night is that your image gets A LOT darker. That faster the shutter, the more light that is needed. But it is a balance. The nice bright night image results in Casper during motion LOL. What do we want, a nice static image or a clean image when there is motion introduced to the scene?

So if it is too dark, then start adding ms to the time. Go to 10ms, 12ms, etc. until you find what you feel is acceptable as an image. Then have someone walk around and see if you can get a clean shot. Try not to go above 16.67ms (but certainly not above 30ms) as that tends to be the point where blur starts to occur. Conversely, if it is still bright, then drop down in time to get a faster shutter.

You can also adjust brightness and contrast to improve the image.

You can also add some gain to brighten the image - but the higher the gain, the more ghosting you get. Some cameras can go to 70 or so before it is an issue and some can't go over 50.

But adjusting those two settings will have the biggest impact. The next one is noise reduction. Want to keep that as low as possible. Depending on the amount of light you have, you might be able to get down to 40 or so at night (again camera dependent) and 20-30 during the day, but take it as low as you can before it gets too noisy. Again this one is a balance as well. Too smooth and no noise can result in soft images and contribute to blur.

Do not use backlight features until you have exhausted every other parameter setting. And if you do have to use backlight, take it down as low as possible.

After every setting adjustment, have someone walk around outside and see if you can freeze-frame to get a clean image. If not, keep changing until you do. Clean motion pictures are what we are after, not a clean static image.
 
Joined
Feb 16, 2020
Messages
9
Reaction score
6
Location
Slovenia
Thank you both. After searching around a bit more, I found some API documents where the URLs that Alaska Country posted are described, and found out that I can set the lights from there. I need to test a bit more for alarms functionality.

I have only tried setting Illuminator to Manual on the IPC-T5442T-ZE, where you only have 1 slider, basically making no major difference between 1 and 100. But when I tried on IPC-B5442E-ZE, I found out it has Near and Far illuminator setting - setting Far to 0 and Near to anything 1 to 100 drastically improves night vision and it is basically the same as using external IR LEDs :wow: As soon as I set Far to 1, bright spot in the middle of the pavement adjusts the contrast (ZoomPrio is also not as good).

It seems like that despite I already have Andy's invoice for 6x IPC-T5442T-ZE waiting for me, I will change that to 6x IPC-B5442E-ZE.

Otherwise, I want to switch to external white LEDs to get a color image after motion is detected, and to also utilize the cameras as "sensor activated LED flood lights". It seems that may be possible using API, will post here after I learn more and test.

wittaj, thank you very much for all info - I am doing many things wrong. First, I will wait for RAM upgrade to arrive (Dell OptiPlex 3060 kinda struggles with BI + HA with memory on 99%, upgrading RAM from 8 to 32 GB), then I will re-configure all cameras based on your tips and others I found around the forum. I was using 3 different cameras for now to see how it goes and which model to buy mode. Seems like it can only get better than my current setup.
 

user8963

Known around here
Joined
Nov 26, 2018
Messages
1,465
Reaction score
2,315
Location
Christmas Island
I have only tried setting Illuminator to Manual on the IPC-T5442T-ZE, where you only have 1 slider, basically making no major difference between 1 and 100. But when I tried on IPC-B5442E-ZE, I found out it has Near and Far illuminator setting - setting
Yep.
Thats the most annoying thing about the turrets i found out too late.
If i could make the decision today, i would choose the bullet.

Not sure if its only firmware. The turret has 2 IRs, the bullet 4.
 

cctv-dave

Getting the hang of it
Joined
Mar 25, 2021
Messages
128
Reaction score
87
Location
yes
With the older style IR LEDS which were a ring of what I'll call standard looking ones, just opening the cam and bending each one towards the outside of the circle would fix the spot light issue somewhat.
With SMD ones, a little solder heat and bending does the same thing depending on the design.
Problem is in production with pick and place machines they are always going to be installed vertically.

Now people are using custom lenses over the top of SMD LEDs you'd think it would be easy to persuade them to make the lens a non-uniform-circular pattern.
Been trying...
They seem to like hot spots. I guess it helps inflate the IR distance numbers.
 

Alaska Country

Getting comfortable
Joined
Jun 10, 2021
Messages
449
Reaction score
657
Location
Alaska
I want to switch to external white LEDs to get a color image after motion is detected, and to also utilize the cameras as "sensor activated LED flood lights". It seems that may be possible using API, will post here after I learn more and test.
Yes, please post your results after testing.
 
Top