# Homeyscript: Set HUE color to blue?

**URL:** https://community.homey.app/t/homeyscript-set-hue-color-to-blue/60310
**Category:** Questions & Help
**Tags:** homeyscript
**Created:** [February 12, 2022, 10:04pm UTC](https://community.homey.app/t/homeyscript-set-hue-color-to-blue/60310 "2022-02-12T22:04:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Mojo](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mojo/32/51254_2.png) [@Mojo](https://community.homey.app/u/Mojo)
#### Post date: [February 12, 2022, 10:04pm UTC](https://community.homey.app/t/homeyscript-set-hue-color-to-blue/60310/1 "2022-02-12T22:04:39Z")

</div>

I can’t figure out how to make a HUE light blue … this is code that works for red:

```auto
let devices = await Homey.devices.getDevices();
_.forEach(devices, device => {
    if(!device.capabilities.includes("light_hue")) return;
    device.setCapabilityValue('light_hue', 1);
    device.setCapabilityValue('light_saturation', 1);
    device.setCapabilityValue('light_temperature', 2);
    device.setCapabilityValue('light_mode', 'null');
});

```

Any idea how to set it to blue?

---

<div class="post-metadata">

### Author: ![Mike1233](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mike1233/32/20991_2.png) [@Mike1233](https://community.homey.app/u/Mike1233)
#### Post date: [February 12, 2022, 10:33pm UTC](https://community.homey.app/t/homeyscript-set-hue-color-to-blue/60310/2 "2022-02-12T22:33:16Z")

</div>

I did find something for html. Maybe you can do something wit it.  
[https://www.enigmaticdevices.com/philips-hue-lights-popular-xy-color-values/](https://www.enigmaticdevices.com/philips-hue-lights-popular-xy-color-values/)

---

<div class="post-metadata">

### Author: ![Jero](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/jero/32/17556_2.png) [@Jero](https://community.homey.app/u/Jero)
#### Post date: [February 12, 2022, 10:56pm UTC](https://community.homey.app/t/homeyscript-set-hue-color-to-blue/60310/3 "2022-02-12T22:56:15Z")

</div>

![2560px-HueScale.svg](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/7/072b440ba9b7a59cb51f119da843b3d1a0335e6e.png)  
its a normalized value between 0 and 1. So red 360 becomes 360/360 = 1. Blue becomes 240/360 = 0.66.

---

<div class="post-metadata">

### Author: ![Peter\_Kawa](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/peter_kawa/32/173848_2.png) [@Peter\_Kawa](https://community.homey.app/u/Peter_Kawa)
#### Post date: [February 12, 2022, 11:51pm UTC](https://community.homey.app/t/homeyscript-set-hue-color-to-blue/60310/4 "2022-02-12T23:51:42Z")

</div>

Maybe not what you look for but, there’s an app!

> **[Color Tools | Homey](https://homey.app/en-us/app/com.sdn.color-tools/Color-Tools/)**
>
> Convert color data to processable values

> [@\[App\]\[Pro\] Color Tools](https://community.homey.app/t/app-pro-color-tools/52877):
>
> Color Tools [AppStore](https://homey.app/a/com.sdn.color-tools/)[Changelog](https://community.homey.app/t/app-pro-color-tools-soon-tm/52877/2)[Examples](https://community.homey.app/t/app-pro-color-tools/52877/3)Usage This app lets you convert colors using action cards. The conversion result is yielded by a trigger card, providing the conversion results as tokens in your flow. The convertion action and trigger cards are linked by a free text event name. Action Cards Convert Kelvin Converts a kelvin value into color data. Arguements ‘Color Parsed Event Name’ The name of the event for the corresponding trigger card as text. ‘Kelvin Input’ The inpu…
