Skip to content

Lightweight API written in RUST that enables interaction with Elgato devices such as Elgato Light Strips or Elgato Keylights. It provides a baseline interface that can be invoked by other scripts.

License

Notifications You must be signed in to change notification settings

zzampax/Elgato-Control-Center-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Elgato-Control-Center-API


Language Linux Github WAM

ECC

This project is a lightweight API written in RUST that enables interaction with Elgato devices such as Elgato LightStrips or Elgato KeyLights.

Inspiration

This script is heavly inspired by the Elgato-Control-Center project, also written in Rust, this although aims at providing a straightforward CLI API free of any GUI.

Usage

The script provides arguments description via ecc-api --help:

Elgato Control CLI

Usage: ecc-api [OPTIONS]

Options:
      --ip <ip>                    Elgato KeyLight/LightStrip IP address
  -p, --port <port>                Elgato KeyLight/LightStrip port
  -c, --config <config>            Config file providing ip and port, default path ~/.config/elgato-control-center/config.toml
      --toggle                     Turn on/off the Elgato KeyLight/LightStrip
      --hue <hue>                  Set the hue of the Elgato LightStrip
      --saturation <saturation>    Set the saturation of the Elgato LightStrip
      --temperature <temperature>  Set the temperature of the Elgato KeyLight
      --brightness <brightness>    Set the brightness of the Elgato KeyLight/LightStrip
  -h, --help                       Print help
  -V, --version                    Print version

Tip Pipe the output of ecc-api using jq for prettier syntax:

ecc-api | jq

Config File

The IP and Port of the device can be provided using a config.toml file using the following format:

[device]
ip = "192.168.X.X"
port = 9123 # Default Elgato port

The default path is ~/.config/elgato-control-center, the user can manually pass the path with the -c/--config flag

ecc-api -c path/to/config.toml

Or avoid using the config.toml file at all:

ecc-api --ip 192.168.X.X -p 9123

Payload Examples

The whole comunication is via HTTP using JSON.

Elgato LightStrip

{
  "numberOfLights": 1,
  "lights": [
    {
      "on": 1,
      "hue": 332.000000,
      "saturation": 81.000000,
      "brightness": 99
    }
  ]
}

Elgato Keylight

{
  "numberOfLights": 1,
  "lights": [
    {
      "on": 1,
      "brightness": 12,
      "temperature": 143
    }
  ]
}

About

Lightweight API written in RUST that enables interaction with Elgato devices such as Elgato Light Strips or Elgato Keylights. It provides a baseline interface that can be invoked by other scripts.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages