This is year 2022 and TP-Link Tapo devices aren't yet Matter-ready.
This app is a Matter bridge which can be used to turn the Tapo L530E into a Matter device.
The bridge communicates with a single, pre-commissioned Tapo device over WiFi.
The app uses the PyP100 library and can be extended for controlling other TP-Link Tapo devices including the P100, P105, P110 plugs and the L530 bulb.
snapcraft -v
snap install --dangerous <snap-file>
snap set matter-bridge-tapo-lighting ip="tapo device ip"
snap set matter-bridge-tapo-lighting user="tapo user"
snap set matter-bridge-tapo-lighting password="tapo password"
snap connect matter-bridge-tapo-lighting:avahi-control
The avahi-control is necessary to allow discovery of the application via DNS-SD.
To make this work, the host also needs to have a running avahi-daemon which can be installed with sudo apt install avahi-daemon
or snap install avahi
.
sudo snap start matter-bridge-tapo-lighting
sudo snap logs -f matter-bridge-tapo-lighting
Assuming you have setup the Connected Home IP project for Python projects (see Development) at ../connectedhomeip
:
source ../connectedhomeip/out/python_env/bin/activate
IP="tapo device IP" USER="tapo user" PASSWORD="tapo password" python lighting.py
chip-tool pairing ethernet 110 20202021 3840 192.168.1.111 5540
where:
110
is the assigned node id20202021
is the pin code for the bridge app3840
is the discriminator id192.168.1.111
is the IP address of the host for the bridge5540
the the port for the bridge
Alternatively, to commission with discovery which works with DNS-SD:
chip-tool pairing onnetwork 110 20202021
Switching on/off:
chip-tool onoff toggle 110 1 # toggle is stateless and recommended
chip-tool onoff on 110 1
chip-tool onoff off 110 1
where:
onoff
is the matter cluster nameon
/off
/toggle
is the command name. Thetoggle
command is RECOMMENDED because it is stateless. The bridge does not synchronize the actual state of devices.110
is the node id of the bridge app assigned during the commissioning1
is the endpoint of the configured device
Level (brightness) control:
# set max brightness
chip-tool levelcontrol move-to-level 254 0 0 0 110 1
Color control:
# hue (0-254)
chip-tool colorcontrol move-to-hue 50 0 0 0 0 110 1
# saturation (0-254)
chip-tool colorcontrol move-to-saturation 60 0 0 0 110 1
# hue + saturation
chip-tool colorcontrol move-to-hue-and-saturation 50 60 0 0 0 110 1
# color temperature (mired)
chip-tool colorcontrol move-to-color-temperature 400 0 0 0 110 1
Supported range of values:
Parameter | Matter range | Tapo range |
---|---|---|
Hue | 0-254 | 0-359 |
Saturation | 0-254 | 0-100 |
Brightness/Level | 3-254 | 1-100 |
Color temperature | 400-154 mireds | 2500-6500 kelvins |
Assuming you have Ubuntu 22.04 and Python 3.10, install the following dependencies:
sudo apt install git gcc g++ libdbus-1-dev \
ninja-build python3-venv python3-dev \
python3-pip libgirepository1.0-dev libcairo2-dev
# maybe:
# sudo apt install pkg-config libssl-dev libglib2.0-dev libavahi-client-dev libreadline-dev
Shallow clone the Connected Home IP project:
git clone https://github.com/project-chip/connectedhomeip.git --depth=1 --branch=v1.0.0.2
cd ~/connectedhomeip/
scripts/checkout_submodules.py --shallow --platform linux
Build the Python/C libraries:
source ./scripts/activate.sh
./scripts/build_python_device.sh --chip_detail_logging true
Activate the Python env and install the dependencies inside it:
source ./out/python_env/bin/activate
pip install -r build/requirements.txt