TP-Link VIGI Camera Lights

Hopefully this is in the correct section.

I found the floodlight toggle switch available on my Reolink cameras incredibly useful, so I have (to some extent) implemented something similar for the VIGI cameras.

I’ve created this python script that allows controlling the white LEDs. It connects to an MQTT broker for control, and takes in a config file for the broker credentials and camera information.

An configuration file with two cameras could look as such:

{
    "mqtt_host": "10.0.0.50",
    "mqtt_username": "MQTTUN",
    "mqtt_password": "MQTTPW",
    "cameras": [
        {
            "name": "front_door",
            "ip": "10.0.0.21",
            "username": "CAMUN",
            "password": "CAMPW"
        },
        {
            "name": "driveway",
            "ip": "10.0.0.22",
            "username": "CAMUN",
            "password": "CAMPW"
        }
}

The script automatically retrieves login tokens and will re-authenticate when they expire.

For each camera specified in config.json, the script will subscribe to the topic vigi_leds/{name}/mode - publish ‘on’ on this topic to turn the white lights on, and ‘off’ (or any other string) to turn them back off. I use a few helper toggles and an automation on the HA side for this.

The script works by changing two settings on the camera - to turn the white LEDs on, it changes the illuminator mode to ‘always on’ and changes the night vision mode to ‘white light’. To turn the LEDs back off, it changes the illuminator mode back to automatic and the night vision mode back to infrared.

The script is licensed under the GPLv3, and may be redistributed or changed with attribution. I know this isn’t particularly elegant or efficient, but it works for my purposes and I hope it can be of use to others as well.

Since I’m currently researching Vigi cameras (especially the C540V model) and you also use a Vigi, I have a question: Since you’ve probably integrated them under HA via HA Onvif integration, can you tell me which entities (controls, sensors, etc.) are available under HA? I’m particularly interested in whether the AI/IVS functions (line, region, object removal, … detections)


are also available under HA when integrated via HA Onvif integration. Unfortunately, I can’t find any comments from other users on this.

BTW: The Vigi cameras are OEM models from Dahua, some of which have a somewhat “slimmed down” feature set, and I’ve been using only Dahua cameras and NVRs for years. When I integrate the Dahua cameras via HA Onvif integration, all of their IVS features are available. Only the human and vehicle classification for motion detection is missing, but that’s not a big deal for me since I only work with line and field detection anyway.

Example: Dahua DH-SD49225XA-HNR camera via Onvif

PS: Of course I am also familiar with the discussion here Support for TP-Link VIGI Two-Way Audio · Issue #1470 · AlexxIT/go2rtc · GitHub. :slightly_smiling_face:

Hi Jim, I must admit that I don’t consume the camera feeds directly. The feeds are consumed by frigate which re-broadcasts.

I did connect one of my C430s through ONVIF to check for you. The camera is on v2.0.3 (240529) and does not expose very much at all.

Apparently the PTZ controls are exposed through ONVIF, but I only have fixed cameras.

There’s a chance that with further poking through the undocumented API, you could get the data. Not sure it’s worth the effort with how easy Frigate is to set up or how easy it is to get cameras that give up the information easily.

1 Like

Thank you for testing this for me! :+1: OK, according to the screenshot, there aren’t really many sensors. However, with the Dahua cameras and the HA Onvif integration, the additional detection sensors only appear in HA once they’ve been triggered for the first time.

Unfortunately, there’s no current, published version of the TP Link Open API. When a user inquired about it in the TP Link forum, he was told to contact TP Link sales, who might then provide API documentation. I don’t want to go to that trouble, so I’m hoping that a few users with Vigi cameras might post their experiences with integrating it via Onvif.

The topic of what is available via Onvif for Vigi cameras is also relevant to my Dahua NVR, since the Vigi camera would then also have to be integrated via Onvif. Even though Vigi NVRs are also slimmed-down OEM models from Dahua. Nevertheless, a Vigi camera cannot be integrated directly into a Dahua NVR, but only via Onvif, and thus only the Onvif features are available there.

Edit: The fact that there’s no motion detection sensor is odd, though, because it should be there immediately and always. The IVS and line detection sensors on Dahua cameras only appear after they’ve been triggered for the first time.