Ok cheers that makes sense., i just need to figure when do do either. Eg find asetting in json that is consisstant
This part is really a mess. I have 0=0,1=0,2=255,3=0,4=0 as redā¦
I agree. SetColorRGB
is the way to go, if you just want to change a color.
i do but i also want to handle ww and cw and dimming
I think i am alot closer, just need to set the logic
to handle off,on,dim,colour and white
The dimming component is just SetLoadLevelTarget
as usual.
Yep, i ok with that. Its this stupid messed up colour that had me going, as i have never used it before in code.
Dimming is easy, as @rigpapa said. I have a couple of RGB+CC lights, where you can set both color and white temperature, but neither Alexa nor the Vera UI can set both at the same time, so itās still possible to control them separately. Alexa will send an RGB color anyway, at least with ha-bridge, so youāll need to decode it, then set onto the scale and send the command to the Vera. I have a special handler to do this, since itās easier than messing with ha-bridge calls.
What version of firmware? Maybe theyāre going back to 0ā¦ They did fix another color temp bug for 7.32 (W and D reverse in standard UI control actions from somewhere after 4150 up to 5245/6/7, where itās now fixed)
7.32 beta, of course. But Iām also setting it from external code and it has always been like I reported. Maybe they just fixed the UI and setting it in code was already fixed?
I havenāt upgraded my production system to 7.32 yet, itās still on 7.31, and I get 255s. Iām going to install my plugins on my 7.32 dev system and see what it does. If itās gone back to zero, Iām going to laugh my bā off.
I donāt know. I tried to set it again and itās 0 and not 255.
i am on 7.31 but not the lastest 1 back.
When you have figured it out please let us know if itās 0 or 255
@therealdb I have 255 on 7.32 when using D_DimmableRGBLight1.json
ā¦ what static JSON file are you using? Are you going into āEditā to make sure you are seeing the actual current value?
One last question (maybe)
this 0=0,1=0,2=255,3=0,4=0
is a sting?
a string, yes
D_DimmableRGBLight2.json for me. Yes, Iām in edit (I know the UI sucks when showing values).
To be honest, I only have virtual devices (mine, but also AltHue), but Iām not sure it should matter, since itās a UI thing.
I just set my light to azure, and I got this: 0=0,1=0,2=45,3=206,4=255
Yeah, it matters because the values are determined by what the plugin chooses to provide, so if the author thought 0, it will be 0, and if the author thought 255, it will be 255.
Hereās where I think the confusion originates. Somewhere between 4150 and 4414, the UI began sending temperature values to SetColor
as two components rather than one. Previously, it would send either D0-255
or W0-255
depending on which picker was hit. Somewhere in that firmware range, they starting using a two-component version and they send both: Wn,Dn
. They use 255 for the ānullā value in this, so W255,D128 means daylight temperature 128 (7250K), and W128,D255 means warm temperature 128 (3750K).
Iāve tried using both 0 and 255 in ColorTarget/CurrentColor
, and for me, it makes no difference to the UI. Itās strictly an implementation choice for the developer. If you are just controlling a device, I would, as I said before, use SetColorRGB
and SetColorTemp
specifically rather than the more generic SetColor
, if only to remove ambiguity. If you are implementing an RGB device, however, be careful of the 255 ānullā value in the SetColorTemp
action specifically.
@ElCid: the answer for you is to use 0, since you are controlling a device, not implementing a device type, if you choose to use SetColor
rather than SetColorRGB & SetColorTemp
.
Also to note: I set breakpoints in the JavaScript (7.32) on the function that parses CurrentColor
and is used to reload the color and temperature pickers. It never hits the breakpoint; it looks like that function is never actually called. Thatās going to take some more digging, but this is probably why itās not showing values properly.
Just FYI, thatās a special version for some Aeotec RGB(W?) device. There are exceptions for it in the UI JS. One of the differences is that it removes the marker from whichever color picker isnāt in effect. Hmmmā¦ I wonder why thatās an exception and not the standard behavior?
Thatās because they have tons of code like this in place, and itās a mess. the entire device templates and its rendering system are questionable.
At least itās not a thermostat.