# Write data to Solar Inverter using NR

**URL:** <https://discourse.nodered.org/t/write-data-to-solar-inverter-using-nr/63841>\
**Category:** General\
**Tags:** node-red-dashboard, function-node, mqtt\
**Created:** [13 June 2022 06:53 UTC](https://discourse.nodered.org/t/write-data-to-solar-inverter-using-nr/63841 "2022-06-13T06:53:09Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marc18](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@Marc18](https://discourse.nodered.org/u/Marc18)\
**Post date:** [13 June 2022 06:53 UTC](https://discourse.nodered.org/t/write-data-to-solar-inverter-using-nr/63841/1 "2022-06-13T06:53:09Z")

</div>

Hi All  
New to the forum, hoping to learn much from here..  
i need assistance please, i have a Sunsynk inverter connected to home assistant, via serial.  
i have successfully managed to read modbus data from the inverter and create dashboards, after many weeks of work..  
Next step is to write data back to the inverter to enable/disable a function on a schedule  
i know the register value (244), however after many many attempts i cannot get this to work.  
i can read the register value, but all my flows that try to write back seem to fail.  
Please can someone show me where im going wrong. Flows below

 ![Screenshot 2022-06-13 at 08.51.00](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/f/1fee02c5f70d8d83f11d0ccf292bd94b32c3be65.png)  
 ![Screenshot 2022-06-13 at 08.51.24](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/5/453142bf15af1a1279c807e50a4edc186d195c3b.png)

---

<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:** [13 June 2022 07:08 UTC](https://discourse.nodered.org/t/write-data-to-solar-inverter-using-nr/63841/2 "2022-06-13T07:08:27Z")

</div>

Hi Marc18,

looking at the image you posted, I see you do not add a `value` field in the function. I suspect you add that in the `change` node? (cant tell as you didnt export the flow JSON)

If that is the case, I suspect you have the change node set wrong (it looks like it updates `flow.payload` not `msg.payload.value`)

---

<div class="post-metadata">

**Author:** ![Marc18](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@Marc18](https://discourse.nodered.org/u/Marc18)\
**Post date:** [13 June 2022 07:13 UTC](https://discourse.nodered.org/t/write-data-to-solar-inverter-using-nr/63841/3 "2022-06-13T07:13:18Z")

</div>

Thanks for the reply @Steve-Mcl  
so if i understand you correctly i need to change flow,payload to msg.payload.value in the change node?  
this is what it currently is..

 ![Screenshot 2022-06-13 at 09.11.44](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/1/912e75a3497719c84960b26c577f3b49a58cd0f5.png)

---

<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:** [13 June 2022 07:14 UTC](https://discourse.nodered.org/t/write-data-to-solar-inverter-using-nr/63841/4 "2022-06-13T07:14:41Z")

</div>

If you attach a debug node to the output of the change node - you will see the value being sent to the modbus write node does NOT contain a value property.

So yes, change that top line to msg.payload.value.

---

<div class="post-metadata">

**Author:** ![Marc18](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@Marc18](https://discourse.nodered.org/u/Marc18)\
**Post date:** [13 June 2022 07:17 UTC](https://discourse.nodered.org/t/write-data-to-solar-inverter-using-nr/63841/5 "2022-06-13T07:17:24Z")

</div>

ok great thanks for the assistance, its really appreciated..i shall try that  
and then anther question if i may, once the schedule has completed/ended, do i need another flow to change the setting back to original (value 2)? or can it be part of the same flow?

---

<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:** [13 June 2022 07:20 UTC](https://discourse.nodered.org/t/write-data-to-solar-inverter-using-nr/63841/6 "2022-06-13T07:20:16Z")

</div>

You can do whatever you can imagine 🙂

---

<div class="post-metadata">

**Author:** ![Marc18](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@Marc18](https://discourse.nodered.org/u/Marc18)\
**Post date:** [13 June 2022 07:29 UTC](https://discourse.nodered.org/t/write-data-to-solar-inverter-using-nr/63841/7 "2022-06-13T07:29:18Z")

</div>

thanks again @Steve-Mcl

---

<div class="post-metadata">

**Author:** ![eddee54455](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/eddee54455/32/43350_2.png) [@eddee54455](https://discourse.nodered.org/u/eddee54455)\
**Post date:** [13 June 2022 16:04 UTC](https://discourse.nodered.org/t/write-data-to-solar-inverter-using-nr/63841/8 "2022-06-13T16:04:18Z")

</div>

Hi @Marc18,

I don't have a Sunsync invertyer, but a mate of mine does...

He mentioned something a while back...

Take a look on: `www.powerforum.co.za` ....

If I remember correctly, there was a user with the handle `Bloubul` that has done quite a bit with them...

Cheerz  
Ed

---

<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:** [12 August 2022 16:05 UTC](https://discourse.nodered.org/t/write-data-to-solar-inverter-using-nr/63841/9 "2022-08-12T16:05:05Z")

</div>

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