How to use values of ColorWheel/ TemperatureWheel for other things?

Hello together,

I saw some posts where the ColorWheel is used for maybe Philips Hue or so.
But I want to send the values of the wheel to my ESP8266 to use them for my WS2812B lightstrip.
My problem is to find out how I can use the values. I tried to save them in a variable and want to show them on a label to see how I can convert them (or later) to RGB values or so. I have the http plugin to communicate with the ESP and can send data.
I hope the uploaded .hrp works where I tried with it. Also tried to create an unsigned long variable (read that its a hex value like #FF0000) to store something, but got an error in the simulator.
Has anyone an idea how to save the values of ColorWheel and TemperatureWheel in a variable and show them on the label, that I can use/ send them?

Thanks in advance and best regards,
Thorsten.
test home remote.hrp (2.6 MB)

You need to add the ColorControl & ColorTemperature capabilities to your Device object & you also need to handle them in the change request.

Take a look at the revised test project.
test home remote v2.hrp (2.6 MB)

function onChangeRequest(device, attribute, value) {
    if (device.Id == "1") {
        switch (attribute) {
            case "Color":
                var hex = value.toString();
                var saturation = value.Saturation;
                var hue = value.Hue;
                device.Color = value;
                http.get("http://192.168.178.47:80/COLOR=" + hex);
                break;
            case "ColorTemperature":
                device.ColorTemperature = value;
                http.get("http://192.168.178.47:80/TEMPERATURE=" + value);
                break;
            case "Switch":
                device.Switch = value;
                http.get("http://192.168.178.47:80/LED=" + value.toUpperCase());
                break;
            default:
                break;
        }
    }
    else {
        throw "Commands for this device Id have not been implemented";
    }
}
1 Like

There’s a colour wheel?

Yes (see pic).

2 Likes

I’ve copied the LightDetails.xaml and then copied the properties of the ColorPicker item and replace it with a ColorWheel instead.

Instead of this:

Is there also a White Temperature Wheel ?

Thanks

There is not a temperature wheel.

Hello Bill,

thanks a lot for your reply!
That is more than I expected!
On the first look it worked perfectly. I‘ll test it with my ESP when I get some time for it.
Again, a big thank you, you are great!

Best regards,
Thorsten.

1 Like

Olá Thorsten, obteve sucesso na integração com Esp8266?
Conseguiu acionar algum gpio com botão do home remote?
Poderia me ajudar?

Hello Elias,
yes, I successfully integrated the ESP8266.
You can do what ever you want, also trigger any GPIO of the ESP.
Now I connect the ESP via TCP connection (instead of HTTP). I attach you my actual (but not finished and not commented) Arduino code (.txt) and my .hrp.
Hope you can built on it.
Best regards to Portugal, Thorsten.
TCP_WS2812B.txt (3.0 KB) test home remote TCP.hrp (2.6 MB)