# \[HELP wanted\] A Linear Level Indicator

**URL:** <https://discourse.nodered.org/t/help-wanted-a-linear-level-indicator/9276>\
**Category:** Share Your Nodes\
**Created:** [21 March 2019 13:38 UTC](https://discourse.nodered.org/t/help-wanted-a-linear-level-indicator/9276 "2019-03-21T13:38:15Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [21 March 2019 13:38 UTC](https://discourse.nodered.org/t/help-wanted-a-linear-level-indicator/9276/1 "2019-03-21T13:38:15Z")

</div>

As for follow up of thread [Linear gauge as another gauge option](https://discourse.nodered.org/t/linear-gauge-as-another-gauge-option/821) I actually started to do it.  
First version (early beta) - horizontal only. Takes one unit height. Reasonably configurable.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/0/062d69a984fb7d4aacd64741f9d6e5ca594fdc3b.png)

It is kind of ready for testing. And here I need your help.  
I guess some device testing should be done and may be something performance wise. And of course main behaviors and appearance.

I really don't now what is the best path to organize such phase of development and testing so I 'm wide open for suggestions.

Widget is not published to npm, you can reach it from github: [https://github.com/hotNipi/node-red-contrib-ui-level](https://github.com/hotNipi/node-red-contrib-ui-level)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [21 March 2019 13:51 UTC](https://discourse.nodered.org/t/help-wanted-a-linear-level-indicator/9276/2 "2019-03-21T13:51:46Z")

</div>

Very nice... (hopefully)

When I try to run it with just a slider input from 0 - 100 I get

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/c/c6ebb0a5f7c878704b00c83881e16ca5527f38b1.png)  
in the console and nothing on screen  
Coming from  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/8/8ede975b00987461307ccd437c6f26a6478ac300.png)

Some other bits and pieces...  
in the config are these labels the wrong way round ? - I think warn is yellow...  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/57c10ea5858ccc655bd38867b3eff0ff2febb0b2.png)

As the node does not output anything it should have no outputs, and the icon should be on the right... (and maybe a better icon at some point 🙂  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/e/e06f8db12999e852d34e38e03b5d1d5af91207a5.png)

Where is the word LEVEL coming from ? Should that be a Lebel people can customise - and if so should it also be the word shown on the flow editor side (unless optional Name is defined)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/7/7e7b7718ed7edee44f663f9b45c88bcb94dc7fdf.png)

Finally the text colour ought to pick up the theme text colour so when you have a light background it changes automatically.

But - yes please... looks great.

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [21 March 2019 14:42 UTC](https://discourse.nodered.org/t/help-wanted-a-linear-level-indicator/9276/3 "2019-03-21T14:42:41Z")

</div>

Thank you @dceejay for this all. Fixed couple of things. 🙂

_Note to myself. Default comes first!_

---

<div class="post-metadata">

**Author:** ![Andrei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/andrei/32/10446_2.png) [@Andrei](https://discourse.nodered.org/u/Andrei)\
**Post date:** [21 March 2019 19:06 UTC](https://discourse.nodered.org/t/help-wanted-a-linear-level-indicator/9276/4 "2019-03-21T19:06:23Z")

</div>

Nice widget ! I can't imagine any improvement, it is already perfect in appearance and behaviour (after the changes already done). Working well in my system.

21 Mar 15:28:45 - [info] Node-RED version: v0.20.3  
21 Mar 15:28:45 - [info] Node.js version: v8.11.1  
21 Mar 15:28:45 - [info] Windows\_NT 10.0.17763 x64 LE

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [21 March 2019 20:11 UTC](https://discourse.nodered.org/t/help-wanted-a-linear-level-indicator/9276/5 "2019-03-21T20:11:43Z")

</div>

@hotNipi very nice!  
It doesn't seem to work with negative numbers though. I was thinking of displaying signal strength (but could equally be sound levels or temperature, etc).

```auto
[{"id":"d4e95e21.57a23","type":"ui_level","z":"31e18edc.98bdc2","group":"ddd690d2.0351d","order":2,"width":"4","height":"1","name":"Level display","label":"","colorHi":"#e60000","colorWarn":"#ff9900","colorNormal":"#00b33c","colorOff":"#595959","min":"-100","max":"0","segWarn":"-25","segHigh":"-10","unit":"dB","decimals":0,"x":510,"y":640,"wires":[]},{"id":"bd43744c.616798","type":"inject","z":"31e18edc.98bdc2","name":"","topic":"","payload":"","payloadType":"date","repeat":"2","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":640,"wires":[["abbb4584.76fad8"]]},{"id":"abbb4584.76fad8","type":"random","z":"31e18edc.98bdc2","name":"","low":"0","high":"-100","inte":"true","property":"payload","x":290,"y":640,"wires":[["d4e95e21.57a23"]]},{"id":"ddd690d2.0351d","type":"ui_group","z":"","name":"Test2","tab":"117b6717.6166b9","disp":true,"width":"27","collapse":false},{"id":"117b6717.6166b9","type":"ui_tab","z":"","name":"Test2","icon":"dashboard","order":7,"disabled":false,"hidden":false}]

```

![level1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/b4ee8d23693daf7361933742a6763f6f8a40a1b0.png)  
 ![level2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/d97c622276a28c7dbb7bf03f4dd17c9df1693312.png)

Paul

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [21 March 2019 20:20 UTC](https://discourse.nodered.org/t/help-wanted-a-linear-level-indicator/9276/6 "2019-03-21T20:20:25Z")

</div>

I was thinking about the volume and then I made it to react too slow with animations for audio. Probably can be an option to turn animations on/off.

And for audio the stereo pair would be the thing i think. Something like this. And vertical.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/4/4b4dbe2cea37f5d5833ba2da54520a79e1e07d0a.png)

For negative numbers I'll check out of course.

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [22 March 2019 06:30 UTC](https://discourse.nodered.org/t/help-wanted-a-linear-level-indicator/9276/7 "2019-03-22T06:30:04Z")

</div>

Negative numbers supported now. And many thanks to @dceejay for high level support. Many things improved according to layout.

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [23 March 2019 15:42 UTC](https://discourse.nodered.org/t/help-wanted-a-linear-level-indicator/9276/8 "2019-03-23T15:42:11Z")

</div>

Updated [https://github.com/hotNipi/node-red-contrib-ui-level](https://github.com/hotNipi/node-red-contrib-ui-level)  
New - horizontal pair & animation options  
Wide open for comments and suggestions 🙂

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/5344efea447e0e7ed769ee56ef0afc74ab7dd8ce.png)

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [23 March 2019 15:58 UTC](https://discourse.nodered.org/t/help-wanted-a-linear-level-indicator/9276/9 "2019-03-23T15:58:01Z")

</div>

Haven't tried today's changes, but tried it last night, it works very well now with negative numbers, and those spanning + & -.  
As you mentioned above, on quickly changing values, it presents better with animations switched off.

Nice work.

---

<div class="post-metadata">

**Author:** ![realjax](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/realjax/32/895_2.png) [@realjax](https://discourse.nodered.org/u/realjax)\
**Post date:** [25 March 2019 21:17 UTC](https://discourse.nodered.org/t/help-wanted-a-linear-level-indicator/9276/10 "2019-03-25T21:17:25Z")

</div>

Very nice, thanks for this!  
Not sure if this is caused by the level node, but I can't seem to change it's position in the group. No matter where I put it, it always ends up as the last one. ( click image to see the entire group)

 ![46](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/b5152a70f88dce849f0b8a5799190925efaaf9d0.png)

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [25 March 2019 21:27 UTC](https://discourse.nodered.org/t/help-wanted-a-linear-level-indicator/9276/11 "2019-03-25T21:27:11Z")

</div>

That's strange... but yes confirmed. I'm seeing the same issue.  
@hotNipi

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [26 March 2019 03:56 UTC](https://discourse.nodered.org/t/help-wanted-a-linear-level-indicator/9276/12 "2019-03-26T03:56:38Z")

</div>

Found it by myself also but seems to be lower level than node itself. No workaround at the moment.  
EDIT:  
Tried with `node-red-contrib-ui_list`. Same issue. It seems to be common for custom ui widgets.  
In private conversation with @dceejay the issue was mentioned once, but may be it's better to do in some more official way somehow?

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [28 March 2019 14:03 UTC](https://discourse.nodered.org/t/help-wanted-a-linear-level-indicator/9276/13 "2019-03-28T14:03:27Z")

</div>

Did you ever sort this issue, or is it something that needs resolving at a core level by the node-RED team.

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [28 March 2019 14:17 UTC](https://discourse.nodered.org/t/help-wanted-a-linear-level-indicator/9276/14 "2019-03-28T14:17:07Z")

</div>

It is probably something dashboard level or deeper. I did what I could. Dave promised to look at it, but this will happen sometime next week or so.

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [2 April 2019 17:22 UTC](https://discourse.nodered.org/t/help-wanted-a-linear-level-indicator/9276/16 "2019-04-02T17:22:13Z")

</div>

It's not error but warning. Nothing really broken. Its an issue we are currently working on. Can't give any time estimates really for now.

If you are using default or near default settings for dashboard layout, you should be fine. That's the warning says, node uses hardcoded default settings for internal measurements.

---

<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:** [3 April 2019 01:59 UTC](https://discourse.nodered.org/t/help-wanted-a-linear-level-indicator/9276/17 "2019-04-03T01:59:00Z")

</div>

> Very nice, thanks for this!  
> Not sure if this is caused by the level node, but I can't seem to change it's position in the group. No matter where I put it, it always ends up as the last one. ( click image to see the entire group)

Well, that is weird.

I have my test thing and it is quite happy to be number 1.

(See attached.)

For the sake of it while testing it, I put a `text` (I think) node under it to check the values are getting there.

As you can see my `level` node is before the `text` node.

On outputs:  
It was also mentioned that the node donesn't have an output.  
Ok, it probably doesn't, but I think it would/could be nice if it passes on the input to the output.  
That way it is nicer if someone is having trouble with the node.  
Stick a `debug` node on the output and check the node is getting a correct input.  
(Speaking from experience) Putting a `debug` node beside it can be fraught with problems: like not having the node in the flow, but still getting data displayed and wondering why the node isn't working.

Just a thought.

![Screenshot%20from%202019-04-03%2012-54-43](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/f/fff2663bd6601e5aa70e171ebba390954a68d144.png)

---

<div class="post-metadata">

**Author:** ![hotNipi](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hotnipi/32/383_2.png) [@hotNipi](https://discourse.nodered.org/u/hotNipi)\
**Post date:** [3 April 2019 04:49 UTC](https://discourse.nodered.org/t/help-wanted-a-linear-level-indicator/9276/18 "2019-04-03T04:49:11Z")

</div>

For widgets order/placement issue, just update the ui\_level node.

About output, the regular gauge node as many others don't have output. And I really don't see the practical usage of it. If the input parameter needs to be debugged, correct place of debugger node will be output of that node which gives input to ui widget. As you can not see what is going on with your input inside the node you shouldn't expect the data to survive the path thru the node also.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [3 April 2019 09:08 UTC](https://discourse.nodered.org/t/help-wanted-a-linear-level-indicator/9276/19 "2019-04-03T09:08:48Z")

</div>

> [@hotNipi](#):
>
> About output, the regular gauge node as many others don't have output

I agree with you about it being unnecessary to provide an output for debugging purposes, that should be taken care of from the output of the preceding node.

However most of the ui nodes do provide an output which we tend to use to save the last value to context, and so that we can re-inject it, in the event that the flow is restarted or a system reboot.

I of course realise that 'the last value' could easily be obtained from the preceding node output to save to context, but in the interests of ui node consistency, wouldn't it be better to add an output?  
It also looks aesthetically better when laying out the flow, to tag a change node on the end of the ui node for that purpose.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [3 April 2019 09:39 UTC](https://discourse.nodered.org/t/help-wanted-a-linear-level-indicator/9276/20 "2019-04-03T09:39:24Z")

</div>

No - the only "output" node that has an output for the state is the chart node, (as the way it stores state internally is a real pain and re-injecting hundreds of points would be daft). For simple values like gauges use, storing in context just prior to sending to the widget, and triggering a resend using ui\_control node should be fine.

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [3 April 2019 10:41 UTC](https://discourse.nodered.org/t/help-wanted-a-linear-level-indicator/9276/21 "2019-04-03T10:41:53Z")

</div>

> [@dceejay](#):
>
> No - the only "output" node that has an output for the state is the chart node

I was meaning other ui nodes such as button, slider, switch, dropdown etc as well as the chart node. They all provide an output which could be used to restore the state.

> [@dceejay](#):
>
> (as the way it stores state internally is a real pain and re-injecting hundreds of points would be daft)

I can imagine that being a pain, but the chart node and the level node are very different, in that for the level node it would simply be a pass through - ie just a single value, and not storing hundreds of points internally...  
It would be very easy to implement and would not affect the node functionality.

But hey @hotNipi - your node -your rules 😆

[Next page](https://discourse.nodered.org/t/help-wanted-a-linear-level-indicator/9276.md?page=2)
