# Unterschiedliche Ausgabe bei function

**URL:** <https://discourse.nodered.org/t/unterschiedliche-ausgabe-bei-function/70251>\
**Category:** Dashboard\
**Created:** [8 November 2022 12:05 UTC](https://discourse.nodered.org/t/unterschiedliche-ausgabe-bei-function/70251 "2022-11-08T12:05:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![hardl1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardl1/32/70383_2.png) [@hardl1](https://discourse.nodered.org/u/hardl1)\
**Post date:** [8 November 2022 12:05 UTC](https://discourse.nodered.org/t/unterschiedliche-ausgabe-bei-function/70251/1 "2022-11-08T12:05:21Z")

</div>

Hallo,  
ich teste zum ersten Mal node red un d finde keine Antwort.

Das Thermostat gibt die Ventilöffnung mit 1 aus.  
Mit der function node möchte ich das mit 100 multiplizieren.  
Im debug node ist es richtig mit 100.  
Im Dashboard wird aber immer 1 ausgegeben.

Sicher ein einfacher Fehler von mir, aber ich komme einfach nicht weiter

```auto
[msg.payload = msg.payload *100;
return msg;]

```

 ![Bildschirm­foto 2022-11-08 um 12.45.26](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/8/380a980f1f40bf01bc97bb535c8a20791b1937ab.png)

Hello,  
I'm testing node red for the first time and can't find an answer.

The thermostat outputs the valve opening as 1.  
With the function node I want to multiply that by 100.  
In the debug node it is correct with 100.  
However, 1 is always output in the dashboard.

Certainly a simple mistake on my part, but I just can't get any further

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [8 November 2022 14:51 UTC](https://discourse.nodered.org/t/unterschiedliche-ausgabe-bei-function/70251/2 "2022-11-08T14:51:10Z")

</div>

1. Do you actually have an open and close brackets `[]` arround your code in the `function` node?

2. Please attach a `debug` node to the output of the Wohnzimmerthermostat node and show what it s outputting.

3. Whart 'range' are you using in the guage?

4. Also export your flow and attach it to a reply.

p.s. it would be nice if you added a translation to english when creating a thread.

========

1. Haben Sie tatsächlich eine öffnende und schließende Klammer „“ um Ihren Code im „Funktion“-Knoten?

2. Bitte hängen Sie einen „debug“-Knoten an die Ausgabe des Wohnzimmerthermostat-Knotens an und zeigen Sie, was er ausgibt.

3. Welchen „Bereich“ verwenden Sie in der Anzeige?

4. Exportieren Sie auch Ihren Flow und hängen Sie ihn an eine Antwort an.

p.s. Es wäre schön, wenn du beim Erstellen eines Threads eine Übersetzung ins Englische hinzufügen würdest.

---

<div class="post-metadata">

**Author:** ![JustinB](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/justinb/32/68068_2.png) [@JustinB](https://discourse.nodered.org/u/JustinB)\
**Post date:** [8 November 2022 15:39 UTC](https://discourse.nodered.org/t/unterschiedliche-ausgabe-bei-function/70251/3 "2022-11-08T15:39:44Z")

</div>

Deine Anzeige (Wohnzimmer) kann nur den gleichen Wert wie der debug node bekommen. Heißt, wenn der debug node immer den richtigen Wert erhält, kann das Problem nur bei der Anzeige, also dem Wohnzimmer-node liegen. Wie @zenofmud schon sagte, solltest Du mal den Bereich, welcher angezeigt werden darf, prüfen. Ich schätze darin liegt der Fehler. Standartmäßig hast du hier einen Wertebereich von 0 bis 10, welcher angezeigt wird. Einfach bei Range min = 0 und max = 100 setzen, falls 100 das Maximum sein soll.

---

<div class="post-metadata">

**Author:** ![hardl1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardl1/32/70383_2.png) [@hardl1](https://discourse.nodered.org/u/hardl1)\
**Post date:** [8 November 2022 16:10 UTC](https://discourse.nodered.org/t/unterschiedliche-ausgabe-bei-function/70251/4 "2022-11-08T16:10:49Z")

</div>

Sorry,  
I overlooked that this is an English speaking forum.

I changed the range to 0-100.  
A parenthesis around the code doesn't change anything either.

 ![Bildschirm­foto 2022-11-08 um 17.01.35](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/b/dbc0a6eb58f581b0c81fb0c79f29d03e99eeb960.png)  
 ![Bildschirm­foto 2022-11-08 um 17.00.57](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/2/52fa36a144d665688644225333ff3e8887dd0d71.png)

---

<div class="post-metadata">

**Author:** ![hardl1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardl1/32/70383_2.png) [@hardl1](https://discourse.nodered.org/u/hardl1)\
**Post date:** [8 November 2022 17:02 UTC](https://discourse.nodered.org/t/unterschiedliche-ausgabe-bei-function/70251/5 "2022-11-08T17:02:51Z")

</div>

Maybe my approach is fundamentally wrong.

The thermostat outputs the valve opening from 0 - 0.99. However, I would like to display the value in the gauge widget in 0-100%.

If there is another way, I'm also grateful for suggestions.

---

<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:** [8 November 2022 17:12 UTC](https://discourse.nodered.org/t/unterschiedliche-ausgabe-bei-function/70251/6 "2022-11-08T17:12:25Z")

</div>

Have you looked at the range node placed prior to the gauge?

---

<div class="post-metadata">

**Author:** ![hardl1](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardl1/32/70383_2.png) [@hardl1](https://discourse.nodered.org/u/hardl1)\
**Post date:** [8 November 2022 19:18 UTC](https://discourse.nodered.org/t/unterschiedliche-ausgabe-bei-function/70251/7 "2022-11-08T19:18:19Z")

</div>

This is how it seems to work:

```auto
msg.payload = msg.payload *100;
return msg;

```

 ![Bildschirm­foto 2022-11-08 um 20.12.17](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/b/5b980992b2edbbade5dc33fb49a9d67727547648.png)

 ![Bildschirm­foto 2022-11-08 um 20.05.24](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/9/19398c2d31e447c56a083e24b68464faf7f5ce4c.png)

Danke

---

<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:** [22 November 2022 19:18 UTC](https://discourse.nodered.org/t/unterschiedliche-ausgabe-bei-function/70251/8 "2022-11-22T19:18:28Z")

</div>

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