# Json Data Pushed from Inverter

**URL:** <https://discourse.nodered.org/t/json-data-pushed-from-inverter/26962>\
**Category:** General\
**Created:** [20 May 2020 00:57 UTC](https://discourse.nodered.org/t/json-data-pushed-from-inverter/26962 "2020-05-20T00:57:23Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [20 May 2020 08:31 UTC](https://discourse.nodered.org/t/json-data-pushed-from-inverter/26962/21 "2020-05-20T08:31:29Z")

</div>

@Bigben83 have you seen this post? Perhaps instead of the push service you could request data from its cgi endpoints?

> **[Fronius inverter integration](https://community.home-assistant.io/t/fronius-inverter-integration/19274/24)**
>
> Hi, think is is to save power. I will include the node red flow in this email. Remember to change your ip address. \[{“id”:“9593ad35.c187”,“type”:“debug”,“z”:“5948f6d6.2e0478”,“name”:“AC Power...

Just a thought.

---

<div class="post-metadata">

**Author:** ![Bigben83](https://avatars.discourse-cdn.com/v4/letter/b/46a35a/32.png) [@Bigben83](https://discourse.nodered.org/u/Bigben83)\
**Post date:** [20 May 2020 08:42 UTC](https://discourse.nodered.org/t/json-data-pushed-from-inverter/26962/22 "2020-05-20T08:42:25Z")

</div>

Yes, I had seen this, but it doesn't push the data that I'm after, it only sends power generation and consumption data.

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [20 May 2020 08:47 UTC](https://discourse.nodered.org/t/json-data-pushed-from-inverter/26962/23 "2020-05-20T08:47:04Z")

</div>

OK, well in that case look at this...

[https://repl.it/join/ozrhutci-stephenmclaughl](https://repl.it/join/ozrhutci-stephenmclaughl)

The code shows you how to take the first key out of an object.

So in your case, you could add a function node AFTER the HTTP IN node and add the following...

Option 1 - get the key & pass it out to a JSON node

```auto
var k = Object.keys(msg.payload)[0];//get first key in the payload object
msg.payload = k; 
return msg;

```

or

Option 2 - turn k into an object then pass it out (no JSON node needed)

```auto
var k = Object.keys(msg.payload)[0];//get first key in the payload object
msg.payload = JSON.parse(k)
return msg;

```

Give it a go. Put debug nodes before & after (to see if its working)

EDIT.  
Could you also paste the data you get from the inverter into your reply?  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/4/f462d5a4eca026d9d69ab0d15bf36b9b1c59c878.png)  
... i can then check it is valid JSON

---

<div class="post-metadata">

**Author:** ![Bigben83](https://avatars.discourse-cdn.com/v4/letter/b/46a35a/32.png) [@Bigben83](https://discourse.nodered.org/u/Bigben83)\
**Post date:** [20 May 2020 09:59 UTC](https://discourse.nodered.org/t/json-data-pushed-from-inverter/26962/24 "2020-05-20T09:59:07Z")

</div>

> [@Steve-Mcl](#):
>
> Option 2 - turn k into an object then pass it out (no JSON node needed)

ok this is what I got when I did the above. so that's briliant.

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

---

<div class="post-metadata">

**Author:** ![Bigben83](https://avatars.discourse-cdn.com/v4/letter/b/46a35a/32.png) [@Bigben83](https://discourse.nodered.org/u/Bigben83)\
**Post date:** [20 May 2020 10:16 UTC](https://discourse.nodered.org/t/json-data-pushed-from-inverter/26962/25 "2020-05-20T10:16:37Z")

</div>

@Steve-Mcl Thanks heaps for your help. got the result that i needed.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/5/85fa840b952814d71b1fec2e9ddbd55b3efb7fe2.png)

---

<div class="post-metadata">

**Author:** ![afelix](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/afelix/32/9743_2.png) [@afelix](https://discourse.nodered.org/u/afelix)\
**Post date:** [20 May 2020 10:50 UTC](https://discourse.nodered.org/t/json-data-pushed-from-inverter/26962/26 "2020-05-20T10:50:12Z")

</div>

Nice to see you got it working. A tip for the future to make things easier for yourself (and others reading along): if you give your debug nodes a name, the name is shown up in the debug sidebar as well, so rather than "node: efe050dc.1e1e5" it will show "node: my debug node" instead

---

<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:** [3 June 2020 10:50 UTC](https://discourse.nodered.org/t/json-data-pushed-from-inverter/26962/27 "2020-06-03T10:50:13Z")

</div>

Closed on 3 June 2020 10:50 UTC

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

[Previous page](https://discourse.nodered.org/t/json-data-pushed-from-inverter/26962.md?page=1)
