How do I config modbus tcp for Nibe S1255?

Have you guys seen this???

This is a new integration with the latest core update.

Supported devices:

  • F1145
  • F1155
  • F1245
  • F1255
  • F1345
  • F1355
  • F370
  • F470
  • F730
  • F750
  • SMO20
  • SMO40
  • VVM225
  • VVM310
  • VVM320
  • VVM325
  • VVM500

Sadly no S series!!! :cry:

Have you tried this?

https://www.home-assistant.io/integrations/input_number/

You can configure a negative value

Yep, I´m using the input_number helper value. The value itself can also be set to negative values, only if I´m trying to use it as part of the automation to use the modbus.write_register service, I´m getting the error that it must be at least 0

here´s my automation:

alias: Nibe-Offset-Set-InputHelper
description: Automation writes to Nibe Modbus with input of helper value
trigger:
  - platform: state
    entity_id: input_number.nibe_offset_input
condition: []
action:
  - service: modbus.write_register
    data:
      address: 30
      slave: 1
      hub: Nibe
      value: "{{ states('input_number.nibe_offset_input') | int  }}"
mode: single

and the input value settings

Ok but you are way ahead of me! The only thing I was able to do with the help of other is additional hot water switch. What model heat pump do you have? What have you managed to control?

I have the VVM S320. So far I was able to read a few things like priority state, various temperatures, rpm of the compressor fan and so on. From this thread managed to set the hot water demand and now I‘m trying to manipulate the heatcurve offset - so far only successful with >=0 values :slight_smile:

1 Like

Once you have the Nibe modbus integration setup, you can use call service “Modbus: Write coil” and just enter address, state, slave and hub name and you’re set.
Example to create a switch to turn on/off “More Hot Water”:

      - name: nibe_morehotwater
        write_type: holding
        address: 697
        slave: 1
        command_on: 2
        command_off: 0

You can use the same principle for many others functions, such as offset.

I control the pump with the above switch for the hot water and for heating, I’ve created an input select list to control the heater power limit with an automation, using the call service mentioned above.

I’ve even managed to automate this with our solar panels, with triggers, that if solar production > 1kw, increase heater power limit by 1kw.
If buying > 1kw from grid, decrease heater power limit by 1kw.
Basically minimizing consumption from the heater when in “buying” mode and maximizing when we have more energy being produced from the solar panels.

To save energy from when the heater isn’t needed, I can just turn the heating function off completely by setting the power limit to 0kw.

3 Likes

Birdman86, this is cool but can you share examples of your switches code? I have the more hot water one, but other like offset etc?

Also which model heat pump do you have?

The code for the switches are simple and identical, except of course for the addresses and the on/off commands.
I deleted all my switches as I figured that I no longer need them for my setup.
I have the S320 modell.

Are you connecting via modbus tcp? Does your system use the Nibe uplink or myUplink service?

Connecting through Modbus TCP.
Not sure how it is connected to the Uplink service, or if you’d require a Premium account to use the modbus function but I have an active myUplink service subscription since I have an S-series heater/pump, the S320.

Again, the switch code is the same. You just need to figure out the address for the correct function and also the command for each function.
Those are all in the Nibe Modbus manual, or alternatively if you have a S-series model, you can just plug in a USB stick and dump all the available commands on it and find out which ones you need.

Yes we are trying to figure all that out in another discussion. Elupus the author of the current Nibe integration is trying to incorporate all that. I have sent over all the registers.

Maybe if you have any information to contribute that would be great.

Checkout the thread here.

https://community.home-assistant.io/t/how-to-connect-to-nibe-heat-pump-without-the-cloud/381099/49

It seems the modbus.write_register service wont allow negative numbers, but we can write a positive number that when interpreted as a signed 16-bit integer it turns into the negative number we want. So for -1 you would write 65535, -2 is 65534 and so forth.

I tested this just now on my VVM S320, setting register 30 (i.e. heating curve offset). Verified both by reading it back in home assistant and using the MyUplink app. You can use 2’s compliment to turn e.g. negative slider values into the correct value to write. I’m new to everything HA and it’s the middle of the night so that will be a task for another day. I’ll post the configuration then, unless somebody beats me to it.

Edit: Ehm actually just add 65536 to the number, if it’s negative

2 Likes

Cool, that is exactly the same I‘m trying to achieve with my S320 and PV.
I wasn‘t aware that you can control power limits with the S320, how are you doing that? Habe you installed the power metering clamps and read it via BE1/BE2/BE3?

Would be awesome if you could share your nibe config and the PV automation yaml :slight_smile:

1 Like

I am trying to use the switch in my Nibe S1155 which has the same holding register, but it does not seem to react to the modbus write. Did you get the integer value for the on from the export in the pump? I do not see in my export row in the csv which value I should use.
Thanks!

Yes, you can control the limit by using call service modbus.write_register and write to address 102 with these values:
0 - 0 kw, as in off.
200 - 2 kw
300 - 3 kw

700 - 7 kw
900 - 9 kw

There is no option for 8 kw.
You can use the same address to read the current limit.

Here is a simple YAML config to get you started:

alias: Automation - Nibe Auto
description: ""
trigger:
  - platform: time_pattern
    seconds: /10
    id: Every 10 seconds
condition: []
action:
  - if:
      - condition: trigger
        id: Every 10 seconds
      - condition: numeric_state
        entity_id: sensor.solar_production
        above: 1000
        alias: Solar Panels producing more than 1 kW
      - condition: numeric_state
        entity_id: sensor.nibe_power_usage
        above: 1.5
        below: 3.5
        alias: Heater uses 2 kW
    then:
      - service: modbus.write_register
        data:
          address: 102
          slave: 1
          hub: Nibe
          value: 300
        alias: Raise Nibe power limit to 3 kW
        enabled: true
    alias: If Power production greater than power consumption - Raise power limit by 1 kW
  - if:
      - condition: trigger
        id: Every 10 seconds
      - condition: numeric_state
        entity_id: sensor.power_consumption
        above: 200
        alias: Power consumption greater than 200 W
      - condition: numeric_state
        entity_id: sensor.nibe_forbrukning
        above: 1.5
        below: 2.5
        alias: Heater uses 2 kW
    then:
      - service: modbus.write_register
        data:
          address: 102
          slave: 1
          hub: Nibe
          value: 0
        alias: Set Power Limit to 0 kW, ie. turn off heater
    alias: If power consumption greater than power production - lower Power Limit by 1 kW
mode: single

It depends on which function/address you’re trying to write to.
The modbus manual from Nibe (google it) sometimes gives you the available options for that specific address.

For those of you who read 2166 Instantaneous Power here. I see that you read it as int16. The databases have it as int32 with an odd unit of “Ws”. Could you guys verify the value you get from this perhaps against your whole household usage?

It could be that it should be int32 with a scaling factor of 100 and in kW. That would match how this field is set up on the F-series pumps.

Hi Marcel,

did you manage to achieve this?
I’m trying to do basically the same thing.
But when reading the flow meters, I only get bogus results. I’ve compared them to the ones shown in the device itself. And the ones in HA are nowhere near…

Kind regards,
Manuel

Hi birdman86, I just setup a S320 with F2125 and ran into a problem. Register 2166 as in document M12676EN does not give me a correct value, this should be the instantaneous power consumption but after 5 days of monitoring this appears constantly at 875w, this is quite strange. Did you also use the same registry?
Thank you

Hi @SteveOmero,
How did you implemented your S320 as the default integration (Nibe Heat Pump - Home Assistant) for S320 is not working on my end?
I am not getting any values.
Thanks for your feedback.