How do I config modbus tcp for Nibe S1255?

I’m trying to integrate my Nibe S1255 heat pump via Modbus tcp but fails. I have read in e.g. NIBE Uplink API component that @johanschelin managed to connect to a similair heat pump.

I have activated Modbus TCP in the heat pump according to the instructions i received. I have network connectivity via ethernet. I have tried a few configurations and the following is the one used in the link above:

 modbus:
   - name: "Nibe"
     type: tcp
     host: 192.168.44.20
     port: 502
     sensors:
     - name: "Varmvatten_BT7"
       unit_of_measurement: °C
       address: 8
       count: 1
       slave: 1
       precision: 1
       input_type: input
       scale: 0.1
       scan_interval: 60
     - name: "BrineInBT10"
       unit_of_measurement: °C
       address: 10
       count: 1
       precision: 1
       slave: 1
       input_type: input
       scale: 0.1
       scan_interval: 60
     - name: "BrineUtBT11"
       unit_of_measurement: °C
       address: 11
       count: 1
       precision: 1
       slave: 1
       input_type: input
       scale: 0.1

In the logs I get the following:

Logger: homeassistant.components.modbus.modbus
Source: components/modbus/modbus.py:291
Integration: Modbus (documentation, issues)
First occurred: 16:25:20 (1 occurrences)
Last logged: 16:25:20

Pymodbus: Nibe S1255: Modbus Error: [Input/Output] Modbus Error: [Invalid Message] No response received, expected at least 8 bytes (0 received)

Both HA and the heat pump are on the same network and they are connected to the same network switch.

I don’t know where to look for problems. Anyone who knows what I can improve?

1 Like

Looks like the pump is not answering on modbus calls. Can you test with the free modbus scanner and see if it can connect?
CAS Modbus Scanner - A free tool for communicating with Modbus devices (freemodbus.com)
Restart the S1255 maybe after activating modbus. Latest version of firmware on the pump?
Assign a fixed or reserved ip-number to the pump also just to be sure, even though you can see the active ip on the pump.

You can also export all available addresses by inserting a usb memory and go to menu 7,5,9, then click on export all addresses - to make sure they have the same settings (the S1155 and S1255 should use the same I think)

I have assigned a manual IP for the pump and I can ping it so from a network perspective I think it is correct. I restarted the heat pump but I still get the same error.
I download the CAS Modbus scanner and connected it. I’m not sure what to set the device to. Here is the response:


My intention was get the value of BT1 which is the ouside temperature.
It looks like I get the communication up and running, or?

I export all addresses and got a very long list. Almost 1800 registers. :slight_smile:

Strange… Then the pump is not answering correctly. I never had that problem…

How does your menu 7.5.9 look?
Are you running latest version of firmware on the pump?

Maybe contact Nibe support if the error persists.

1 Like

Menu 7.5.9:


I upgraded to 2.7.3 two days ago and there is no later upgrade available what I can see.

Nibe support then.

Thanks for your quick answers!

There is progress. I can’t really say what I have done but now I can get values via modbus with almost the same config as in the original post above.
I have set device_class and state_class now which I think makes it easier to use the entities over time.

Thanks for support during this situation!

Good to hear! Would you mind sharing your configuration as well? :grinning:

I will later today when I get home after work. :+1:

Here is my config in my configuration.yaml:
modbus: !include nibe.yaml

I have put the details in its own file since I assume it will be long and I want to minimize the risk of accidently introduce problems when editing other parts in my config.
My nibe.yaml currently looks like this (I have a few things in Swedish):

- name: Nibe
  type: tcp
  host: 192.168.44.20
  port: 502
  sensors:
  - name: "Utetemperatur (BT1)"
    device_class: temperature
    state_class: measurement
    address: 1
    count: 1
    slave: 1
    precision: 1
    input_type: input
    scale: 0.1
    scan_interval: 60
  - name: "Varmvatten_BT7"
    device_class: temperature
    state_class: measurement
    address: 8
    count: 1
    slave: 1
    precision: 1
    input_type: input
    scale: 0.1
    scan_interval: 60
  - name: "Köldbärare in (BT10)"
    device_class: temperature
    state_class: measurement
    address: 10
    count: 1
    precision: 1
    slave: 1
    input_type: input
    scale: 0.1
    scan_interval: 3600
  - name: "Köldbärare ut (BT11)"
    device_class: temperature
    state_class: measurement
    address: 11
    count: 1
    precision: 1
    slave: 1
    input_type: input
    scale: 0.1
    scan_interval: 3600

A few changes I made compared to what I got from earlier posts:

  • I have set the device_class and state_class to get some parts for free. At least I think I will benefit.
  • I have started to change scan_interval to a higher number for BT10 and BT11. I’m interested in if the drill hole gets colder or not. I’m not sure what is needed but less than what I had earlier.

Anyone with feedback on how I think is welcome! I have ideas but they are not always good.

So far I have only tried to read data. My intention is to control the heat pump in a few ways via HA:

  • I will add a sensor for inner temperature and try to control it by setting a wanted temperature inside.
  • Be able to set it in vacation mode
  • I would like to be able minimize both how much energy I consume but also minimize the cost. I would like to use hourly charging and use more electricity when it is cheap and less when it is expensive.

Since there are 1700+ parameters I think there is a lot that can be done…

1 Like

Hi @nikla did you manage to set any parameters through the modbus integration?

Hey everyone,

I´m currently getting started setting up my Nibe S320/F2120-8 combination using modbus in HA.
I can already read some basic data like temperatures outside, flow, water, etc. but I´m currently struggling getting data about engergy consumption.

The display panel directly on the device is able to show it nicely like this:


So I would like to get the data in HA - my modbus-all export csv shows a few in kWh unit but it seems these are not directly read but calculated by the unit?

Has anybody already achieved displaying energy consumption in kWh of the heatpump?

Thanks & regards,
Marcel

Hi!
Sorry for late reply! I must have missed the notification.
I have to admit that I have not managed to set any values yet. I did try for a couple of times I have failed so far.
Have you managed?

Hi!
I have a S1255 and it might be different of course. I have the same view in my S1255. When I got mine installed I also got three clamps which I assumed was needed to be installed to be able to measure consumed energy. But, as you say if the heater has the information I don’t know what the clamps should be used for.
Maybe the 600 kWh that we see in your picture is calculated and not measured.

Hi Niklas,

good point! I found the same clamps laying on my indoor module - explains why I´m not getting any values from it :see_no_evil:
But yeah still there has to be a way getting it somewhere else as the device also seems to be able to get those.

I´ll ask my technician next time.

Marcel

Please tell us what the answer is from your technician. I’m also curious.

Hi everyone,

I managed to connect my Nibe VVM S320 with F2120-16 pump to my HA. I have to set count and precision on some sensors and have to figure out, how to display pump priority (heating/hot water) and status of ext. heater. Did anyone manage to send some commands to the pump? I am only getting reads.

David

Hi David,

I see you were able to get all the values to display. I am having a slight problem with my set up.

I was able to connect and get the value of the outdoor temperature. But I cant do much with it! It shows up in sensors, but I get an exclamation mark next to it -

"This entity (‘sensor.nibe_outdoor_tempertature_bt1’) does not have a unique ID, therefore its settings cannot be managed from the UI. "

My nibe.yaml looks like this:

- name: Nibe
  type: tcp
  host: 192.168.88.220
  port: 502
  sensors:
  - name: "Nibe - Outdoor Tempertature (BT1)"
    device_class: temperature
    state_class: measurement
    unit_of_measurement: "°C"
    data_type: int16
    address: 1
    count: 1
    slave: 1
    precision: 1
    input_type: input
    scale: 0.1
    scan_interval: 30

Any help would be appreciated. (Newbie day 6)

Hi

Have a look at my .yaml I hope it helps you. There is more addresses you can use, just copy register from your Nibe pump to the USB.

I have managed to get all the sensor but I don’t have the knowledge to make any input to from HA. I think for the future the best way to connect it is thru MQTT service.

Check this topic: How to connect to Nibe heat pump without the cloud - #8 by yozik04

My nibe.yaml looks like this:

- name: "Nibe"
  close_comm_on_error: true
  delay: 5
  timeout: 5
  type: tcp
  host: 192.168.0.0
  port: 502
  sensors:

  - name: "Nibe_ZunanjaTemperatura_BT1"
    unit_of_measurement: °C
    address: 1
    count: 1
    slave: 1
    precision: 1
    input_type: input
    scale: 0.1
    
  - name: "Nibe_SobnaTemperatura"
    unit_of_measurement: °C
    address: 26
    count: 1
    precision: 1
    slave: 1
    input_type: input
    scale: 0.1
    
  - name: "Nibe_SanitarnaVodaZgoraj_BT7"
    unit_of_measurement: °C
    address: 8
    count: 1
    precision: 1
    slave: 1
    input_type: input
    scale: 0.1
    
  - name: "Nibe_DvizniVod_BT2"
    unit_of_measurement: °C
    address: 5
    count: 1
    precision: 1
    slave: 1
    input_type: input
    scale: 0.1
    
  - name: "Nibe_PovratniVod_BT3"
    unit_of_measurement: °C
    address: 7
    count: 1
    precision: 1
    slave: 1
    input_type: input
    scale: 0.1
    
  - name: "Nibe_SanitarnaVodaPolnjenje_BT6"
    unit_of_measurement: °C
    address: 9
    count: 1
    precision: 1
    slave: 1
    input_type: input
    scale: 0.1
    
  - name: "Nibe_TipaloPretoka_BF1"
    unit_of_measurement: l/m
    address: 40
    count: 1
    precision: 1
    slave: 1
    input_type: input
    scale: 0.1
    
  - name: "Nibe_HitrostCrpalke"
    unit_of_measurement: "%"
    address: 1636
    count: 1
    precision: 0
    slave: 1
    input_type: input
    scale: 1
    
  - name: "Nibe_FrekvencaKompresorja"
    unit_of_measurement: Hz
    address: 1803
    count: 1
    precision: 0
    slave: 1
    input_type: input
    scale: 0.1
    
  - name: "Nibe_Uparjalnik_BT16"
    unit_of_measurement: °C
    address: 1622
    count: 1
    precision: 1
    slave: 1
    input_type: input
    scale: 0.1
    
  - name: "Nibe_Power"
    unit_of_measurement: kW
    address: 1806
    precision: 1
    slave: 1
    input_type: input
    scale: 0.1
    
  - name: "Nibe_FanSpeed"
    unit_of_measurement: rpm
    address: 401
    count: 1
    precision: 0
    slave: 1
    input_type: input
    scale: 1
    
  - name: "Nibe_VecSanitarneVode"
    unit_of_measurement: ""
    address: 225
    count: 1
    precision: 0
    slave: 1
    input_type: holding
    scale: 1
    
  - name: "Nibe_HotWaterDemand"
    unit_of_measurement: ""
    address: 56
    count: 1
    precision: 0
    slave: 1
    input_type: holding
    scale: 1
    
  - name: "Nibe_Defrost"
    unit_of_measurement: ""
    address: 1805
    count: 1
    precision: 0
    slave: 1
    input_type: input
    scale: 1
    
  - name: "Nibe_Prioriteta"
    address: 1028
    count: 1
    precision: 0
    slave: 1
    input_type: input
    scale: 1
    
  - name: "Nibe_operating_mode"
    address: 237
    count: 1
    precision: 0
    slave: 1
    input_type: holding
    scale: 1