This project is a lightweight API written in RUST that enables interaction with Elgato devices such as Elgato LightStrips or Elgato KeyLights.
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.
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
usingjq
for prettier syntax:ecc-api | jq
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
The whole comunication is via HTTP using JSON.
{
"numberOfLights": 1,
"lights": [
{
"on": 1,
"hue": 332.000000,
"saturation": 81.000000,
"brightness": 99
}
]
}
{
"numberOfLights": 1,
"lights": [
{
"on": 1,
"brightness": 12,
"temperature": 143
}
]
}