dashboard color choices and rgb values

Hi,
when i control my colored light via the iot cloud dashboard i only get a few color choices who have weird color rgb values. For example green returns r=118 g=247 b=79 which is nowhere near green...
Does anybody know if these values can be changed or if it is possible to add your own colors with rgb specifications?

Here the code which i use to get the color values

uint8_t r, g, b;
  uhr.getValue().getRGB(r, g, b);
  Serial.println(r);
  Serial.println(g);
  Serial.println(b);

You could use the "Color HSB" property instead of the "Colored light" property. That should give you the full 16.7 million colors.

If you need assistance with that, let me know. I'm happy to help.

But that would mean that I would have to make a new property for the switch function and the dimming, right?
While that does solve my problem I would need to use different voice command identifiers for Alexa when handling the same device. So basically "turn light1 on" to use the switch and "turn light2 yellow" in order to change the color although im talking about the same light?
Thank you for your help.

SAMJBRO:
But that would mean that I would have to make a new property for the switch function and the dimming, right?

At least for dimming, no. The "Color HSB" property has a brightness slider:

hsb.png

As for on/off, I'd think you could do that by setting the brightness, but I don't have any experience with the Alexa skill, and I don't own an Alexa device.

I'd think you would program it so that "turn light1 on" sets it to the last used color and "turn light1 off" set the brightness to 0.

hsb.png

i might be completely off here but i dont think you can assign voice commands to specific actions although that would be really nice. I think it basically works by you assigning a value to the variable ("turn light on" assigns 1 as value of light.switch). Therefore if you were to use color hsb as property i think you would have to mention a color or at least a color value as voice command and since off and on arent color values i dont think it will work... Sadly im unable to try whether im right or not as for some reason alexa wont even see my properties/devices.
maybe it would help if anybody knows where the color examples on the dashboard come from or where the properties are defined so you could make slight adjustments in order for on/off to be used by color hsb if it works the way i think it does.

Edit: Im not even sure you can use color hsb for smart home applications as it is not in the smart home tab for type but that might just be a purely "kind of variable" related sorting rather than based on functionality with smart home "hubs"

it would be great if there was a lot more info given out by arduino regarding the whole iot thing. I mean even though it is a beta version it is still a payed service to some extent which should be treated as such especially since its a mostly maker bases customer group...

void getRGB(uint8_t& R, uint8_t& G, uint8_t& B) {
      float fC = (bri / 100) * (sat / 100);
      float fHPrime = fmod(hue / 60.0, 6);
      float fX = fC * (1 - fabs(fmod(fHPrime, 2) - 1));
      float fM = (bri / 100) - fC;
      float fR, fG, fB;

      if (0 <= fHPrime && fHPrime < 1) {
        fR = fC;
        fG = fX;
        fB = 0;
      } else if (1 <= fHPrime && fHPrime < 2) {
        fR = fX;
        fG = fC;
        fB = 0;
      } else if (2 <= fHPrime && fHPrime < 3) {
        fR = 0;
        fG = fC;
        fB = fX;
      } else if (3 <= fHPrime && fHPrime < 4) {
        fR = 0;
        fG = fX;
        fB = fC;
      } else if (4 <= fHPrime && fHPrime < 5) {
        fR = fX;
        fG = 0;
        fB = fC;
      } else if (5 <= fHPrime && fHPrime < 6) {
        fR = fC;
        fG = 0;
        fB = fX;
      } else {
        fR = 0;
        fG = 0;
        fB = 0;
      }
      R = lrint((fR + fM) * 255);
      G = lrint((fG + fM) * 255);
      B = lrint((fB + fM) * 255);
    }

so after a quick look at the cloudcolor.h it seems that the weird values might stem from the rather obscure transfer method that is used to change the HSB values hue, bri and sat into rgb values…
Weirdly enough it apparently isnt possible to get the HSB values directly as there is only a function getRGB and not get HSB…

cloudcolor.h

SAMJBRO:
Weirdly enough it apparently isnt possible to get the HSB values directly as there is only a function getRGB and not get HSB....

You can get the HSB values like this (assuming your variable name is color):

  Serial.print("Hue = ");
  Serial.println(color.getValue().hue);
  Serial.print("Saturation = ");
  Serial.println(color.getValue().sat);
  Serial.print("Brightness = ");
  Serial.println(color.getValue().bri);

SAMJBRO:
Edit: Im not even sure you can use color hsb for smart home applications as it is not in the smart home tab for type but that might just be a purely "kind of variable" related sorting rather than based on functionality with smart home "hubs"

I do see this statement in the tutorial:

When adding properties make sure you only use types listed under the Smart Home section, otherwise they will not work with Alexa.

well there goes that idea…
ill try a few things and give an update if something works…

Update: So after getting the arduino alexa connection to work i noticed that in the alexa app you get more colors to choose from and they are way more accurate in terms of rgb values. I guess that solves my problem...
Thanks to you again, pert, for trying to help me.

I'm glad to hear it's working for you now! Are you only going to use the Alexa interface to control the lights, or do you also want to use the Arduino IoT Cloud dashboard?

Im probably going to use alexa only since the color values are much better and my project was done with alexa in mind. However it would be really interesting to find out why the values from dashboard are so weird or if one could create custom colors.