# Reading Hue Brightness values

**URL:** https://discourse.nodered.org/t/reading-hue-brightness-values/13851
**Category:** General
**Created:** [30 July 2019 15:49 UTC](https://discourse.nodered.org/t/reading-hue-brightness-values/13851 "2019-07-30T15:49:03Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![phreaq](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@phreaq](https://discourse.nodered.org/u/phreaq)
#### Post date: [30 July 2019 15:49 UTC](https://discourse.nodered.org/t/reading-hue-brightness-values/13851/1 "2019-07-30T15:49:03Z")

</div>

Hi folks,

I am trying to read the brightness level of one of my Hue Lights, and change it's color based on the value, but I'm struggling with the basics.

Is anyone able to tell me what I am doing wrong with the following flow? My first debug is only receiving a 'on' value.

```auto
[{"id":"d452c9e9.9affa8","type":"tab","label":"Flow 5","disabled":false,"info":""},{"id":"c5dc8ff0.e46c9","type":"inject","z":"d452c9e9.9affa8","name":"","topic":"","payload":"ON","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":320,"wires":[["8b260123.ea889"]]},{"id":"efe4e38a.84187","type":"switch","z":"d452c9e9.9affa8","name":"is brightness 50% or more? ","property":"payload.brightness","propertyType":"msg","rules":[{"t":"gt","v":"50","vt":"num"},{"t":"lte","v":"50","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":600,"y":320,"wires":[["f200f5e5.d92248"],["b106c15a.14ad3"]]},{"id":"f200f5e5.d92248","type":"change","z":"d452c9e9.9affa8","name":"Green","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"rgb\":[30,255,30],\"transitionTime\":1,\"brightness\":80}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":280,"wires":[["9b8a81b1.7d9ec","b1babc93.952d7"]]},{"id":"b106c15a.14ad3","type":"change","z":"d452c9e9.9affa8","name":"Red","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\"on\":true,\"rgb\":[255,25,55],\"transitionTime\":1,\"brightness\":80}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":810,"y":360,"wires":[["9b8a81b1.7d9ec","fa92cc62.5307b"]]},{"id":"9b8a81b1.7d9ec","type":"hue-light","z":"d452c9e9.9affa8","name":"Steve's","bridge":"dfdc487f.643b28","lightid":"2","colornamer":true,"x":960,"y":320,"wires":[["5ebf82f4.bed47c"]]},{"id":"b1babc93.952d7","type":"debug","z":"d452c9e9.9affa8","name":"G","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":950,"y":240,"wires":[]},{"id":"5ebf82f4.bed47c","type":"debug","z":"d452c9e9.9affa8","name":"L","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1130,"y":320,"wires":[]},{"id":"fa92cc62.5307b","type":"debug","z":"d452c9e9.9affa8","name":"R","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":950,"y":420,"wires":[]},{"id":"8b260123.ea889","type":"api-current-state","z":"d452c9e9.9affa8","name":"","server":"23847ca9.2dec94","version":1,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.steve_s","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":340,"y":320,"wires":[["efe4e38a.84187","d6808843.ceda08"]]},{"id":"d6808843.ceda08","type":"debug","z":"d452c9e9.9affa8","name":"CS","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":530,"y":180,"wires":[]},{"id":"dfdc487f.643b28","type":"hue-bridge","z":"","name":"Philips hue","bridge":"192.168.86.172","key":"ciBDkxg9BxQHOhpMTykQVwPikhqFUfDrLhV0oCZQ","interval":"3000"},{"id":"23847ca9.2dec94","type":"server","z":"","name":"p-Hassio","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]

```

TIA

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [30 July 2019 15:51 UTC](https://discourse.nodered.org/t/reading-hue-brightness-values/13851/2 "2019-07-30T15:51:39Z")

</div>

Check the "green" change node, compare it to the red one.

---

<div class="post-metadata">

### Author: ![phreaq](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@phreaq](https://discourse.nodered.org/u/phreaq)
#### Post date: [30 July 2019 18:26 UTC](https://discourse.nodered.org/t/reading-hue-brightness-values/13851/3 "2019-07-30T18:26:14Z")

</div>

I'm not sure I follow.

the change node isn't having the problem (I think). It's not getting past the switch

---

<div class="post-metadata">

### Author: ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)
#### Post date: [30 July 2019 19:03 UTC](https://discourse.nodered.org/t/reading-hue-brightness-values/13851/4 "2019-07-30T19:03:04Z")

</div>

Well it does if you compare the 2.

But indeed it is not relevant to this issue then.  
What debug output do you get from the api node (or whatever it is, i don't have it installed) - use 'complete msg object'

---

<div class="post-metadata">

### Author: ![phreaq](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@phreaq](https://discourse.nodered.org/u/phreaq)
#### Post date: [30 July 2019 19:29 UTC](https://discourse.nodered.org/t/reading-hue-brightness-values/13851/5 "2019-07-30T19:29:14Z")

</div>

All I get is "On"

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [30 July 2019 20:15 UTC](https://discourse.nodered.org/t/reading-hue-brightness-values/13851/6 "2019-07-30T20:15:59Z")

</div>

So with a debug node set to Show Complete Message all you get is "On". I find that very odd. Can you post a screenshot showing that please?

---

<div class="post-metadata">

### Author: ![phreaq](https://avatars.discourse-cdn.com/v4/letter/p/b9bd4f/32.png) [@phreaq](https://discourse.nodered.org/u/phreaq)
#### Post date: [30 July 2019 20:22 UTC](https://discourse.nodered.org/t/reading-hue-brightness-values/13851/7 "2019-07-30T20:22:18Z")

</div>

my mistake, I did not have the complete message selected for that debug node.

I seem to be getting what I need now, thanks
