Tuya Web Control (Smart Life depuis PC)
2.1K
Python web app to list and control devices from a Tuya/Smart Life account.
status)switch_1 ON/OFF buttonscode + value (JSON) form for all other use casesClient ID (API Key)Client Secreteu, us, cn, in)python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
Edit .env:
TUYA_API_REGION=eu
TUYA_API_KEY=your_client_id
TUYA_API_SECRET=your_secret
TUYA_API_DEVICE_ID=
APP_HOST=127.0.0.1
APP_PORT=8000
TUYA_API_DEVICE_ID is optional, but useful for some accounts/projects.
source .venv/bin/activate
python -m app.main
Then open:
Build the image:
docker build -t tuyaweb .
Run the container with your local .env:
docker run --rm -p 8000:8000 --env-file .env tuyaweb
Then open:
Optional: if you want to change the host-exposed port:
docker run --rm -p 8080:8000 --env-file .env tuya-web-control
Partially and not reliably. Direct login endpoints are unofficial and may break.
A bootstrap attempt script is provided:
source .venv/bin/activate
python scripts/login_password_bootstrap.py --region eu --username "[email protected]" --password "password"
If this does not work, use the recommended method: Client ID + Client Secret.
.env is ignored by git (not tracked)Content type
Image
Digest
sha256:90b64e30a…
Size
60.5 MB
Last updated
4 months ago
docker pull insatomcat/tuyaweb