Code Monkey home page Code Monkey logo

avea-cli's Introduction

๐Ÿ’กAvea-CLI

A Swift Command Line Interface to interact with Elgato Avea light bulbs.

The script currently starts up and looks for the first Bluetooth LE device containing the name "Avea". It then connects and sends the desired bytes to modify the bulb's color or brightness.

The implementation wouldn't be possible without knowing the details of which bytes to send, so kudos to Marmelatze for figuring that out.

Requirements: macOS 10.0, Swift 3


๐Ÿ›  Setup

Note: Xcode is required to compile the executable

  • Clone the repo

    $ git clone https://github.com/vfuc/avea-cli
    $ cd avea-cli


  • Run the build.sh script to compile the binary

    $ ./build.sh


  • Run the binary in the folder

    $ ./avea


or if you're feeling fancy you can - Link the binary to `/usr/local/bin` to be able to run it everywhere (replace the link with the path to the compiled binary):
`$ sudo cp [link/to/compiled/avea] /usr/local/bin/`

๐ŸŽ› Usage

Set the color

The color is set using red, green, blue and white values in the range of 0-255 with the set-color-rgbw command or its short form rgbw.

$ avea set-color-rgbw [red] [green] [blue] [white]
$ avea rgbw [red] [green] [blue] [white]
Set the brightness

Color and brightness are set independently of each other as they are two different commands sent to the bulb. Use values in the range of 0-255 with the command set-brightness or just b.

$ avea set-brightness [value]
$ avea b [value]
Turn the bulb off
$ avea off

Color descriptors

Because I'm too lazy to type out raw values I added color descriptors, they're pretty self-explanatory. The data is stored as JSON in the ~/.avea/avea-colors.json file

Show available colors
$ avea show-colors

Available colors: 

[blue] Red: 0, Green: 5, Blue: 255, White: 10
[green] Red: 0, Green: 255, Blue: 0, White: 10
[red] Red: 255, Green: 0, Blue: 0, White: 15
[yellow] Red: 255, Green: 255, Blue: 0, White: 10
[orange] Red: 255, Green: 75, Blue: 0, White: 0
[purple] Red: 200, Green: 0, Blue: 250, White: 0
[pink] Red: 220, Green: 0, Blue: 80, White: 10
[white] Red: 0, Green: 0, Blue: 0, White: 255
[white-warm] Red: 200, Green: 100, Blue: 0, White: 175
[white-cold] Red: 0, Green: 100, Blue: 200, White: 175
[white-pinkish] Red: 100, Green: 0, Blue: 100, White: 200
Setting color
$ avea set-color [descriptor]
$ avea c [descriptor]
Adding color
$ avea add-color [descriptor] [red] [green] [blue] [white]
Deleting color
$ avea delete-color [descriptor]

๐Ÿค” Caveats

At the moment I only have a single "avea bulb", so I haven't worked on multi-device support yet and don't know if it works with the "sphere" and "flare" products as well.

Occasionally, the bulb is not discoverable and the script will look for it indefinitely. This seems to be an issue with the bulb itself though, as I experience it with the iOS client as well.


๐Ÿ™‹ Contributing

Issues and Pull Requests are welcome, of course :)

I included some basic default colors, but please add to them if there's a cool one you found!

avea-cli's People

Contributors

vfuc avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.