# How to change a number from payload

**URL:** <https://discourse.nodered.org/t/how-to-change-a-number-from-payload/61351>\
**Category:** General\
**Created:** [15 April 2022 21:32 UTC](https://discourse.nodered.org/t/how-to-change-a-number-from-payload/61351 "2022-04-15T21:32:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![johanmeer](https://avatars.discourse-cdn.com/v4/letter/j/7c8e57/32.png) [@johanmeer](https://discourse.nodered.org/u/johanmeer)\
**Post date:** [15 April 2022 21:32 UTC](https://discourse.nodered.org/t/how-to-change-a-number-from-payload/61351/1 "2022-04-15T21:32:20Z")

</div>

Hi!, i'm struggling with my DHT22 sensor. If i do the calibration, the sensor is 5% humidity to high according from 2 other callibrated measuresment tools. Now i thought, maybe i can change the value from the sensor -5. Is there someone how did this or knows how to do this? This is my current situation in node-red

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/1/41df14c92c6504e723abcf9faf5b8e52a4e9a8a0.png)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/c/7c614e496127c08a34b7fafb287f2204cfffb82e.png)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/e/7ee2ddf4fc0877bd61a3adf18427f4eb1530f700.png)

---

<div class="post-metadata">

**Author:** ![Sean-McG](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/sean-mcg/32/54677_2.png) [@Sean-McG](https://discourse.nodered.org/u/Sean-McG)\
**Post date:** [15 April 2022 22:38 UTC](https://discourse.nodered.org/t/how-to-change-a-number-from-payload/61351/2 "2022-04-15T22:38:33Z")

</div>

You could use a change node as follows -

```auto
[{"id":"5e31270904648203","type":"change","z":"624963ed82f87a01","name":"","rules":[{"t":"set","p":"payload.humidity","pt":"msg","to":"payload.humidity -5","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1390,"y":280,"wires":[["e6ef0f9ea7d918ec"]]},{"id":"4d3938590c6cf87d","type":"inject","z":"624963ed82f87a01","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"temp\":5,\"humidity\":10}","payloadType":"json","x":1190,"y":280,"wires":[["5e31270904648203"]]},{"id":"e6ef0f9ea7d918ec","type":"debug","z":"624963ed82f87a01","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":1570,"y":280,"wires":[]}]

```

---

<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:** [15 April 2022 22:47 UTC](https://discourse.nodered.org/t/how-to-change-a-number-from-payload/61351/3 "2022-04-15T22:47:44Z")

</div>

Here is a link to an interesting article about these sensors:

> **[Test and Calibrate DHT22 / AM2302 / RHT03 hygrometers](https://www.kandrsmith.org/RJS/Misc/Hygrometers/calib_dht22.html)**
>
> A detailed account of methodology and results for my accuracy test and calibration of 
> six DHT22 (AM2302, RHT03) hygrometers. I assess the manufacturer's data sheet claim of 2% absolute calibration
> and though my six devices do not all deliver that...

Which may be helpful to understand these devices.

---

<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:** [14 June 2022 22:48 UTC](https://discourse.nodered.org/t/how-to-change-a-number-from-payload/61351/4 "2022-06-14T22:48:23Z")

</div>

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