ioBroker / AdapterRequests

This Place is used to track the status of new Adapter-Requests.
248 stars 36 forks source link

Elgato Key Light / Key Light Air / Key Light Ring #704

Open KoMa1978 opened 2 years ago

KoMa1978 commented 2 years ago

Hallo Community,

ein Adapter für Elgato Key Light / Key Light Air / Key Light Ring (https://www.elgato.com/) wäre klasse.

Dann könnte man zum Einen den Status einzelner Leuchten auslesen und nutzen, zum Anderen könnte man die Leuchten automatisieren und über z.B. Homematic IP Taster die Studio/Streaming Beleuchtung aktivieren, ohne auf ein StreamDeck oder mehrere Klicks in der App zurückgreifen zu müssen.

Das Protokoll scheint sehr simpel zu sein, es gibt ja auch schon entsprechende Skripte oder Anbindungen per HomeKit. Das sind für mich aber eher "WorkArounds", eine direkte Ansteuerung aus einem Adapter wäre deutlich schöner.

Links zu bisherigen Ansteuerungen: per Skript: https://forum.iobroker.net/post/699618 per HomeBridge: https://forum.iobroker.net/post/615377

Links zu weitergehender Doku: https://github.innominds.com/gobo-ws/ola-trigger-elgato-key-light-dmx/blob/master/elgato_key_light.conf https://www.waldonell.com/thoughts/articles/homekit-automation-for-elgato-key-light

Viele Grüße, KoMa1978

KoMa1978 commented 2 years ago

It is already integrated in HomeAssistant: https://www.youtube.com/watch?v=Ce4PSgFVRmg

KoMa1978 commented 2 years ago

Some more links with documentation/information: https://github.com/adamesch/elgato-key-light-api https://github.com/andornaut/keylight

I just got my Keylight Air so I'll be able to test/verify.

KoMa1978 commented 2 years ago

I took some packet captures from the Elgato Control Center App to a Keylight and it looks like the following:

  1. Get Accessory Info (ONCE at startup, then POLL EVERY 10 seconds): HTTP-GET http://IP-ADDRESS:9123/elgato/accessory-info

    Answer (application/json): {"productName":"Elgato Key Light Air","hardwareBoardType":200,"firmwareBuildNumber":199,"firmwareVersion":"1.0.3","serialNumber":"123456789012","displayName":"Key Light 01","features":["lights"]}

  2. Get Lights Settings (ONCE at startup, then POLL EVERY 5 seconds): HTTP-GET http://IP-ADDRESS:9123/elgato/lights/settings

    Answer (application/json): {"powerOnBehavior":1,"powerOnBrightness":20,"powerOnTemperature":213,"switchOnDurationMs":100,"switchOffDurationMs":300,"colorChangeDurationMs":100}

  3. Get Lights Settings (ONCE at startup, then POLL EVERY 1 second): HTTP-GET http://IP-ADDRESS:9123/elgato/lights

    Answer (application/json): {"numberOfLights":1,"lights":[{"on":0,"brightness":50,"temperature":200}]}

To set the ligths, simply PUT the answer from step 3 to the same URL. I used the Javascript below:

varHTTPOPTIONS = { url: http://IP-ADDRESS:9123/elgato/lights, method: 'PUT', form: '{"numberOfLights": 1,"lights": [{"on": 1,"brightness": 75,"temperature": 200}]}' }; request(varHTTPOPTIONS, function (varERROR, varRESPONSE, varBODY){

"on":1 means turn ON light "on":0 means turn OFF light

brightness is "1" - "100" which means brightness in percent. temperature is "143" (7000K) to "343" (2900K). "200 or 201" means 5000K, ... I can provide all other K values if needed, it seems 2-3 values for each 50K -> 143 = 7000K, 144/145=6950K, 146/147=6900K, 200-201=5000K, ... ,342/343/344=2900K

Setting it to a temperature value <143 it will set the light to 143 but wont change the value of temperature of the GET command in step 2. Same applies to temperature values >343. The light will be set to 343 but the temperature value in the GET won't be changed.

Some additional findings: The "displayName" in Step 1 can be adjusted in the Control Center App but I don't think this is needed in the ioBroker adapter. The Devices in the Control Center App are being discovered by MDNS but I think creating one instance per light and define the IP manually is fine. The devices are polled every second in step 3. I think this polling should be a configurable duration, once a minute or even once a hour should be more than enough. At least if you poll the values after setting them to verify setting worked.

The other options in step 2 like "powerOnBehavior" are configurable in ControlCenter but I don't think it is needed in the adapter. "powerOnBehavior":1 means "Use last settings" "powerOnBehavior":2 means "Use default settings" and the default settings are "powerOnBrightness" and "powerOnTemperature" (same as "brightness" and "temperature" in step 3)

LePremier commented 2 years ago

Great idea! Is there any progress on this project?

Andariel78 commented 2 years ago

Nope, but would be great to get this :)

xXBJXx commented 1 year ago

I sat down and built the adapter. Elgato Key Lights Adapter The adapter can be installed via GitHub and NPM, later it will be added to the ioBroker repo. The adapter supports the following devices: Elgato Key Light, Elgato Key Light Air, Elgato Ring Light, Elgato Key Light mini and Elgato Light Strip. Please read the documentation before testing. Here still the forum post https://forum.iobroker.net/topic/62334/test-elgato-key-light-adapter Have fun with testing.

mcm1957 commented 1 year ago

Link to adapter: https://github.com/xXBJXx/ioBroker.elgato-key-light

mcm1957 commented 1 year ago

@xXBJXx Please consider adding thios adapter to repositories if it is working

xXBJXx commented 1 year ago

@xXBJXx

Please consider adding thios adapter to repositories if it is working

There is already for 4 months a request for the Iobroker repo open https://github.com/ioBroker/ioBroker.repositories/pull/2157

mcm1957 commented 1 year ago

@xXBJXx I'm very sorry - I missed the existing PR when checking here. And I hope, Apollon will have teime to review the PR soon.

mcm1957 commented 9 months ago

development suspended

If anyone has possibility to test / support development please let us know.