T180 illuminator light control using the API

tigerwillow1

Known around here
Jul 18, 2016
4,427
9,968
USA, Oregon
I'm trying to turn the lights on and off using the API. It either doesn't work right, or I'm missing something that I'd like to know the solution for.

With the "Get" command , I receive this:

table.Lighting[0][0].Correction=50
table.Lighting[0][0].Mode=Off
table.Lighting[0][0].NearLight[0].Angle=50
table.Lighting[0][0].NearLight[0].Light=0
table.Lighting[0][0].Sensitive=3
table.Lighting[0][1].Correction=50
table.Lighting[0][1].Mode=Off
table.Lighting[0][1].NearLight[0].Angle=50
table.Lighting[0][1].NearLight[0].Light=50
table.Lighting[0][1].Sensitive=3
table.Lighting[0][2].Correction=50
table.Lighting[0][2].Mode=Manual
table.Lighting[0][2].NearLight[0].Angle=50
table.Lighting[0][2].NearLight[0].Light=5
table.Lighting[0][2].Sensitive=3
table.Lighting[0][3].Correction=50
table.Lighting[0][3].Mode=Auto
table.Lighting[0][3].NearLight[0].Angle=50
table.Lighting[0][3].NearLight[0].Light=50
table.Lighting[0][3].Sensitive=3

The only parameter I'm focusing on is: table.Lighting[0][2].Mode=Manual, which is for the Night profile.
So starting out, the light is on, and the Get command says: table.Lighting[0][2].Mode=Manual

If I change the mode to Off on the web GUI, the change is correctly reflected in the Get command: table.Lighting[0][2].Mode=Off

I then use the Set command - I expect the light to turn back on, but it does not.
- The Get command shows the setting was indeed changed: table.Lighting[0][2].Mode=Manual
- The web GUI still says the Mode is Off.

So changing the setting in the GUI does the proper action and changes what's in the Get command config table.
Changing the setting using the API causes no action but still changes what's in the Get command config table.

It feels like the camera is keeping 2 different configuration tables, one for itself and one for the API. When changing a setting with the GUI, both tables are changed, but when using the API only one is changed, and the camera doesn't use that one.

Maybe there's another command I need to use, similar to pressing "Apply" in the GUI?
 
I think we determined in the 4K-T that the light itself isn't available as an API command.

The work around hack is to change the profile by API.

So I set up a profile with the light on and then used the API command to send it to that profile to turn on light and then another API command to change profile to one without the light.
 
Edit: Answer in the next post.

I can't find an API command to change the profile. The latest API spec I have is V2.8.4. Help!
 
Last edited:
The secret to controlling the T180 (and I assume 4K-T) LED has been revealed in this post: Dahua IPC-Color4K-T has anyone figure out API to operate the LED?
There is indeed a second data structure that is the one really used by the camera. Some examples:

Get lighting configuration:
Set illuminator mode: (or Off, Auto, etc)
(the [1] in [0][1][0] is for the Night profile. It looks like all 9 profiles can be accessed)

Set brightness: