Discussions about Nibe S-series and the integration

Does anyone with a S1255 get values in the BE1/BE2/BE3 (current) sensors? Mine are all 0 which is the same as when I check through the myUplink API. Current Power (EME 20) is also 0.

I got them working on a S320, but they never go below 2 A, even when the heat pump isn’t running. Are you sure the CT-clamps are connected?

Does anyone know how you change the set point for the room temperature on a S320? It’s the value marked in the image.

This is my experimental setup for power usage, derived from 1903 (current) address using P(kwh) = U * I * 1.732 / 1000 equation for three phases. Current is register 1903 divided by 10. I have SMOS40 and Nibe s2125. So far looks like a good estimate.

     sensors:
          # 3.1.2 Overview
        - name: "wp In Power"
          unique_id: "wp_power_in"
          data_type: int16  # int8
          address: 1903
          input_type: input  # R/W
          scale: 0.06582
          precision: 2
          state_class: measurement
          unit_of_measurement: "kW"
          slave: 1

And total energy spent:

sensor:
  - platform: integration
    source: sensor.wp_power_in
    name: energy_spent
    round: 2
    unit_time: h

With new firmware (nibe-n-2_17_5.swu) new energy related modbus registers on are available on smo s40:

Energy log - Energy produced for heat during current hour	MODBUS_INPUT_REGISTER	2283	100	kWh	6	0	0	0
Energy log - Energy produced for hot water during current hour	MODBUS_INPUT_REGISTER	2285	100	kWh	6	0	0	0
Energy log - Energy produced for pool during current hour	MODBUS_INPUT_REGISTER	2287	100	kWh	6	0	0	0
Energy log - Energy produced for cooling during current hour	MODBUS_INPUT_REGISTER	2289	100	kWh	6	0	0	0
Energy log - Energy used for heat during current hour	MODBUS_INPUT_REGISTER	2291	100	kWh	6	0	0	0
Energy log - Energy used for hot water during current hour	MODBUS_INPUT_REGISTER	2293	100	kWh	6	0	0	0
Energy log - Energy used for pool during current hour	MODBUS_INPUT_REGISTER	2295	100	kWh	6	0	0	0
Energy log - Energy used for cooling during current hour	MODBUS_INPUT_REGISTER	2297	100	kWh	6	0	0	0
Energy log - Energy used by additional heater for heat during current hour	MODBUS_INPUT_REGISTER	2299	100	kWh	6	0	0	0
Energy log - Energy used by additional heater for hot water during current hour	MODBUS_INPUT_REGISTER	2301	100	kWh	6	0	0	0
Energy log - Energy used by additional heater for pool during current hour	MODBUS_INPUT_REGISTER	2303	100	kWh	6	0	0	0
Energy log - Current power consumption	MODBUS_INPUT_REGISTER	2305	100	kW	6	0	0	0
Energy log - Current power consumption, components	MODBUS_INPUT_REGISTER	2307	100	kW	6	0	0	0
i
2 Likes

Were you able to get them visible into HA?

yes.

modbus:
  - name: "Nibe2125"
    type: tcp
    host: 192.168.1.220
    port: 502
    sensors:
      - name: "Nibe heating energy last hour"
        unique_id: "nibe_in_energy_heating"
        data_type: int16  # int8
        address: 2291
        input_type: input  # R/W
        scale: 0.01
        precision: 2
        state_class: measurement
        unit_of_measurement: "kWh"
        slave: 1
        scan_interval: 900
      - name: "Nibe hot water energy last hour"
        unique_id: "nibe_in_energy_hot_water"
        data_type: int16  # int8
        address: 2293
        input_type: input  # R/W
        scale: 0.01
        precision: 2
        state_class: measurement
        unit_of_measurement: "kWh"
        slave: 1
        scan_interval: 900
      - name: "Nibe hot water add energy last hour"
        unique_id: "nibe_in_add_energy_hot_water"
        data_type: int16  # int8
        address: 2301
        input_type: input  # R/W
        scale: 0.01
        precision: 2
        state_class: measurement
        unit_of_measurement: "kWh"
        slave: 1
        scan_interval: 900
      - name: "Nibe heating add energy last hour"
        unique_id: "nibe_in_add_energy_heating"
        data_type: int16  # int8
        address: 2299
        input_type: input  # R/W
        scale: 0.01
        precision: 2
        state_class: measurement
        unit_of_measurement: "kWh"
        slave: 1
        scan_interval: 900
      - name: "nibe_current_power"
        unique_id: "nibe_current_power"
        data_type: int16  # int8
        address: 2305
        input_type: input  # R/W
        precision: 2
        state_class: measurement
        unit_of_measurement: "kW"
        scale: 0.01
        slave: 1
        scan_interval: 60
      - name: "nibe_current_power_comp"
        unique_id: "nibe_current_power_comp"
        data_type: int16  # int8
        address: 2307
        input_type: input  # R/W
        precision: 2
        state_class: measurement
        unit_of_measurement: "kW"
        scale: 0.01
        slave: 1
        scan_interval: 60

Utility meters should use delta setting:

1 Like

Within how long should I be able to see any results and/or is it possible to share your complete configuration?

The only thing I’m really interested in is somehow getting the COP value.

Curent power is sampled every 60 seconds, so it should be there quickly(2 minutes). Energy registers change once an hour and is sampled every 15 minutes, so it will take longer. Utility meter updates when energy changes , could take an hour.

COP would be total energy out divided by total energy in. COP Value for previous hour would be sum(energy produced registers) / sum (energy used registers)

Something like:

- platform: template
  sensors:
    cop:
      friendly_name: 'Last hour COP'
      entity_id:
        - sensor.nibe_in_energy_hot_water
        - sensor.nibe_in_energy_heat
        - sensor.nibe_out_energy_heat
        - sensor.nibe_out_energy_hot_water
      value_template: "{{ ((states('sensor.nibe_out_energy_heat')|float + states('sensor.nibe_out_energy_hot_water')|float)  / (states('sensor.nibe_in_energy_hot_water')|float) +states('sensor.nibe_in_energy_heat')|float))|round(3) }}"
      unit_of_measurement: ""

You would probably also need to add additional heat to the energy in values

2 Likes

@alfabetagama Thank you so much.

Big fat typo at this end with the IP address, so that should be sorted out.
Thanks also for the COP part, will report back if I get it up and running.

I couldn’t get values in BE1/BE2/B3 until image
current sensors have been installed. Now image
i wonder if the reading can be used to calculate a total house energy consumption. The sensors are installed on 3-fase input lines for monitoring and balancing the current loads. How else you can use this data. e.g. hourly consumption on individual phases ?

So, I have it up and running.

After some trial and error, I now have Total COP, Heating COP and Hot Water COP. Thank you again @alfabetagama for the directions.

Untitled picture2

For the charts I used ApexCharts Card by @RomRider (via HACS)

And I’ve added below code to my configuration.yaml:

modbus:
  - name: "NibeS2125"
    type: tcp
    host: 192.168.xxx.xxx
    port: 502
    sensors:
      - name: "IN - Nibe S2125 heating energy last hour"
        unique_id: "nibe_s2125_in_energy_heating"
        data_type: int16  # int8
        address: 2291
        input_type: input  # R/W
        scale: 0.01
        precision: 2
        state_class: measurement
        unit_of_measurement: "kWh"
        slave: 1
        scan_interval: 900
      - name: "OUT - Nibe S2125 heating energy last hour"
        unique_id: "nibe_s2125_out_energy_heating"
        data_type: int16  # int8
        address: 2283
        input_type: input  # R/W
        scale: 0.01
        precision: 2
        state_class: measurement
        unit_of_measurement: "kWh"
        slave: 1
        scan_interval: 900
      - name: "IN - Nibe S2125 hot water energy last hour"
        unique_id: "nibe_s2125_in_energy_hot_water"
        data_type: int16  # int8
        address: 2293
        input_type: input  # R/W
        scale: 0.01
        precision: 2
        state_class: measurement
        unit_of_measurement: "kWh"
        slave: 1
        scan_interval: 900
      - name: "OUT - Nibe S2125 hot water energy last hour"
        unique_id: "nibe_s2125_out_energy_hot_water"
        data_type: int16  # int8
        address: 2285
        input_type: input  # R/W
        scale: 0.01
        precision: 2
        state_class: measurement
        unit_of_measurement: "kWh"
        slave: 1
        scan_interval: 900

template:
  - sensor:
      - name: "Nibe S2125 COP Total"
        unique_id: "nibe_s2125_cop_energy"
        unit_of_measurement: ""
        state: >
          {% set nibe_s2125_out_energy_cop = states('sensor.nibe_s2125_heating_energy_last_hour_out') | float + states('sensor.nibe_s2125_hot_water_energy_last_hour_out') | float %}
          {% set nibe_s2125_in_energy_cop = states('sensor.nibe_s2125_heating_energy_last_hour_in') | float + states('sensor.nibe_s2125_hot_water_energy_last_hour_in') | float %}

          {{ (nibe_s2125_out_energy_cop / nibe_s2125_in_energy_cop) | float | round(2) }}

  - sensor:
      - name: "Nibe S2125 COP Heating"
        unique_id: "nibe_s2125_cop_energy_heating"
        unit_of_measurement: ""
        state: >
          {% set nibe_s2125_out_energy_heating = states('sensor.nibe_s2125_heating_energy_last_hour_out') | float %}
          {% set nibe_s2125_in_energy_heating = states('sensor.nibe_s2125_heating_energy_last_hour_in') | float %}

          {{ (nibe_s2125_out_energy_heating / nibe_s2125_in_energy_heating) | float | round(2) }}
  - sensor:
      - name: "Nibe S2125 COP Hot water"
        unique_id: "nibe_s2125_cop_energy_hot_water"
        unit_of_measurement: ""
        state: >
          {% set nibe_s2125_out_energy_hot_water = states('sensor.nibe_s2125_hot_water_energy_last_hour_out') | float %}
          {% set nibe_s2125_in_energy_hot_water = states('sensor.nibe_s2125_hot_water_energy_last_hour_in') | float %}

          {{ (nibe_s2125_out_energy_hot_water / nibe_s2125_in_energy_hot_water) | float | round(2) }}
1 Like

Great, thanx for the code, it will save me some time :). Heating COP looks pretty good.

Hi, I have the integration up and running for couple of weeks. My system is F2120 with SMO S40, modbus over TCP - wifi connection, but I tried LAN as well. All works fine, but i get random unavaliability periods of the modbus data. Sometimes it is a minute sometimes it is 5 minutes. Sometimes it keeps on reocurring several times after each other on other ocasions it runs smoothly for a hour. As can be seen on the defrosting entity. The gray parts are those which state unavaliable.Anyone with a similar problem? Any suggestions where to look for the reason or how to solve the problem?
image

I think it is a Nibe thing. I also have frequent timeouts on modbus. If you have terminal installed goto config directory and run:

cat home-assistant.log | grep modbus

or

tail -f home-assistant.log | grep modbus

Thank you very much for your help. But I did not succeed after trying to run those lines in terminal response was:
image

But it coudl be that I did something wrong.

I found the log in HA and found for NIBE this errors:

Logger: homeassistant.components.modbus.modbus
Source: components/modbus/modbus.py:396
Integration: Modbus 
First occurred: 9:45:16 AM (2 occurrences)
Last logged: 10:00:16 AM

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

and


Logger: homeassistant.components.nibe_heatpump
Source: components/nibe_heatpump/__init__.py:286
Integration: Nibe Heat Pump 
First occurred: 9:39:13 AM (3 occurrences)
Last logged: 10:00:13 AM

Unexpected error fetching Nibe Heat Pump data: [Errno 111] Connect call failed ('192.168.68.172', 502)

I tried to add all 4 four entities heating IN/OUT and hot water energy IN/OUT. 3 of them work and the heating energy IN keeps on going into unavaliable...

Hi, I’m new to HA and am having trouble adding my Nibe S320 + F2040.

The majority of the 790+ entities are unavailable. I have managed to adjust the heating curve slider (-10 to +10 - “Heating offset climate”) and I have managed to add some working sensors in YAML like hot water stop / start temperature values, BT25,BT6,BT7 sensors etc.

The S320 display has a card with the COP / total COP value, but I can’t figure out how to get any energy metric or value from the S320 to show in HA.

Would anyone be able to point me in the right direction? Any help would be appreciated.

EDIT: Forgot to add I’ve been reading for hours and trying different solutions, I’m not trying to sneak an easy solution in here, but I’m a little lost.

Is this modbus integration? What is the home assistant version?

This integration is for Nibe heat pumps that have tcp/ip connections, like the S series pumps.

At the moment, I’ve managed to add a whole bunch of sensors through Yaml using the MODBUS S-SERIES pdf chart, but I simply can’t get any sensors about power consumption / usage to load. It always shows as unavailable.

The pump is added through integration modbus - tcp/ip connection.

EDIT: Tried address:
1806 - Nibe Power - not quite sure what this measure but it only reads 0.2-0.6KW
2166 - Instantaneous used power - unavailable
2176 - Current power - unavailable
2178 - Total average power - show 0.0W
2180 - Total energy - show 0.00KW
And the posted above: 2291, 2293,2299,2305 and 2307 all these are unavailable