Skip to main content

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

  1. Install Poetry

  2. Clone this repo:

git clone https://github.com/wanjawischmeier/tuya-strip.git
cd tuya-strip
  1. 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 with poetry 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

tuya_strip-0.1.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tuya_strip-0.1.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

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

Hashes for tuya_strip-0.1.1.tar.gz
Algorithm Hash digest
SHA256 44aa8f4a01a170a7c1c5a44348b9b7fe9f970ab93dd8b35771dfa10f38807b81
MD5 9fac68b4391b11bf210f7db59608bb95
BLAKE2b-256 bd2b62f814de7eb17ffe72e5807a5d6a5980399863bdcfae974f09edd2656b1c

See more details on using hashes here.

Provenance

The following attestation bundles were made for tuya_strip-0.1.1.tar.gz:

Publisher: python-publish.yml on wanjawischmeier/tuya-strip

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for tuya_strip-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 90bf376cc48501d106ece8e91deabfc8dc54d8181620082066207db290f39749
MD5 776d4f41a2607f26bcb8de80b5c3969e
BLAKE2b-256 819ad538141baedb84b73589ba6c887b280db84fba245f081568a547fef4a407

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page