Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/apoclyps/magic-home
A CLI and library written in Go for controlling Magic Home LED Strip Controllers.
https://github.com/apoclyps/magic-home
controller go hacktoberfest led light magic-home rgb smart-lights wifi-led-controller
Last synced: about 1 month ago
JSON representation
A CLI and library written in Go for controlling Magic Home LED Strip Controllers.
- Host: GitHub
- URL: https://github.com/apoclyps/magic-home
- Owner: apoclyps
- Created: 2020-09-12T19:36:45.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-20T10:15:09.000Z (about 2 years ago)
- Last Synced: 2024-06-19T11:33:06.062Z (7 months ago)
- Topics: controller, go, hacktoberfest, led, light, magic-home, rgb, smart-lights, wifi-led-controller
- Language: Go
- Homepage:
- Size: 76.2 KB
- Stars: 4
- Watchers: 2
- Forks: 3
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
### Magic Home
![](https://banners.beyondco.de/Magic%20Home.png?theme=light&packageManager=&packageName=go+install+github.com%2Fapoclyps%2Fmagic-home%40latest&pattern=fourPointStars&style=style_2&description=Controlling+your+Magic+Home+LED+light+strips.&md=1&showWatermark=0&fontSize=150px&images=light-bulb)
Magic Home is a CLI & library for controlling RGB LED light strips.
### CLI Usage
```bash
> 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 devicesFlags:
--config string config file (default is $HOME/.magic-home.yaml)
-h, --help help for magic-homeUse "magic-home [command] --help" for more information about a command.
```### Usage
Discover devices on the network.
```bash
> ./magic-home discoverDiscovering ..........
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).
```bash
> ./magic-home power --ip=192.168.0.30 --power=trueSetting power to `on` for 192.168.0.30
```Set the color using a preset name for a target device on the network.
```bash
> ./magic-home device --ip=192.168.0.30 --color=blueSetting 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.
```bash
> ./magic-home device --ip=192.168.0.30 --hex=0000ffSetting device color {0 0 255 0} for 192.168.0.30
```Play a scene for a target device on the network.
```bash
> ./magic-home scene --ip=192.168.0.30 --color=blueSetting 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](./examples/blink/main.go) | Blink device by setting color to white, and toggling device power on/off. |
| [Color](./examples/color/main.go) | Cycle an array of color presets for a device by setting color to each color with a delay between changes. |
| [Discover](./examples/discover/main.go) | Discover a list of available devices on the local network. |
| [Scene](./examples/scene/main.go) | Cycle through an array of colors with a delay between changes for a number of iterations. |
| [State](./examples/state/main.go) | Power a device's on and then power the same device off. |
| [Temperature](./examples/temperature/main.go) | 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.