ola icon indicating copy to clipboard operation
ola copied to clipboard

ola_trigger Improvements was Add Elegato light control

Open peternewman opened this issue 3 years ago • 8 comments

Some useful info: https://web.archive.org/web/20210806013041/https://trevorsullivan.net/2020/08/17/automate-the-elgato-key-light-air-with-powershell/ https://github.com/pcgeek86/elgato/blob/master/elgato/elgato.psm1 https://github.com/NickParks/elgato-light-api

Basic functionality ought to be possible via ola_trigger, like so: https://github.com/OpenLightingProject/ola/blob/master/tools/ola_trigger/contrib/philips_hue_osram_lightify.conf

But a plugin would offer nicer integration of e.g. discovery via Bonjour etc and generally simplify patching and controlling a whole load of them on different channel numbers.

peternewman avatar Mar 31 '23 03:03 peternewman

@gobo-ws strikes again! https://github.com/gobo-ws/ola-trigger-elgato-key-light-dmx

Do you want to put this in the contrib folder too @gobo-ws ?

Or maybe we should just link to your projects list or something?

I'm also wondering with some of the rest of these, do we need to improve ola_trigger to make them a bit more useable for situations like this? E.g. as step one, if you could pass in some variables on the command line, you could control 2 or many more of them with one common config file by running multiple instances like so: ola_trigger elgato_key_light.conf --offset 0 --config "hostname='192.168.0.1:9123'" ola_trigger elgato_key_light.conf --offset 2 --config "hostname='192.168.0.2:9123'"

I think that could potentially be as simple as just prepending the config lines to the beginning of the parsed config file, with maybe multiple lines being passed in via multiple --config options.

I guess the next extension would be a meta config, where you don't need to run two copies of ola_trigger, you can pass in one config file which sets all those options for multiple internal instances, but that's perhaps one for the future.

peternewman avatar Mar 31 '23 04:03 peternewman

Hehe! Certainly I can do that @peternewman but unfortunately I haven't updated the trigger configuration files that I have already contributed to OLA. So maybe it's better to link to my other trigger files such as Elgato Key Light in my repositorie?

Your ideas regarding improvement of ola_trigger sound very good. I look forward to the further development of that part.

gobo-ws avatar Mar 31 '23 06:03 gobo-ws

Adding a scale feature would also be useful:

          I think we should have the dimmer work over the full range rather than just part of it which will be rather confusing for users.

I suspect separately this means some sort of scale command would simplify repetitive config a lot.

Originally posted by @peternewman in https://github.com/OpenLightingProject/ola/pull/1849#discussion_r1164224261

          > I think we should have the dimmer work over the full range rather than just part of it which will be rather confusing for users.

I suspect separately this means some sort of scale command would simplify repetitive config a lot.

I see @nomis52 did this originally with the Mac Volume example, I'm not sure I agree with it personally.

I totally agree with your opinion, but I don't see how it can be done in the configuration script since it does not support any scale commands. Well the only thing to do it is to hard code the input range and the scaled range

Otherwise this can be solved by adding a shell script but in this case I wanted to do a simple script without the need for any shell script. For more advanced uses I use Node-RED and the Range node wich works fine for this kind of scaling.

Originally posted by @gobo-ws in https://github.com/OpenLightingProject/ola/pull/1849#discussion_r1165363377

peternewman avatar Apr 13 '23 15:04 peternewman

Hehe! Certainly I can do that @peternewman but unfortunately I haven't updated the trigger configuration files that I have already contributed to OLA. So maybe it's better to link to my other trigger files such as Elgato Key Light in my repositorie?

Yeah I'm unsure of the right option here. We probably at least need some signposting so people know they exist, maybe an awesome list or similar: https://github.com/sindresorhus/awesome/blob/main/awesome.md

I certainly wouldn't want to take away credit from all your hard work and the cool ones you've done.

My gut feeling is we could maybe include ones with minimal dependencies (e.g. just curl or bc or similar), but maybe leave out ones which need lots of other supporting tools/scripts. We should probably also either get them into the Debian package as examples, or shipped in another optional package (which could add the required core dependencies so they'd just run). Thoughts @yoe . But I kind of figure if you make them more available, it's a good base for someone to adapt to do what they want and get better use of the tool. Someone did a basic media player before, having that packaged so you could just run it would be pretty cool I think.

Your ideas regarding improvement of ola_trigger sound very good. I look forward to the further development of that part.

Great, I think we could gather other potential improvements to it here.

peternewman avatar Apr 13 '23 15:04 peternewman

Hello again. I created a list, you can find it here: https://github.com/gobo-ws/misc/blob/main/ola_trigger.md

gobo-ws avatar May 03 '23 16:05 gobo-ws

Hi @peternewman, following up from your suggestion in #1994 — I'd like to pick this one up if it's still wanted.

As a first step I could implement the command-line variables idea you described above: allowing ola_trigger to accept one or more --config options whose lines get prepended to the parsed config file, so a single config can be reused for multiple devices (e.g. different hostnames/offsets) by running multiple instances.

Does that sound like a good place to start? Happy to adjust scope before opening a PR.

devmaiter avatar Jul 17 '26 21:07 devmaiter

Sorry for the slow reply @devmaiter .

As a first step I could implement the command-line variables idea you described above: allowing ola_trigger to accept one or more --config options whose lines get prepended to the parsed config file, so a single config can be reused for multiple devices (e.g. different hostnames/offsets) by running multiple instances.

Does that sound like a good place to start? Happy to adjust scope before opening a PR.

Yeah that sounds like a great place to start. We're very test driven, so you'll find we've got tests to prove we can parse ola_trigger file configs: https://github.com/OpenLightingProject/ola/blob/99b26c65d45e807032c1337ca7ebf1ac51ff3995/tools/ola_trigger/Makefile.mk#L78-L80

As well as tests for parts of the core of ola_trigger: https://github.com/OpenLightingProject/ola/blob/99b26c65d45e807032c1337ca7ebf1ac51ff3995/tools/ola_trigger/Makefile.mk#L64-L71

Although they may prove to not be relevant depending on how you implement it.

peternewman avatar Jul 31 '26 17:07 peternewman

Hi @peternewman! I would like to work on adding the config for Elgato Key Light in ola_trigger/contrib and improving ola_trigger options. Could you please assign this issue to me?..

zayeralam avatar Aug 01 '26 04:08 zayeralam