Skip to content
This repository was archived by the owner on Jan 7, 2025. It is now read-only.

archived-by-mrugesh/lights

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Lights - Docker Wrapper for python-miio Yeelights

Docker Pulls License: MIT

This project provides a Docker wrapper for the python-miio library, allowing easy interaction with Mi Home devices, particularly Yeelight smart lights, across different platforms.

Yeelight is a brand of smart LED bulbs that can be controlled remotely via Wi-Fi. This tool allows you to control your Yeelight devices using simple command-line instructions.

Table of Contents

Prerequisites

  • Docker installed on your system
  • A Yeelight device on your local network

Finding Your Device's IP and Token

Before you can control your Yeelight device, you need to know its IP address and token:

Refer to the python-miio token extraction guide for detailed instructions.

Usage

  1. Build the image:

    docker build -t lights -f Dockerfile .
  2. Run the container with the following command:

    docker run --rm lights [COMMAND] [OPTIONS]

    Replace [COMMAND] and [OPTIONS] with the specific miiocli command and options you want to use.

  3. To control a Yeelight device, use the following format:

    docker run --rm lights yeelight --ip [YOUR_DEVICE_IP] --token [YOUR_DEVICE_TOKEN] [COMMAND]

    For example, to turn on a Yeelight bulb:

    docker run --rm lights yeelight --ip 192.168.0.XX --token xxxxxxxx on

Available Commands

Here are some of the available commands for Yeelight devices:

  • on: Power on the device
  • off: Power off the device
  • toggle: Toggle the device state
  • set_brightness: Set the brightness level
  • set_color_temp: Set the color temperature in Kelvin
  • set_rgb: Set the color in RGB
  • status: Retrieve device properties

For a full list of commands and options, run:

docker run --rm lights yeelight --help

Using the Published Image

This image is published on Docker Hub as mrugesh/lights. To use the published image instead of building it locally, replace the docker run commands above with:

docker run --rm mrugesh/lights [COMMAND] [OPTIONS]

For example:

docker run --rm mrugesh/lights yeelight --ip 192.168.0.XX --token xxxxxxxx on

Building the Image for Docker Hub

  1. Build the image locally:
    docker build -t lights -f Dockerfile .
  2. Tag and push to Docker Hub:
    docker tag lights mrugesh/lights:latest
    docker push mrugesh/lights:latest

Notes

  • Make sure your Yeelight device is on the same network as your Docker host.
  • The --token is required for authentication. You can find this token using the Mi Home app or other methods described in the python-miio documentation.
  • This Docker image is designed to be stateless. Each command runs in a new container instance, which is removed after execution (--rm flag).

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is open-source and available under the MIT License.

About

Docker Wrapper for python-miio Yeelights

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published