# How to send Modbus Values to Solarfocus Heatpump via NodeRed

**URL:** <https://discourse.nodered.org/t/how-to-send-modbus-values-to-solarfocus-heatpump-via-nodered/97153>\
**Category:** General\
**Created:** [20 May 2025 04:48 UTC](https://discourse.nodered.org/t/how-to-send-modbus-values-to-solarfocus-heatpump-via-nodered/97153 "2025-05-20T04:48:45Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gawan](https://avatars.discourse-cdn.com/v4/letter/g/e9c0ed/32.png) [@Gawan](https://discourse.nodered.org/u/Gawan)\
**Post date:** [20 May 2025 04:48 UTC](https://discourse.nodered.org/t/how-to-send-modbus-values-to-solarfocus-heatpump-via-nodered/97153/1 "2025-05-20T04:48:46Z")

</div>

Hi,

I try to send external temperature via NodeRod to a Modbus Register in my Solarfocus VampAir Heatpump.

It works perfectly fine for positive numbers, but does not work for negative numbers:  
This is how it works for positive:

```auto
let temp = 280; // *10
let buf = Buffer.alloc(2); // 2 Byte = 16 Bit
buf.writeInt16BE(temp); // big-endian 

msg.topic = 'Temperature';
msg.payload = {
    value: buf,
    fc: 16,
    address: 33406,
    quantity: 2
}
return msg;

```

but if I set 280 to -280, the heatpump does not react and does not do anything.  
Does anybody have an idea ?

---

<div class="post-metadata">

**Author:** ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)\
**Post date:** [20 May 2025 19:57 UTC](https://discourse.nodered.org/t/how-to-send-modbus-values-to-solarfocus-heatpump-via-nodered/97153/2 "2025-05-20T19:57:00Z")

</div>

What node are you using for the modbus communication?

---

<div class="post-metadata">

**Author:** ![Gawan](https://avatars.discourse-cdn.com/v4/letter/g/e9c0ed/32.png) [@Gawan](https://discourse.nodered.org/u/Gawan)\
**Post date:** [21 May 2025 04:04 UTC](https://discourse.nodered.org/t/how-to-send-modbus-values-to-solarfocus-heatpump-via-nodered/97153/3 "2025-05-21T04:04:43Z")

</div>

I am using the Modbus-Flex-Write node

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [21 May 2025 13:02 UTC](https://discourse.nodered.org/t/how-to-send-modbus-values-to-solarfocus-heatpump-via-nodered/97153/4 "2025-05-21T13:02:17Z")

</div>

Hi .. writing the `buf` as you do is not correct

> [@Gawan](#):
>
> `value: buf,`

because in the node's documentation it says :

> For FC 6, **msg.payload** must be a single value between 0:65535. For FC 16, **msg.payload** must be an array of comma separated values between 0:65535 each.

I believe you need to convert the signed int to an unsigned int.  
Also why you had quantity 2 ? since you are writing only 1 register ?

Try:

```auto
let temp = -280; // *10
let buf = Buffer.alloc(2); // 2 Byte = 16 Bit
buf.writeInt16BE(temp); // big-endian

msg.topic = 'Temperature';
msg.payload = {
    value: buf.readUInt16BE(),
    fc: 6,
    address: 33406,
    quantity: 1
}
return msg;

```

---

<div class="post-metadata">

**Author:** ![Gawan](https://avatars.discourse-cdn.com/v4/letter/g/e9c0ed/32.png) [@Gawan](https://discourse.nodered.org/u/Gawan)\
**Post date:** [21 May 2025 19:52 UTC](https://discourse.nodered.org/t/how-to-send-modbus-values-to-solarfocus-heatpump-via-nodered/97153/5 "2025-05-21T19:52:33Z")

</div>

> [@UnborN](#):
>
> ```auto
> let temp = -280; // *10
> let buf = Buffer.alloc(2); // 2 Byte = 16 Bit
> buf.writeInt16BE(temp); // big-endian
> 
> msg.topic = 'Temperature';
> msg.payload = {
> value: buf.readUInt16BE(),
> fc: 6,
> address: 33406,
> quantity: 1
> }
> return msg;
> 
> ```

I just tried your version, but I get an error that says

""Error: Modbus exception 1: Illegal function (device does not support this read/write function)"

The definition of the Register I want to write looks like this:

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

and if I send a positive value it works fine .... but unfortunately it does not for negative values

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [21 May 2025 20:04 UTC](https://discourse.nodered.org/t/how-to-send-modbus-values-to-solarfocus-heatpump-via-nodered/97153/6 "2025-05-21T20:04:13Z")

</div>

.. strange that it doesnt support FC6 .. try FC16 like you had before

```auto
msg.payload = {
    value: buf.readUInt16BE(),
    fc: 16,
    address: 33406,
    quantity: 1
}

```

---

<div class="post-metadata">

**Author:** ![Gawan](https://avatars.discourse-cdn.com/v4/letter/g/e9c0ed/32.png) [@Gawan](https://discourse.nodered.org/u/Gawan)\
**Post date:** [21 May 2025 21:30 UTC](https://discourse.nodered.org/t/how-to-send-modbus-values-to-solarfocus-heatpump-via-nodered/97153/7 "2025-05-21T21:30:52Z")

</div>

> [@UnborN](#):
>
> ```auto
> msg.payload = {
> value: buf.readUInt16BE(),
> fc: 16,
> address: 33406,
> quantity: 1
> }
> 
> ```

now I get this error message:

"Error: Quantity should be less or equal to register payload array length: undefined Addr: 33406 Q: 1"

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [21 May 2025 21:35 UTC](https://discourse.nodered.org/t/how-to-send-modbus-values-to-solarfocus-heatpump-via-nodered/97153/8 "2025-05-21T21:35:46Z")

</div>

ah yes ... value should have been an array for fc16 .. `value: [buf.readUInt16BE()],`

---

<div class="post-metadata">

**Author:** ![Gawan](https://avatars.discourse-cdn.com/v4/letter/g/e9c0ed/32.png) [@Gawan](https://discourse.nodered.org/u/Gawan)\
**Post date:** [22 May 2025 07:00 UTC](https://discourse.nodered.org/t/how-to-send-modbus-values-to-solarfocus-heatpump-via-nodered/97153/9 "2025-05-22T07:00:30Z")

</div>

This is the object that is sent now with your latest proposal:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/6/6651f91a0aaf550c86d932c0e8b7de35c9ef533a.png)

what happens on the receiver side is, that the value is set back to "default" - means that the value is taken again from the temperature sensor itself instead of my "feeding" process

if I send a positive value (e.g. 35) it works perfectly fine

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

---

<div class="post-metadata">

**Author:** ![UnborN](https://avatars.discourse-cdn.com/v4/letter/u/4491bb/32.png) [@UnborN](https://discourse.nodered.org/u/UnborN)\
**Post date:** [23 May 2025 07:37 UTC](https://discourse.nodered.org/t/how-to-send-modbus-values-to-solarfocus-heatpump-via-nodered/97153/10 "2025-05-23T07:37:03Z")

</div>

> [@Gawan](#):
>
> what happens on the receiver side is, that the value is set back to "default"

it mentions in the description for that register that it needs to be updated every 30min.  
could that be the cause ? based on this i wanted to clarify .. does the negative value ever get written .. but gets replaced by the temp. sensor later on ? (when you write the negative value, did you immediately try to do a read of 33406 to confirm ?)

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

In your screenshot of the register (at least in the german version of the manual) there seems to be firmware number v20.110 .. did you check if your device is up to date ?

Try contacting Solarfocus technical support because from the modbus communication side of things everything looks ok.

---

<div class="post-metadata">

**Author:** ![Gawan](https://avatars.discourse-cdn.com/v4/letter/g/e9c0ed/32.png) [@Gawan](https://discourse.nodered.org/u/Gawan)\
**Post date:** [23 May 2025 07:50 UTC](https://discourse.nodered.org/t/how-to-send-modbus-values-to-solarfocus-heatpump-via-nodered/97153/11 "2025-05-23T07:50:23Z")

</div>

no, the negtaive qty never gets written - it does not change if I send a negative value  
and it immediately changes if I send a positive on  
after 30 minutes without sending a value is is set back to default and the integrated sensor is sending its data again

the heatpump was installed a few days ago, so my assumption was that I got the latest firmware version 😊

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [23 May 2025 08:04 UTC](https://discourse.nodered.org/t/how-to-send-modbus-values-to-solarfocus-heatpump-via-nodered/97153/12 "2025-05-23T08:04:18Z")

</div>

> [@Gawan](#):
>
> the heatpump was installed a few days ago, so my assumption was that I got the latest firmware version 😊

It may will have been manufactured a year ago.

---

<div class="post-metadata">

**Author:** ![Gawan](https://avatars.discourse-cdn.com/v4/letter/g/e9c0ed/32.png) [@Gawan](https://discourse.nodered.org/u/Gawan)\
**Post date:** [23 May 2025 08:26 UTC](https://discourse.nodered.org/t/how-to-send-modbus-values-to-solarfocus-heatpump-via-nodered/97153/13 "2025-05-23T08:26:51Z")

</div>

the active firmware is 24.x  
the documentation is requiring 20.x  
that should be fine ...

---

<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:** [21 August 2025 08:27 UTC](https://discourse.nodered.org/t/how-to-send-modbus-values-to-solarfocus-heatpump-via-nodered/97153/14 "2025-08-21T08:27:37Z")

</div>

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