# Gauge node not displaying label

**URL:** https://discourse.nodered.org/t/gauge-node-not-displaying-label/67026
**Category:** General
**Created:** [28 August 2022 07:52 UTC](https://discourse.nodered.org/t/gauge-node-not-displaying-label/67026 "2022-08-28T07:52:19Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Thewaver](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thewaver/32/11917_2.png) [@Thewaver](https://discourse.nodered.org/u/Thewaver)
#### Post date: [28 August 2022 07:52 UTC](https://discourse.nodered.org/t/gauge-node-not-displaying-label/67026/1 "2022-08-28T07:52:19Z")

</div>

Hi, I've entered a name in the label field of a gauge node but it does not display in the UI when there is a data value in the value format field ie: {{payload.data.dps.20}}. If the value format field is left as default {{value}} it does display the lable...is this a bug ??

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [28 August 2022 07:54 UTC](https://discourse.nodered.org/t/gauge-node-not-displaying-label/67026/2 "2022-08-28T07:54:34Z")

</div>

I think the `payload` you send it only needs the value (number).

I'm not sure the gauge supports what you are sending it.

For the sake of it, just put an `inject` node and make it inject..... `30` (given that the range is greater than `30` for the gauge) and see what happens.

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [28 August 2022 08:12 UTC](https://discourse.nodered.org/t/gauge-node-not-displaying-label/67026/3 "2022-08-28T08:12:16Z")

</div>

The gauge does not like 20 as a property name in dot notation.  
try  
`{{msg.payload.data.dps[20]}}`

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [28 August 2022 08:18 UTC](https://discourse.nodered.org/t/gauge-node-not-displaying-label/67026/4 "2022-08-28T08:18:04Z")

</div>

Not to detract from what @E1cid said, but I'm confused.

Why/how is your `message` made to be `{{payload.data.dps.20}}`?  
(Ok and it doesn't work)

Be it you change it to `{{msg.payload.data.dps[20]}}` or simply `20`.... You are going to have to change the message's format.

---

<div class="post-metadata">

### Author: ![Thewaver](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thewaver/32/11917_2.png) [@Thewaver](https://discourse.nodered.org/u/Thewaver)
#### Post date: [28 August 2022 08:18 UTC](https://discourse.nodered.org/t/gauge-node-not-displaying-label/67026/5 "2022-08-28T08:18:40Z")

</div>

Hi, thank you for your reply. The 20 is not a number but part of the dot notation. However, I did try as you suggested but it threw errors...

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [28 August 2022 08:19 UTC](https://discourse.nodered.org/t/gauge-node-not-displaying-label/67026/6 "2022-08-28T08:19:49Z")

</div>

Does an `inject` node with simply with `20` (number) work?

---

<div class="post-metadata">

### Author: ![Thewaver](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thewaver/32/11917_2.png) [@Thewaver](https://discourse.nodered.org/u/Thewaver)
#### Post date: [28 August 2022 08:20 UTC](https://discourse.nodered.org/t/gauge-node-not-displaying-label/67026/7 "2022-08-28T08:20:22Z")

</div>

The result does work and the gauge shows correct represenation of the value...only the label is not working on the UI screen..

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [28 August 2022 08:20 UTC](https://discourse.nodered.org/t/gauge-node-not-displaying-label/67026/8 "2022-08-28T08:20:30Z")

</div>

please supply the flow and the input data.  
[edit] Your original post you are missing the `msg.` at the beginning.

test flow

```auto
[{"id":"e4b45c94.552bb8","type":"ui_gauge","z":"9a86d59e88442f2c","name":"","group":"2d4fe667.28f8ba","order":10,"width":0,"height":0,"gtype":"gage","title":"bracket","label":"units","format":"{{msg.payload.test[20]}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":380,"y":160,"wires":[]},{"id":"3878e41.0ccab9c","type":"inject","z":"9a86d59e88442f2c","name":"","props":[{"p":"payload.test.20","v":"5","vt":"num"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":120,"y":140,"wires":[["53b2dff6.ded2","e4b45c94.552bb8"]]},{"id":"53b2dff6.ded2","type":"ui_gauge","z":"9a86d59e88442f2c","name":"","group":"2d4fe667.28f8ba","order":10,"width":0,"height":0,"gtype":"gage","title":"dot","label":"units","format":"{{msg.payload.test.20}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","className":"","x":370,"y":120,"wires":[]},{"id":"2d4fe667.28f8ba","type":"ui_group","name":"demo","tab":"1caa8458.b17814","order":1,"disp":true,"width":"12","collapse":false},{"id":"1caa8458.b17814","type":"ui_tab","name":"Demo","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

```

 ![chrome_screenshot_1661675445833](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/f/8fe87bb161326711fe9e3be93253ed797ceab2fb.png)

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [28 August 2022 08:24 UTC](https://discourse.nodered.org/t/gauge-node-not-displaying-label/67026/9 "2022-08-28T08:24:22Z")

</div>

Ok, suggestion:  
Change the entire message's format.

Rather than `{{msg.payload.data.dps.20}}` make the message:  
`{{msg.payload:20,"name":"data"}}`

Then in the `gauge` put/leave `{{value}}` where it is, and put `{{name}}` in the `units` field.  
That may work better.

But as @E1cid said, it may be better to post that part of the flow.

---

<div class="post-metadata">

### Author: ![Thewaver](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thewaver/32/11917_2.png) [@Thewaver](https://discourse.nodered.org/u/Thewaver)
#### Post date: [28 August 2022 08:32 UTC](https://discourse.nodered.org/t/gauge-node-not-displaying-label/67026/10 "2022-08-28T08:32:45Z")

</div>

```auto
[{"id":"6dde75c9dce66091","type":"tab","label":"Flow 6","disabled":false,"info":"","env":[]},{"id":"5e2ac92c9212ab1d","type":"tuya-smart-device","z":"6dde75c9dce66091","deviceName":"go sun two","disableAutoStart":false,"deviceId":"bf31180c9cd880efXXXXXX","deviceKey":"d52be9a279XXXXXX","deviceIp":"","retryTimeout":"1001","findTimeout":"2000","tuyaVersion":"3.1","eventMode":"event-both","x":730,"y":320,"wires":[["49cfbff6055a752d","fe4aabddf99b3e6f","d445c5771977b952"],["f7ada266744d4150"]]},{"id":"a4f09cdcc3da9cac","type":"function","z":"6dde75c9dce66091","name":"","func":"const dps = 1\nlet SwitchState = msg.payload\n\nmsg.payload = { set: SwitchState }\n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":520,"y":320,"wires":[["5e2ac92c9212ab1d"]]},{"id":"85878bf67576dd88","type":"inject","z":"6dde75c9dce66091","name":"Turn On","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"dps\": 1, \"set\": true}","payloadType":"json","x":350,"y":280,"wires":[["5e2ac92c9212ab1d"]]},{"id":"3f487e4ffae70919","type":"inject","z":"6dde75c9dce66091","name":"Turn Off","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"dps\": 1, \"set\": false}","payloadType":"json","x":350,"y":360,"wires":[["5e2ac92c9212ab1d"]]},{"id":"49cfbff6055a752d","type":"debug","z":"6dde75c9dce66091","name":"Device Data","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":920,"y":260,"wires":[]},{"id":"f7ada266744d4150","type":"debug","z":"6dde75c9dce66091","name":"Node State","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":920,"y":360,"wires":[]},{"id":"c3d87edee956357e","type":"inject","z":"6dde75c9dce66091","name":"Turn On","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":200,"y":240,"wires":[["a4f09cdcc3da9cac"]]},{"id":"c3f50e5468305801","type":"inject","z":"6dde75c9dce66091","name":"Turn Off","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"false","payloadType":"bool","x":200,"y":400,"wires":[["a4f09cdcc3da9cac"]]},{"id":"557cf37d175db73c","type":"inject","z":"6dde75c9dce66091","name":"RECONNECT ACTION","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"operation\":\"CONTROL\",\"action\":\"RECONNECT\"}","payloadType":"json","x":420,"y":520,"wires":[["5e2ac92c9212ab1d"]]},{"id":"189afa2918968d21","type":"inject","z":"6dde75c9dce66091","name":"DISCONNECT ACTION","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"operation\":\"CONTROL\",\"action\":\"DISCONNECT\"}","payloadType":"json","x":420,"y":460,"wires":[["5e2ac92c9212ab1d"]]},{"id":"ec65850d4ac501bd","type":"function","z":"6dde75c9dce66091","name":"","func":"const dps = 1\nlet SwitchState = msg.payload\nmsg.payload = { operation: 'GET', dps: 1 }\n\n\nreturn msg","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":720,"y":200,"wires":[["5e2ac92c9212ab1d"]]},{"id":"fe4aabddf99b3e6f","type":"ui_gauge","z":"6dde75c9dce66091","name":"","group":"4dfceab38ed323b2","order":0,"width":0,"height":0,"gtype":"gage","title":"tuya","label":"%","format":"{{payload.data.dps.17}}","min":0,"max":"52","colors":["#b50200","#00e6d5","#8dca38"],"seg1":"20","seg2":"80","x":930,"y":160,"wires":[]},{"id":"d445c5771977b952","type":"ui_gauge","z":"6dde75c9dce66091","name":"Tuya","group":"4dfceab38ed323b2","order":0,"width":0,"height":0,"gtype":"gage","title":"Tuya","label":"%","format":"{{payload.data.dps.20}}","min":0,"max":"2502","colors":["#b50200","#00e6d5","#8dca38"],"seg1":"20","seg2":"80","x":930,"y":220,"wires":[]},{"id":"180308bab7ae5903","type":"inject","z":"6dde75c9dce66091","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":540,"y":200,"wires":[["ec65850d4ac501bd"]]},{"id":"4dfceab38ed323b2","type":"ui_group","name":"Tuya","tab":"7ec12690599d16c0","order":1,"disp":true,"width":"6","collapse":false},{"id":"7ec12690599d16c0","type":"ui_tab","name":"Tuya","icon":"dashboard","disabled":false,"hidden":false}]

```

{"payload":{"data":{"dps":{"1":false,"9":0,"18":0,"19":0,"20":2306,"21":1,"22":757,"23":31968,"24":21580,"25":964,"38":"memory","39":"relay","40":false,"41":"","42":"","43":""}},"deviceId":"bf31180c9cd880ef8egtmh","deviceName":"go sun two"},"\_msgid":"48f376ce4e9376f0"}

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [28 August 2022 08:39 UTC](https://discourse.nodered.org/t/gauge-node-not-displaying-label/67026/11 "2022-08-28T08:39:03Z")

</div>

What i said in my first post works for me

```auto
[{"id":"d218ead8.09878","type":"inject","z":"6dde75c9dce66091","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"data\":{\"dps\":{\"1\":false,\"9\":0,\"18\":0,\"19\":0,\"20\":2306,\"21\":1,\"22\":757,\"23\":31968,\"24\":21580,\"25\":964,\"38\":\"memory\",\"39\":\"relay\",\"40\":false,\"41\":\"\",\"42\":\"\",\"43\":\"\"}},\"deviceId\":\"bf31180c9cd880ef8egtmh\",\"deviceName\":\"go sun two\"}","payloadType":"json","x":550,"y":440,"wires":[["87fe6c2d.e32938"]]},{"id":"87fe6c2d.e32938","type":"ui_gauge","z":"6dde75c9dce66091","name":"Tuya","group":"4dfceab38ed323b2","order":0,"width":0,"height":0,"gtype":"gage","title":"Tuya","label":"%","format":"{{payload.data.dps[20]}}","min":0,"max":"2502","colors":["#b50200","#00e6d5","#8dca38"],"seg1":"20","seg2":"80","className":"","x":770,"y":440,"wires":[]},{"id":"4dfceab38ed323b2","type":"ui_group","name":"Tuya","tab":"7ec12690599d16c0","order":1,"disp":true,"width":"6","collapse":false},{"id":"7ec12690599d16c0","type":"ui_tab","name":"Tuya","icon":"dashboard","disabled":false,"hidden":false}]

```

 ![chrome_screenshot_1661675914698](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/2/92262ee7fad5e2869d4798ff8fd3a7455aa41bde.png)

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [28 August 2022 08:46 UTC](https://discourse.nodered.org/t/gauge-node-not-displaying-label/67026/12 "2022-08-28T08:46:20Z")

</div>

You should put the `payload` also in the `</>` format.

Yikes, that is a complex message.

But - just putting it out there....

A `change` node would work for you.  
You send that into it and _extract_ (move?) the desired values to new parts of the `message` ( **NOT** the `payload`) and send it into the `gauge` with the correct/needed values (`{{ }}`) to parse the needed parts of the message.

---

<div class="post-metadata">

### Author: ![Thewaver](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thewaver/32/11917_2.png) [@Thewaver](https://discourse.nodered.org/u/Thewaver)
#### Post date: [28 August 2022 08:49 UTC](https://discourse.nodered.org/t/gauge-node-not-displaying-label/67026/13 "2022-08-28T08:49:40Z")

</div>

Hi, thanks for your reply. I never removed the dot {{payload.data.dps.[17]}} and removing the dot by copying your example correctly this time {{payload.data.dps[17]}} worked.  
Many thanks for your help with the correct solution...must open my eyes better next time LOL....

---

<div class="post-metadata">

### Author: ![Thewaver](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/thewaver/32/11917_2.png) [@Thewaver](https://discourse.nodered.org/u/Thewaver)
#### Post date: [28 August 2022 08:51 UTC](https://discourse.nodered.org/t/gauge-node-not-displaying-label/67026/14 "2022-08-28T08:51:53Z")

</div>

Hi, thanks for your help trying\_to\_learn and the solution offered by El Cid works for me. Really appreciate your help with the solution...

---

<div class="post-metadata">

### Author: ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)
#### Post date: [28 August 2022 08:52 UTC](https://discourse.nodered.org/t/gauge-node-not-displaying-label/67026/15 "2022-08-28T08:52:43Z")

</div>

All good.

The main thing is you worked out the problem. That's the important thing.

Good luck in the future.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [11 September 2022 08:52 UTC](https://discourse.nodered.org/t/gauge-node-not-displaying-label/67026/16 "2022-09-11T08:52:49Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
