CLI for controlling a Tuya 3-way power strip over LAN
Project description
Tuya Outlet CLI
A simple Python CLI to control a Tuya-compatible 3-way smart power strip over your local network without using the Tuya cloud (except once during setup). Basically just a simple wrapper around the awesome tinytuya project.
Features
- Turn each plug on/off individually
- Show status including plug states and energy data (voltage, current, power)
- Simple setup command for device configuration
- Robust configuration management with timeout and retry options
Installation
Option 1: Install from PyPI (Recommended)
pip install tuya-strip
Option 2: Install from Source
-
Install Poetry
-
Clone this repo:
git clone https://github.com/wanjawischmeier/tuya-strip.git
cd tuya-strip
- Install dependencies:
poetry install
Setup
Configure your device credentials:
tuya-strip setup
The setup command will prompt you to enter your device details:
- Device ID
- Device IP address
- Local Key
- Protocol Version (default: 3.3)
Configuration is saved to your home directory (~/.tuya-strip) and will work from any directory.
[!NOTE]
If you installed from source, prefix all commands withpoetry run(e.g.,poetry run tuya-strip setup)
Usage
tuya-strip status # Show current state and energy data
tuya-strip on 1 # Turn on plug 1
tuya-strip off 3 # Turn off plug 3
tuya-strip --timeout 5 status # Use custom timeout
tuya-strip --retries 5 on 2 # Use custom retry count
Example Output
Loading config from: C:\Users\username\.tuya-strip
Switches: {'1': True, '2': False, '3': True}
Energy: {'voltage_V': 229, 'current_mA': 120, 'power_W': 24}
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tuya_strip-0.1.1.tar.gz.
File metadata
- Download URL: tuya_strip-0.1.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44aa8f4a01a170a7c1c5a44348b9b7fe9f970ab93dd8b35771dfa10f38807b81
|
|
| MD5 |
9fac68b4391b11bf210f7db59608bb95
|
|
| BLAKE2b-256 |
bd2b62f814de7eb17ffe72e5807a5d6a5980399863bdcfae974f09edd2656b1c
|
Provenance
The following attestation bundles were made for tuya_strip-0.1.1.tar.gz:
Publisher:
python-publish.yml on wanjawischmeier/tuya-strip
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tuya_strip-0.1.1.tar.gz -
Subject digest:
44aa8f4a01a170a7c1c5a44348b9b7fe9f970ab93dd8b35771dfa10f38807b81 - Sigstore transparency entry: 464908088
- Sigstore integration time:
-
Permalink:
wanjawischmeier/tuya-strip@439e9feb81efaf0b0820544f838fc227c4a52ad8 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/wanjawischmeier
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@439e9feb81efaf0b0820544f838fc227c4a52ad8 -
Trigger Event:
release
-
Statement type:
File details
Details for the file tuya_strip-0.1.1-py3-none-any.whl.
File metadata
- Download URL: tuya_strip-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90bf376cc48501d106ece8e91deabfc8dc54d8181620082066207db290f39749
|
|
| MD5 |
776d4f41a2607f26bcb8de80b5c3969e
|
|
| BLAKE2b-256 |
819ad538141baedb84b73589ba6c887b280db84fba245f081568a547fef4a407
|
Provenance
The following attestation bundles were made for tuya_strip-0.1.1-py3-none-any.whl:
Publisher:
python-publish.yml on wanjawischmeier/tuya-strip
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tuya_strip-0.1.1-py3-none-any.whl -
Subject digest:
90bf376cc48501d106ece8e91deabfc8dc54d8181620082066207db290f39749 - Sigstore transparency entry: 464908121
- Sigstore integration time:
-
Permalink:
wanjawischmeier/tuya-strip@439e9feb81efaf0b0820544f838fc227c4a52ad8 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/wanjawischmeier
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@439e9feb81efaf0b0820544f838fc227c4a52ad8 -
Trigger Event:
release
-
Statement type: