sde1000 / python-dali

Library for controlling DALI lighting systems
Other
150 stars 73 forks source link

Colour control gear support (device type 8) #52

Open jjonek opened 5 years ago

jjonek commented 5 years ago

I've used this library as glue between my lighting and other home automation and now that I have couple of tunable white dt8 devices I want to add colour control into the play.

I acquired a copy of the part 209 and I'm currently working on writing colour module. For most of the things this looks quite straightforward, but there's a couple of things I'd like to evaluate my thoughts first. For instance, query colour value command takes parameter that defines which of the 50+ values is to be queried - would I rather define this as class (int, Enum) or just as constants?

sde1000 commented 5 years ago

I would definitely suggest some kind of enumeration class, because the library can be used to decode DALI commands as well as generate them; we will want to be able to go from the parameter value to its symbolic name. (Although in this instance the parameter is passed by setting it in DTR0 first, so decoding in the general case could be tricky!)

jjonek commented 5 years ago

True, that would require stateful component to track this kind of transactions which probably doesn't fit in the driver level. Also there's some sequences that take quite a few frames to complete - like reading the 16 bit response for the color value query stored in DTR1 & DTR2. (Of which msb is also returned as the backward frame)

nodefeet commented 5 years ago

Did you make any progress with the DT8 implementation so far? Maybe I can help.

ogerman commented 1 year ago

If someone needs IEC 62386-209-2011 sheets, I can help to get access

jktjkt commented 1 year ago

Just FYI, support for Tc (color temperature, aka tunable white) works just fine in the latest version (with some fixes in git). If I recall correctly there's also some code for other color LEDs (RGB, RGBW, etc), but I have not tested these because I do not have the HW.