Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


  • 0

"Unofficial" support for CCT lights


jakub.jezek
 Share

Question

Posted (edited)

Hello,

 

I was toying with colorComponents property for QuickApp type color controller to see if I can turn it in some sort of control for CCT (Correlated Color Temperature) lights. What I can say other than mission success.

I found how to use color components Cold White and Warm White by toying woth colorComponents property via Swagger (Fibaro API).

 

This is just bare QA with use of CCT and it lacks connecting it to any Z-Wave device, e.g. Fibaro RGBW controller (would be great to pair it with), or any 3rd party IP/ZigBee (via HUE Bridge) device, like

Please login or register to see this link.

.

 

Please note, QA posted here is not supported by Fibaro, but it is just "butchering" of color controller QA 😅. So please do not message Fibaro support or @A.Socha, @T.Konopka, or others from Fibaro that this QA is not working. If they decide to shut down colorComponents property, then this QA will cease to work.

 

As those color components are in Home Center v5.070.42, then probably Fibaro will create some support of CCT in future.

 

Import and showing cold white and warm white sliders:

  1. Go to Settings -> 5. Devices -> tab Other.
  2. Click on Add device button and select Import Quick App.
  3. Select Quick App downloaded from here.
  4. In Dashboard go to newly added Quick App.
  5. Click on Add CCT components button.

 

Quick app to download and toy with: 

 

version 1.0

  • initial release

version 1.1

  • added comments to code

  • turn off function sets both colors to 0

  • turn on function sets both colors to their last value

 

In App you can control it by using colors red and green in basic QA preview. In extended preview you will see cold White and warm White sliders.

 

Edit:

ColorComponents Enhancers and Faders (buttons on right side above each slider) are not supported.

 

Edit: Use this CC QA for your sollutions (): 

 

 

Edited by jakub.jezek
  • Like 1
Link to comment
Share on other sites

17 answers to this question

Recommended Posts

  • 0

Ok, figured out how to make it not restart... also setLevelIncrease et al. (no scaling of color intensity with brightness)

Thinking about using it for some of my ChildrenOfHue devices...

Please login or register to see this code.

Please login or register to see this attachment.

Edited by jgab
Fixed levelRef. Fixed levelChange for colorComponents
  • Like 2
Link to comment
Share on other sites

  • 0

We won't decide to shut down this property.

All available color components with translations (EN and PL) listed above:

  • warmWhite
  • coldWhite
  • red
  • green
  • blue
  • amber
  • cyan
  • purple

But as you said it is unofficial for now and I was never here ;)

Link to comment
Share on other sites

  • 0
  • Inquirer
  • 10 minutes ago, m.roszak said:

    We won't decide to shut down this property.

    Glad to read it ☺️

     

    11 minutes ago, m.roszak said:

    I was never here ;)

    Who was never here? 😉

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • In original post new version v1.1 added.

     

    version 1.0

    • initial release

    version 1.1

    • added comments to code

    • turn off function sets both colors to 0

    • turn on function sets both colors to their last value

    Link to comment
    Share on other sites

    • 0

    I think it is a good idea to prepare a function which correlates brightness (value) with colors.
    This way intensity(brightness) of the selected color is correlated with global brightness.

    Lets say that specific color component can be set from 0 to 255 (like in typical rgb scale). 
    Brightness can be set between 0-100%(or 99% if you like Z-Wave definition of fully turned on multilevel switches).

    setColorComponent action this way will only change colorComponents values, the output of specific channel on the end-device should be calculated by getting the brightness and multiplying it with color component and dividing it by maximum available brightness.

    example using cyan color:

    red channel - 0
    green channel - 255

    blue - 255
    Global brightness -  45%

    - red channel output = 0*45/100 ->  0

    - green channel output = 255*45/100 -> 114,75

    - blue channel output = 255*45/100 -> 114,75

    By linking turnOn/turnOff/setValue actions with brightness (value) it is possible to just tune the intensity or fully turning on/off the whole device with maintaining selected color ;)  
    setColorComponents will be only change the proportion of selected components.

    I think that I will like it this way.
    Maybe one evening I will prepare a variation of your QA and upload it here for everyone interested...

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 15 hours ago, m.roszak said:

    Lets say that specific color component can be set from 0 to 255 (like in typical rgb scale). 
    Brightness can be set between 0-100%(or 99% if you like Z-Wave definition of fully turned on multilevel switches).

    You mean these functions? 

     

    Please login or register to see this code.

     

     

    15 hours ago, m.roszak said:

    setColorComponent action this way will only change colorComponents values, the output of specific channel on the end-device should be calculated by getting the brightness and multiplying it with color component and dividing it by maximum available brightness.

    Next version plan:

    v1.2 - TO DO
    - Limit colors via brightness in the same way as RGBW module. - DONE
    - If color has raised to higher value then brightness, then raise brightness to level of that color. - IN PROGRESS.

     

    After brightness will be done, then I start to work on Enhancers and Faders. In this case I'll probably get some help as I have no idea how to make stop. Enhance and Fade seems straight forward with time property and ramps.

    Link to comment
    Share on other sites

    • 0

    It's a bit "ugly" that the QA restarts when the colorComponents property is updated... (api.post)

    Is there a way to update without causing a restart?

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  •  

    Also @m.roszak, warm white seems to be w variable in color components for setColor(r,g,b,w) function in color controller quick app. What would be cold white? I tried before variation of variables like cw and ww (before I looked at white variable) but nothing worked.

     

    It may not be in 5.070. yet, but in next version maybe.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • @jgab, that looks great. I will check it at home. 

     

    3 hours ago, jgab said:

    Thinking about using it for some of my ChildrenOfHue devices...

    That is one of the use-cases. I was thinking about for our installers that use hue lights and do not know any lua.

     

    But for my cases I was going with using it for Fibaro RGBW 1 and Fibaro RGBW 2. Then for some Philips HUE.

     

    I used lots of PUT as I was unable to get components in API to show in UI (web and enhaced QA view in app) pass changes to API.

     

     

    Link to comment
    Share on other sites

    • 0
    11 hours ago, jakub.jezek said:

     

    Also @m.roszak, warm white seems to be w variable in color components for setColor(r,g,b,w) function in color controller quick app. What would be cold white? I tried before variation of variables like cw and ww (before I looked at white variable) but nothing worked.

     

    It may not be in 5.070. yet, but in next version maybe.


    Unfortunately "setColor" can only get 4 args: Red, Green, Blue, Warm White (r,g,b,w) - there is no way to set other components using this function.
    Our RGBW controllers both use those as supported and for them this function was created in the first place.

    We started working on more generic approach and because of that "colorComponents" were introduced.

    Link to comment
    Share on other sites

    • 0
    14 minutes ago, m.roszak said:

    We started working on more generic approach and because of that "colorComponents" were introduced.

     

    @m.roszak in beta 71 (zw3) the levelChange interface is missing in "com.fibaro.multilevelSwitch" devices

     

    Please login or register to see this image.

    /monthly_2021_06/image.png.3745861f3b7a1507561d73ff3573da71.png" />     image.png.7308896290cbb17fa312d32c6b6b22a4.png

    Link to comment
    Share on other sites

    • 0
    14 hours ago, jakub.jezek said:

    @jgab, that looks great. I will check it at home. 

    That is one of the use-cases. I was thinking about for our installers that use hue lights and do not know any lua.

    But for my cases I was going with using it for Fibaro RGBW 1 and Fibaro RGBW 2. Then for some Philips HUE.

    I used lots of PUT as I was unable to get components in API to show in UI (web and enhaced QA view in app) pass changes to API.

    Yes, the nice thing is that it's flexible in how to configure. In my hueQA I use com.fibaro.philipsHueLight, but cc is probably easier to tailor for the task.

     For Hue I use Hue's own transition operations to fade and map them to setLevelIncrease etc. Trying to fade in Lua using timer loops is never as smooth...

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • @jgab, DIMSTEP variable in your code. Is it ramp for device to start to increase/decrease value by, if button start level decrease or start level incresed is pressed?

     

    If yes, does it represent percent ramp value (0-99%) or byte ramp value (0-255)?

    Link to comment
    Share on other sites

    • 0
    9 hours ago, jakub.jezek said:

    @jgab, DIMSTEP variable in your code. Is it ramp for device to start to increase/decrease value by, if button start level decrease or start level incresed is pressed?

     

    If yes, does it represent percent ramp value (0-99%) or byte ramp value (0-255)?

    No it's hardcoded step value for 0-99 (also 'start'/'stop' in dim function). 

    To make it better one should specify start, stop and time to make a full dim. Then calculate the speed and steps from that.

    Link to comment
    Share on other sites

    • 0

    Here is a version that encapsulates the ColorComponents behaviour in a class.

    Please login or register to see this spoiler.

     

    Because the class model doesn't support multiple inheritance, we create a ColorComponents and delegate calls to the. instance.

    Ex.

    Please login or register to see this code.

     

    The advantage is that we can do a similar thing with QuickAppChild instances and thus have multiple children that uses ColorComponent.

    Note, It is important that the parent argument points to something that is a subclass of QuickAppBase.

    ToDo - make the color ring update nicer...

    Link to comment
    Share on other sites

    • 0
    On 6/12/2021 at 12:01 AM, tinman said:

     in beta 71 (zw3) the levelChange interface is missing in "com.fibaro.multilevelSwitch" devices


    Yep, this is a desired behaviour for now - lot of devices does not handle this very well in generic aproach and we want to add this interface manually to devices which supports it well.
    This is Z-Wave specific interface so it was removed from the com.fibaro.multilevelSwitches by default. 
    It is possible that we will be adding it to non-template Z-Wave devices by default in one of next versions.  

    You can add this interface in QA manually if you want to use it (open FQA file with any text editor and add this to "initialInterfaces").
     

    Link to comment
    Share on other sites

    • 0

    Hey,looks like the right topic for me.

     

    I have RGBW2 and a CCT strip, bought those since I understood with a brief googling that those should work together. And they kinda do, at least I'm able to turn it on and off.

     

    But the controls for adjusting the light are obviously all kinds of wrong. Now I installed this app, but then reading again in more detail, am I understanding it right that I can't actually use this to control my RGBW2? "lacks connecting it to any Z-Wave device"

     

    In any case, what is the best way to control CCT strip with RGBW2? And is there a specific wiring that should be done?

    I have now W -> W and NW -> B, and as said yes, it works but not really sure how/if the color temperature itself can be adjusted.

    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

     Share

    ×
    ×
    • Create New...