# Extract data from payload (sonoff ihost)

**URL:** <https://discourse.nodered.org/t/extract-data-from-payload-sonoff-ihost/85746>\
**Category:** General\
**Created:** [21 February 2024 19:56 UTC](https://discourse.nodered.org/t/extract-data-from-payload-sonoff-ihost/85746 "2024-02-21T19:56:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![joris05](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joris05/32/88505_2.png) [@joris05](https://discourse.nodered.org/u/joris05)\
**Post date:** [21 February 2024 19:56 UTC](https://discourse.nodered.org/t/extract-data-from-payload-sonoff-ihost/85746/1 "2024-02-21T19:56:59Z")

</div>

Hello, I am using node red on a Sonoff ihost box and I want to isolate the temperature and humidity value from a payload. I'm trying to use the "change" node to extract an object but I have the impression that my payloas has no object (see photo

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/5/f53faef5d1056dce4ecb3ac052eed107122e85f6.png)  
). Can you help me ? Thanks  
(i'm french)

---

<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:** [21 February 2024 20:25 UTC](https://discourse.nodered.org/t/extract-data-from-payload-sonoff-ihost/85746/2 "2024-02-21T20:25:48Z")

</div>

Looks like payload is a JSON string, pass it through a JSON node to create a JS object, then the change node may work.

But it looks like there is no temperature property in the JSON string anyway.

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [22 February 2024 05:07 UTC](https://discourse.nodered.org/t/extract-data-from-payload-sonoff-ihost/85746/3 "2024-02-22T05:07:27Z")

</div>

If the node on the extreme left of your flow is a standard MQTT-In node, then you could set the 'Output' option to 'auto-detect' to output a parsed JSON object (so no need for an additional JSON node).  
 ![auto_detect](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/4/c444ada7a0460d1cfb67158b897b691a2d77209d.png)

---

<div class="post-metadata">

**Author:** ![joris05](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/joris05/32/88505_2.png) [@joris05](https://discourse.nodered.org/u/joris05)\
**Post date:** [22 February 2024 16:56 UTC](https://discourse.nodered.org/t/extract-data-from-payload-sonoff-ihost/85746/4 "2024-02-22T16:56:01Z")

</div>

Thank you !

---

<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:** [7 March 2024 16:56 UTC](https://discourse.nodered.org/t/extract-data-from-payload-sonoff-ihost/85746/5 "2024-03-07T16:56:15Z")

</div>

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