Skip to main content

yeelight-cli

A dynamic, full-featured CLI wrapper around the python-yeelight package.

Installation

# install remote release
pip install yeelight-cli

# install local copy
cd yeelight-cli
pip install -e .

Usage

Usage:
1. Discover YeeLight bulbs over LAN.
  yeelight scan
2: Register a bulb in ~/yeelight/config.ini
  yeelight config [OPTIONS]
3: Set default bulb
  yeelight config --name=NAME
4. Call bulb method of python-yeelight
  yeelight [OPTIONS] <METHOD> [PARAMS]
5. Print help message
  yeelight [MISC]

MISC:
    --help,-h        print usage
    --version,-v     print version
OPTIONS:
    --name           monitor-light
    --ip             192.168.1.5
    --port           55443
    --effect         smooth
    --duration       300
    --model          None

METHOD:
    turn_off         (light_type=0)
    turn_on          (light_type=0)
    cron_add         (event_type=0,value) minutes for event_type=0, seconds for event_type=1
    cron_del         (event_type=0)
    cron_get         (event_type=0)
    get_capabilities (timeout=2) timeout is in seconds
    set_name         (name)
    set_brightness   (brightness, light_type=0)
    set_default      (light_type=0)
    set_power_mode   (mode)
    set_scene        (scene_class,light_type=0)
    set_color_temp   (degrees, light_type=0)
    set_rgb          (red, green, blue, light_type=0)
    set_hsv          (hue, saturation, value, light_type=0)
    ...and more

PARAMS:
    --light_type     0
    --brightness     80
    ...and more

For bulb methods and parameters, see
https://yeelight.readthedocs.io/en/latest/yeelight.html

Frequent-used Features

# discover bulbs over LAN via a SSDP-like protocol
yeelight scan
# get bulb info
yeelight --ip=192.168.1.5 get_capabilities

# rename a bulb
yeelight --ip=192.168.1.5 set_name --name=monitor-light
# Note: "default" is reserved and cannot be used as name
# register a bulb
yeelight config --name=monitor-light --ip=192.168.1.5 --model=lamp15 --effect=smooth --duration=400
# set default bulb (for later use when calling method without --ip or --name)
yeelight config --name=monitor-light

# rename another bulb
yeelight --ip=192.168.1.6 set_name --name=beside-light
# register another bulb
yeelight config --name=beside-light --ip=192.168.1.6 --model=lamp9 --effect=smooth --duration=400

# inspect bulb registerations (~/yeelight/config.ini)
yeelight config

# turn on bulb
yeelight turn_on            # by default name (if registered and made default)
yeelight --ip=192.168.1.6 turn_on       # by ip
yeelight --name=monitor-light turn_on   # by name (if registered)

# turn on ambient light (for specific models, e.g. lamp15)
yeelight turn_on --light_type=1

# set brightness (1~100) with explicit transition
yeelight set_brightness --brightness=50 --effect=smooth --duration=1000

# set color temperature (2700~6500)
yeelight set_color_temp --degresss=6500

# turn off bulb
yeelight turn_off
yeelight turn_off --light_type=1

Build

# install build tools
pip install --upgrade build twine
# run build
python -m build
# test locally without publishing
pip install dist/yeelight_cli-0.1.0-py3-none-any.whl

Publish to Test PyPI

pip uninstall yeelight-cli

# Create a production account on Test PyPI
# generate a production API token Account Settings > API Tokens
python -m twine upload --repository testpypi dist/*
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ yeelight-cli

Publish to PyPI

pip uninstall yeelight-cli

# Create a production account on PyPI
# generate a production API token Account Settings > API Tokens
python -m twine upload dist/*
pip install --index-url https://pypi.org --extra-index-url https://pypi.org yeelight-cli

Metadata

Release files for yeelight-cli 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yeelight-cli 0.1.0
File Size Uploaded
yeelight_cli-0.1.0.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for yeelight-cli 0.1.0
File Interpreter ABI Platform
yeelight_cli-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.5 kB

Release files / yeelight_cli-0.1.0.tar.gz

Download URL yeelight_cli-0.1.0.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e577cf88782a0f026835bc101ba7ed12472d4b93f589f0463aecf2737a515e2f
BLAKE2b-256 checksum
How to use checksums
1eed7f525630723ef895728a29dd1d768324377e15b344f675d72c6bfe11e459
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / yeelight_cli-0.1.0-py3-none-any.whl

Download URL yeelight_cli-0.1.0-py3-none-any.whl
Size 5.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
791c0a6258f7ea399bf4f4fccf907767e5e29172856f247972f652c4a7d5129a
BLAKE2b-256 checksum
How to use checksums
85810c73950a7dce1df265b2e9f79f9ab5137f920d48bdda11e60235f8fe8333
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page