Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ola_trigger config for Elgato Key Light #1849

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

gobo-ws
Copy link
Contributor

@gobo-ws gobo-ws commented Apr 3, 2023

ola_trigger config for Elgato Key Light or Elgato Key Light Air.
See #1848

@gobo-ws
Copy link
Contributor Author

gobo-ws commented Apr 12, 2023

@peternewman please review if you are not too busy

Copy link
Member

@peternewman peternewman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks as always @gobo-ws . A few ways I think we could improve the config slightly...

Comment on lines +13 to +14
# | 1 | 0-100 | Dimmer (0-100%) |
# | | 101-255 | Unused range |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, something like this:

Input range 0-255 Output range 0-100
0 0
1 0
2 1
3 1
4 2
5 2
6 2
7 3
8 3
9 4
10 4
11 4
12 5
13 5
14 5
15 6
16 6
17 7
18 7
19 7
20 8
21 8
22 9
23 9
24 9
25 10
26 10
27 11
28 11
29 11
30 12
31 12
32 13
33 13
34 13
35 14
36 14
37 15
38 15
39 15
40 16
41 16
42 16
43 17
44 17
45 18
46 18
47 18
48 19
49 19
50 20
51 20
52 20
53 21
54 21
55 22
56 22
57 22
58 23
59 23
60 24
61 24
62 24
63 25
64 25
65 25
66 26
67 26
68 27
69 27
70 27
71 28
72 28
73 29
74 29
75 29
76 30
77 30
78 31
79 31
80 31
81 32
82 32
83 33
84 33
85 33
86 34
87 34
88 35
89 35
90 35
91 36
92 36
93 36
94 37
95 37
96 38
97 38
98 38
99 39
100 39
101 40
102 40
103 40
104 41
105 41
106 42
107 42
108 42
109 43
110 43
111 44
112 44
113 44
114 45
115 45
116 45
117 46
118 46
119 47
120 47
121 47
122 48
123 48
124 49
125 49
126 49
127 50
128 50
129 51
130 51
131 51
132 52
133 52
134 53
135 53
136 53
137 54
138 54
139 55
140 55
141 55
142 56
143 56
144 57
145 57
146 57
147 58
148 58
149 59
150 59
151 59
152 60
153 60
154 61
155 61
156 61
157 62
158 62
159 63
160 63
161 63
162 64
163 64
164 65
165 65
166 65
167 66
168 66
169 67
170 67
171 67
172 68
173 68
174 69
175 69
176 69
177 70
178 70
179 71
180 71
181 71
182 72
183 72
184 73
185 73
186 73
187 74
188 74
189 75
190 74
191 75
192 75
193 76
194 76
195 76
196 77
197 77
198 78
199 78
200 78
201 79
202 79
203 80
204 80
205 80
206 81
207 81
208 82
209 82
210 82
211 83
212 83
213 84
214 84
215 84
216 85
217 85
218 86
219 86
220 86
221 87
222 87
223 88
224 88
225 88
226 89
227 89
228 90
229 90
230 90
231 91
232 91
233 92
234 92
235 92
236 93
237 93
238 94
239 94
240 94
241 95
242 95
243 96
244 96
245 96
246 97
247 97
248 98
249 98
250 98
251 99
252 99
253 99
254 100
255 100

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, something like this:

Yeah exactly, just like you're already doing with the colour temperature. Although as I mentioned with that if you map to a variable then you only need to write the actual command once. So it should only be 101-102 rows of config!

But yes, clearly a built in scale would be really helpful.

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.

Ah right. Is that the main missing feature from ola_trigger? Or are you generally doing more complicated logic when you're using Node Red?

# | | 101-255 | Unused range |
# +---------+---------+----------------------------+
# | 2 | | Color temperature (kelvin) |
# | | 0-3 | Unused range |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for missing this bit of the range, just to make the numbers nicer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason for missing this bit of the range, just to make the numbers nicer?

I wrote the original script some years ago and I think that my idea was that if you set the fader on that channel to 0 then the color temperature should not be changed, but we can definitely start at 0 instead of 4.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yeah I'd not considered wanting to leave it as is. That feels like a bad behaviour as a DMX fixture, but perhaps a good workaround if you're trying to control it with a simpler lighting desk.

Comment on lines +86 to +127
2 4-9 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":344}]}' 'http://${hostname}/elgato/lights'`
2 10-15 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":335}]}' 'http://${hostname}/elgato/lights'`
2 16-21 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":323}]}' 'http://${hostname}/elgato/lights'`
2 22-27 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":312}]}' 'http://${hostname}/elgato/lights'`
2 28-33 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":309}]}' 'http://${hostname}/elgato/lights'`
2 34-39 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":293}]}' 'http://${hostname}/elgato/lights'`
2 40-45 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":284}]}' 'http://${hostname}/elgato/lights'`
2 46-51 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":276}]}' 'http://${hostname}/elgato/lights'`
2 52-57 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":269}]}' 'http://${hostname}/elgato/lights'`
2 58-63 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":262}]}' 'http://${hostname}/elgato/lights'`
2 64-69 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":255}]}' 'http://${hostname}/elgato/lights'`
2 70-75 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":249}]}' 'http://${hostname}/elgato/lights'`
2 76-81 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":243}]}' 'http://${hostname}/elgato/lights'`
2 82-87 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":237}]}' 'http://${hostname}/elgato/lights'`
2 88-93 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":231}]}' 'http://${hostname}/elgato/lights'`
2 94-99 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":226}]}' 'http://${hostname}/elgato/lights'`
2 100-105 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":221}]}' 'http://${hostname}/elgato/lights'`
2 106-111 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":216}]}' 'http://${hostname}/elgato/lights'`
2 112-117 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":212}]}' 'http://${hostname}/elgato/lights'`
2 118-123 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":207}]}' 'http://${hostname}/elgato/lights'`
2 124-129 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":203}]}' 'http://${hostname}/elgato/lights'`
2 130-135 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":199}]}' 'http://${hostname}/elgato/lights'`
2 136-141 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":195}]}' 'http://${hostname}/elgato/lights'`
2 142-147 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":191}]}' 'http://${hostname}/elgato/lights'`
2 148-153 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":188}]}' 'http://${hostname}/elgato/lights'`
2 154-159 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":184}]}' 'http://${hostname}/elgato/lights'`
2 160-165 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":181}]}' 'http://${hostname}/elgato/lights'`
2 166-171 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":178}]}' 'http://${hostname}/elgato/lights'`
2 172-177 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":175}]}' 'http://${hostname}/elgato/lights'`
2 178-183 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":172}]}' 'http://${hostname}/elgato/lights'`
2 184-189 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":169}]}' 'http://${hostname}/elgato/lights'`
2 190-195 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":166}]}' 'http://${hostname}/elgato/lights'`
2 196-201 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":163}]}' 'http://${hostname}/elgato/lights'`
2 202-207 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":161}]}' 'http://${hostname}/elgato/lights'`
2 208-213 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":158}]}' 'http://${hostname}/elgato/lights'`
2 214-219 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":156}]}' 'http://${hostname}/elgato/lights'`
2 220-225 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":154}]}' 'http://${hostname}/elgato/lights'`
2 226-231 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":152}]}' 'http://${hostname}/elgato/lights'`
2 232-237 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":149}]}' 'http://${hostname}/elgato/lights'`
2 238-243 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":147}]}' 'http://${hostname}/elgato/lights'`
2 244-249 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":145}]}' 'http://${hostname}/elgato/lights'`
2 250-255 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":143}]}' 'http://${hostname}/elgato/lights'`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should be able to simplify/de-duplicate this, if you look at:
https://github.com/OpenLightingProject/ola/blob/master/tools/ola_trigger/contrib/mac_itunes.conf

Something like this (entirely untested):

Suggested change
2 4-9 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":344}]}' 'http://${hostname}/elgato/lights'`
2 10-15 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":335}]}' 'http://${hostname}/elgato/lights'`
2 16-21 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":323}]}' 'http://${hostname}/elgato/lights'`
2 22-27 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":312}]}' 'http://${hostname}/elgato/lights'`
2 28-33 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":309}]}' 'http://${hostname}/elgato/lights'`
2 34-39 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":293}]}' 'http://${hostname}/elgato/lights'`
2 40-45 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":284}]}' 'http://${hostname}/elgato/lights'`
2 46-51 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":276}]}' 'http://${hostname}/elgato/lights'`
2 52-57 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":269}]}' 'http://${hostname}/elgato/lights'`
2 58-63 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":262}]}' 'http://${hostname}/elgato/lights'`
2 64-69 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":255}]}' 'http://${hostname}/elgato/lights'`
2 70-75 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":249}]}' 'http://${hostname}/elgato/lights'`
2 76-81 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":243}]}' 'http://${hostname}/elgato/lights'`
2 82-87 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":237}]}' 'http://${hostname}/elgato/lights'`
2 88-93 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":231}]}' 'http://${hostname}/elgato/lights'`
2 94-99 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":226}]}' 'http://${hostname}/elgato/lights'`
2 100-105 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":221}]}' 'http://${hostname}/elgato/lights'`
2 106-111 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":216}]}' 'http://${hostname}/elgato/lights'`
2 112-117 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":212}]}' 'http://${hostname}/elgato/lights'`
2 118-123 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":207}]}' 'http://${hostname}/elgato/lights'`
2 124-129 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":203}]}' 'http://${hostname}/elgato/lights'`
2 130-135 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":199}]}' 'http://${hostname}/elgato/lights'`
2 136-141 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":195}]}' 'http://${hostname}/elgato/lights'`
2 142-147 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":191}]}' 'http://${hostname}/elgato/lights'`
2 148-153 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":188}]}' 'http://${hostname}/elgato/lights'`
2 154-159 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":184}]}' 'http://${hostname}/elgato/lights'`
2 160-165 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":181}]}' 'http://${hostname}/elgato/lights'`
2 166-171 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":178}]}' 'http://${hostname}/elgato/lights'`
2 172-177 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":175}]}' 'http://${hostname}/elgato/lights'`
2 178-183 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":172}]}' 'http://${hostname}/elgato/lights'`
2 184-189 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":169}]}' 'http://${hostname}/elgato/lights'`
2 190-195 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":166}]}' 'http://${hostname}/elgato/lights'`
2 196-201 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":163}]}' 'http://${hostname}/elgato/lights'`
2 202-207 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":161}]}' 'http://${hostname}/elgato/lights'`
2 208-213 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":158}]}' 'http://${hostname}/elgato/lights'`
2 214-219 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":156}]}' 'http://${hostname}/elgato/lights'`
2 220-225 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":154}]}' 'http://${hostname}/elgato/lights'`
2 226-231 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":152}]}' 'http://${hostname}/elgato/lights'`
2 232-237 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":149}]}' 'http://${hostname}/elgato/lights'`
2 238-243 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":147}]}' 'http://${hostname}/elgato/lights'`
2 244-249 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":145}]}' 'http://${hostname}/elgato/lights'`
2 250-255 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":143}]}' 'http://${hostname}/elgato/lights'`
2 4-9 ct='344'
2 10-15 ct='335'
2 16-21 ct='323'
...
2 250-255 ct='143'
2 4-255 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"temperature":${ct}}]}' 'http://${hostname}/elgato/lights'`

I think the fact you're already doing it for hostname should mean it just works! 🤞 Unless it doesn't like the duplicate entry for the channel and values?

You could probably set both and then fire once to avoid two curl calls too, which might help responsiveness?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only thing to consider with one curl call would be if you don't send enough channels, it might not do anything, but that probably matches lots of real lights TBH.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I probably hadn't really thought of that, will try this solution 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not like the duplicate entry for the channel and values:

# test.conf
hostname='192.168.0.1:9123'
ct=''

2       4-9      ct='344'
2       10-15    ct='335'
2       16-21    ct='323'

2       4-21     `echo 'test ct: ${ct} hostname: ${hostname}'`
$ ola_trigger --validate test.conf
tools/ola_trigger/Action.cpp:405: Interval [4, 21] overlaps [4, 9]
tools/ola_trigger/ParserActions.cpp:156: Line 19: value [4, 21] collides with existing values.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not like the duplicate entry for the channel and values:

Try this instead:

# test.conf
hostname='192.168.0.1:9123'
ct=''

2       4-9      ct='344'
2       10-15    ct='335'
2       16-21    ct='323'

2       %        `echo 'test ct: ${ct} hostname: ${hostname}'`

I'm not sure what will happen when you send values 1-3 as currently set...

I think this should work, it currently passes the validation at least, so we should probably either fix the behaviour or the validation if it doesn't...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late reply but I've been sick off and on lately. I will continue with this when I recover. Will also order a Key Light to verify it works properly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late reply but I've been sick off and on lately. I will continue with this when I recover.

Sorry to hear that @gobo-ws . Obviously no rush whatsoever, I hope you're feeling better soon!

Will also order a Key Light to verify it works properly.

I'm pretty certain I can still get access to one, so please don't buy one just for testing purposes (although they do look fun)!

Copy link
Contributor Author

@gobo-ws gobo-ws May 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @peternewman!
I ordered an Elgato Key Light (will not keep it though) and made some tests.

Elgato Key Light dimming range starts at 3 % in the Elgato Control Center app but when using the API the light lights up already at 2 percent.

Sending 1 % does not generate any error from the API but I can't see any visible light output.
If you set the value to zero by using the API the light will turn off (it will change the light state on to zero)
So I think we keep the 0-100 % range.

Don't know if it applies to all models though.

I have a problem to get a soft dimmer level with OLA when using the fader in the web interface with this trigger file.
Don't remember having this issue before. But I think it works a little bit better when using the 0-100 range instead of scaling the input from 0-255 to 0-100.
Also made some tests by removing sending the on command on every brightness request but it made no difference.

Running firmware: 1.0.3 (217) Did not want to update the firmware since I am not keeping the device.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any comments @peternewman?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elgato Key Light dimming range starts at 3 % in the Elgato Control Center app but when using the API the light lights up already at 2 percent.

So 2% is when it first turns on?

Sending 1 % does not generate any error from the API but I can't see any visible light output. If you set the value to zero by using the API the light will turn off (it will change the light state on to zero) So I think we keep the 0-100 % range.

Yeah that makes sense in terms of the final output.

Don't know if it applies to all models though.

Without a published API I think we just have to go with what works for one unit and wait for people to find issues!

I have a problem to get a soft dimmer level with OLA when using the fader in the web interface with this trigger file. Don't remember having this issue before. But I think it works a little bit better when using the 0-100 range instead of scaling the input from 0-255 to 0-100. Also made some tests by removing sending the on command on every brightness request but it made no difference.

Have you tried logging what its sending to check there's nothing wrong with the maths or similar? TBH this feels more like its an issue with the web interface's fader than anything else to me.

Have you tried using say ola_recorder or one of the examples to play back a fade from 0-255 over a certain amount of time? Then you could switch between the two configs and see how it behaves (aside from speeding up when going over a shorter range of inputs).

My gut feeling is still that the benefit of it behaving just like any other fixture and running over the whole range cancels out any potential minor issues with our web UI.

Running firmware: 1.0.3 (217) Did not want to update the firmware since I am not keeping the device.

Yeah fair enough.

###############################################################################
# Slot Values Action

1 0-100 `curl '-s' '-o /dev/null' '-k' '-H' '"Accept: application/json"' '-X' 'PUT' '--data' '{"numberOfLights":1,"lights":[{"on":1,"brightness":${slot_value}}]}' 'http://${hostname}/elgato/lights'`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One other config I looked at (maybe for companion) seemed to say it couldn't go below a brightness of 3 and then they switched it off "on":0 below that. Does it have any output at the lowest level? I don't know if the on:0 just turns off a driver and whether it has a slower response then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I tested it back in 2020 I can't remember that the lighting fixture was switched off below brightness of 3. Maybe something has changed in the API. I need to get an Elgato Key Light again to verify it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, it was just something I noticed in some other code. I'll try and post a link if I rediscover it. Well that and the fact they've got an on/off parameter as well as brightness...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gobo-ws
Copy link
Contributor Author

gobo-ws commented Apr 13, 2023

Thanks as always @gobo-ws . A few ways I think we could improve the config slightly...

Thanks for your feedback @peternewman. I will take a look on this and get back to you.

I don't have any Elgato Key Light at the moment so I might need to get one again to verify that the API still works the same way as in 2020.
There are also some new lighting fixtures from Elgato which I assume shares the same API.

@peternewman
Copy link
Member

Thanks for your feedback @peternewman. I will take a look on this and get back to you.

Thanks for the contribution!

I don't have any Elgato Key Light at the moment so I might need to get one again to verify that the API still works the same way as in 2020. There are also some new lighting fixtures from Elgato which I assume shares the same API.

I might be able to get my hands on one in a few weeks too or get someone to test changes for me. Yeah I think I found some docs/code suggesting it was generally the same. Maybe the LED strip was a bit different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants