-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[avmfritz] Add light blub color temperature support #14373
Conversation
...tz/src/main/java/org/openhab/binding/avmfritz/internal/handler/AVMFritzBaseThingHandler.java
Show resolved
Hide resolved
...tz/src/main/java/org/openhab/binding/avmfritz/internal/handler/AVMFritzBaseThingHandler.java
Outdated
Show resolved
Hide resolved
bundles/org.openhab.binding.avmfritz/src/main/resources/OH-INF/thing/thing-types.xml
Show resolved
Hide resolved
@ccutrer you are our specialist for color temperature ;) Didn't you implement something that should avoid the hardcoded conversion of values proposed in that PR ? |
I would highly recommend that you add both colorTemperature (as a dimmer), and colorTemperatureAbs (as a Number:Temperature, and system:color-temperature-abs type). You will need to use QuantityType (in Kelvin) when posting updates of your channel's state, and toInvertibleUnit (converting to Kelvin) when accepting commands to make sure automatic unit conversions work (some people will prefer to work in mired/mirek, and some will prefer to work in Kelvin). There's nothing to help you scale between percent and temperature in Kelvin as in this PR. It looks like your device supports setting a color temperature directly in Kelvin. Does your device not support arbitrary color temperatures, only the few given in your long if/else if structure? If it supports arbitrary, you should definitely just use math and scale the percent value. You may want to do the scaling in mireds instead of Kelvin, since mireds have the nice property that any given interval of say 50 mireds will be the same perceptible change in color, whereas in Kelvin the higher you go in the scale, the larger the interval to achieve the same perceptible change (i.e. 2700K to 3000K is about the same perceptible difference as 5000K to 6000K). |
58065d9
to
355aced
Compare
I will have a look here. I need to test this out if other color temps are working and math can be used. This might take me some days, because currently I'm fighting with some issue that I can not debug. |
Color temp stuff all looks good to me, except perhaps using some consts for min/max mireds |
As I put to the inline comment the AHA-HTTP-Inteface docu only gave me that 2700K and 6500K, therefore I didn't introduced any additional magic numbers byside of that ones. Of course It migt not make sense to calculate the min/max mireds dynamically. If you prefer I also can replace them by const values. |
@jlaur: I added. can you please check if it's OK? |
See /~https://github.com/openhab/openhab-docs/blob/7bd66d601e0d1421dd18b22e0132ee406127158b/developers/bindings/thing-xml.md#updating-thing-types and https://www.openhab.org/schemas/update-description-1.0.0.xsd. You will need to use |
@jlaur: Thanks for your hint, I think now I got it. |
Signed-off-by: Tobias Lange <vich-667@gmx.de>
Signed-off-by: Tobias Lange <vich-667@gmx.de>
Signed-off-by: Tobias Lange <vich-667@gmx.de>
Signed-off-by: Tobias Lange <vich-667@gmx.de>
Signed-off-by: Tobias Lange <vich-667@gmx.de>
Signed-off-by: Tobias Lange <vich-667@gmx.de>
Signed-off-by: Tobias Lange <vich-667@gmx.de>
Signed-off-by: Tobias Lange <vich-667@gmx.de>
Signed-off-by: Tobias Lange <vich-667@gmx.de>
Signed-off-by: Tobias Lange <vich-667@gmx.de>
56d2aa4
to
c2e79c0
Compare
Signed-off-by: Tobias Lange <vich-667@gmx.de>
@lolodomo or @cweitkamp: can you please give some feedback here. I think all given comments are fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one remark about naming conventions (channel id).
bundles/org.openhab.binding.avmfritz/src/main/resources/OH-INF/thing/thing-types.xml
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank upu
* added light blub color temperature support * align valiable nameing * fixed on off behavior of lights * change to math scaleing * add abs color temperature channel --------- Signed-off-by: Tobias Lange <vich-667@gmx.de> Signed-off-by: Thomas Burri <thomas.burri@alstomgroup.com>
* added light blub color temperature support * align valiable nameing * fixed on off behavior of lights * change to math scaleing * add abs color temperature channel --------- Signed-off-by: Tobias Lange <vich-667@gmx.de> Signed-off-by: Matt Myers <mmyers75@icloud.com>
* added light blub color temperature support * align valiable nameing * fixed on off behavior of lights * change to math scaleing * add abs color temperature channel --------- Signed-off-by: Tobias Lange <vich-667@gmx.de> Signed-off-by: Jørgen Austvik <jaustvik@acm.org>
Added an new channel to HAN_FUN_COLOR_BULB to conrol color temperature. This can be used to set the white color for the FRITZ!DECT 500 or to set it back to white mode if it is in color mode.
Should fix: #14287
Thanks to @sommer for posting the base of this code to #12427