Skip to content

A CLI and library written in Go for controlling Magic Home LED Strip Controllers.

Notifications You must be signed in to change notification settings

apoclyps/magic-home

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Magic Home

Magic Home is a CLI & library for controlling RGB LED light strips.

CLI Usage

> go build .

> ./magic-home

Control Magic Home enabled devices.

  Allows control of LED strips and bulbs compatiable with the Magic Home App (Devices must be connected to the same LAN).

Usage:
  magic-home [command]

Available Commands:
  device      Control device of specific devices
  discover    Discover Magic Home Devices
  help        Help about any command
  power       Control power of specific devices
  scene       Control scene using specific devices

Flags:
  --config string       config file (default is $HOME/.magic-home.yaml)
  -h, --help            help for magic-home

Use "magic-home [command] --help" for more information about a command.

Usage

Discover devices on the network.

> ./magic-home discover

Discovering ..........

Discovered the following devices:

IP         	| ID         	| Model
-----------------------------------
192.168.0.30	| C44F33AEB69A	| AK001-ZJ210
192.168.0.32	| D8F15B8446DF	| AK001-ZJ210

Power on a device on the network (using the previous color set).

> ./magic-home power --ip=192.168.0.30 --power=true

Setting power to `on` for 192.168.0.30

Set the color using a preset name for a target device on the network.

> ./magic-home device --ip=192.168.0.30 --color=blue

Setting device color {0 0 255 0} for 192.168.0.30

Set the color using a hex value for a target device on the network.

> ./magic-home device --ip=192.168.0.30 --hex=0000ff

Setting device color {0 0 255 0} for 192.168.0.30

Play a scene for a target device on the network.

> ./magic-home scene --ip=192.168.0.30 --color=blue

Setting device color {0 0 255 0} for 192.168.0.30
Setting device color {0 0 55 0} for 192.168.0.30
Setting device color {0 0 255 0} for 192.168.0.30
Setting device color {0 0 55 0} for 192.168.0.30
Setting device color {0 0 255 0} for 192.168.0.30
Setting device color {0 0 55 0} for 192.168.0.30
Setting device color {0 0 255 0} for 192.168.0.30

Example

Name Description
Blink Blink device by setting color to white, and toggling device power on/off.
Color Cycle an array of color presets for a device by setting color to each color with a delay between changes.
Discover Discover a list of available devices on the local network.
Scene Cycle through an array of colors with a delay between changes for a number of iterations.
State Power a device's on and then power the same device off.
Temperature Cycle an array of color temperatures for a device by setting color to each color with a delay between changes.

Disclaimer

As this library controls physical hardware on a LAN, you should use your judgment to decide if the changes you are making may negatively impact your hardware.

About

A CLI and library written in Go for controlling Magic Home LED Strip Controllers.

Topics

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Languages