# Entity value \* 1000

**URL:** <https://discourse.nodered.org/t/entity-value-1000/36587>\
**Category:** General\
**Created:** [26 November 2020 20:42 UTC](https://discourse.nodered.org/t/entity-value-1000/36587 "2020-11-26T20:42:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luuk](https://avatars.discourse-cdn.com/v4/letter/l/8e7dd6/32.png) [@Luuk](https://discourse.nodered.org/u/Luuk)\
**Post date:** [26 November 2020 20:42 UTC](https://discourse.nodered.org/t/entity-value-1000/36587/1 "2020-11-26T20:42:41Z")

</div>

Sorry for being a n00b at this.  
I have found this [https://forum.pvoutput.org/t/nodered-home-assistant-uploader/2472](https://forum.pvoutput.org/t/nodered-home-assistant-uploader/2472)  
I have imported it in NodeRed and changed the entities etc.  
The problem is that my entities sends its values in KWh and not in Wh or watt.  
So I tried to create a entity template for that value in HA but I cannot use that entity in NR, so that doesn't work in this situation.  
Now I am searching for another solution but I am not a programmer.  
I think it would be possible to the same in NodeRed and change to value to = and do \*1000 or something.  
Maybe someone can help me?

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/f/0fa63ea4a6d35c4c7b96a315fa587a9325be3492.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:** [26 November 2020 20:46 UTC](https://discourse.nodered.org/t/entity-value-1000/36587/2 "2020-11-26T20:46:34Z")

</div>

Welcome to the forum!  
Can you show us what you have in your 'V' change nodes (one will do!)

---

<div class="post-metadata">

**Author:** ![Luuk](https://avatars.discourse-cdn.com/v4/letter/l/8e7dd6/32.png) [@Luuk](https://discourse.nodered.org/u/Luuk)\
**Post date:** [26 November 2020 21:03 UTC](https://discourse.nodered.org/t/entity-value-1000/36587/3 "2020-11-26T21:03:44Z")

</div>

Thank you. Sure I can:

 ![Screenshot_20201126-220243_Chrome](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/4/34d37195a1e44da3aef7106e9824606929db3c41.jpeg)

---

<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:** [26 November 2020 21:07 UTC](https://discourse.nodered.org/t/entity-value-1000/36587/4 "2020-11-26T21:07:22Z")

</div>

Try using jsonata, like this;

![power](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/0/b0b1e89009ed40ecba29b82c929e54a2b7c18159.jpeg)

EDIT - If the payload is a **string** value, and not a **number** , then change the jsonata function to;

```auto
$number(payload)*1000

```

---

<div class="post-metadata">

**Author:** ![Luuk](https://avatars.discourse-cdn.com/v4/letter/l/8e7dd6/32.png) [@Luuk](https://discourse.nodered.org/u/Luuk)\
**Post date:** [26 November 2020 21:29 UTC](https://discourse.nodered.org/t/entity-value-1000/36587/5 "2020-11-26T21:29:14Z")

</div>

Getting this in debug info now.

msg : string[87]  
"Invalid JSONata expression: The left side of the "\*" operator must evaluate to a number"

Will try to ues $number(payload)\*1000 now

---

<div class="post-metadata">

**Author:** ![Luuk](https://avatars.discourse-cdn.com/v4/letter/l/8e7dd6/32.png) [@Luuk](https://discourse.nodered.org/u/Luuk)\
**Post date:** [26 November 2020 21:34 UTC](https://discourse.nodered.org/t/entity-value-1000/36587/6 "2020-11-26T21:34:01Z")

</div>

26-11-2020 22:30:48[node: headercheck](https://ov17.duckdns.org:8123/api/hassio_ingress/R61JA8nqzJdUN0W4_AidtNWcPd2QCGcAUrFyB8AfkIc/#)v2 : msg : Object

{ payload: "OK 200: Added Status", topic: "v2", \_msgid: "6147e5e5.6d647c", settings: object, action: object … }

This is great, it works!  
Thank you! I would like to know how do you know this? Were can I study those codes and what is the "language" of the code?

---

<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:** [26 November 2020 21:37 UTC](https://discourse.nodered.org/t/entity-value-1000/36587/7 "2020-11-26T21:37:05Z")

</div>

It's jsonata, see [https://docs.jsonata.org/overview.html](https://docs.jsonata.org/overview.html)  
I'm no expert, I learnt all I know from @janvda here in the forum by learning from his examples.

---

<div class="post-metadata">

**Author:** ![Luuk](https://avatars.discourse-cdn.com/v4/letter/l/8e7dd6/32.png) [@Luuk](https://discourse.nodered.org/u/Luuk)\
**Post date:** [26 November 2020 21:40 UTC](https://discourse.nodered.org/t/entity-value-1000/36587/8 "2020-11-26T21:40:34Z")

</div>

Ok its the first time that I work with it.  
I must say that I was close at my try. I tried this @ first:  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/5/2538a68b098bdd727456b9817fd6a9910c1ef8af.png)

But happy that you came with the solution

---

<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:** [10 December 2020 21:40 UTC](https://discourse.nodered.org/t/entity-value-1000/36587/9 "2020-12-10T21:40:38Z")

</div>

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