Discussions about Nibe S-series and the integration

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

Regarding the unavailable entities, there was a bug in version 2023.3.5. This is fixed in 2023.3.6 Nibe integration broken after Release 2023.3.5 · Issue #89852 · home-assistant/core · GitHub

Energy registers for smo s40 are only available since febrary firmware update. It could be that they are not implemented yet on s320 or that they are available on different adresses. You can check if you have latest firmware and output the latest list of modbus registers from the menu to see what is available

@wijsman Could you share the ApexCharts code you used for the graphs? I’ve been trying to build them, but I can’t get them as nice looking as yours.

Thanks!

Well @ErikRM, here you are.

Below the code of those charts.

- type: custom:apexcharts-card
        apex_config:
          title:
            text: Nibe S2125 - Heating
            align: center
            style:
              fontSize: 18px
              fontWeight: Normal
              color: rgb(225,225,225)
          chart:
            stacked: true
            width: 100%
            height: 300px
            labels:
              format: MM
          legend:
            show: false
          xaxis:
            position: bottom
        graph_span: 1year
        span:
          end: month
        show:
          last_updated: false
        header:
          show: false
        series:
          - entity: sensor.nibe_s2125_heating_energy_last_hour_in
            type: column
            unit: ' kWh'
            color: rgb(128,128,128)
            group_by:
              func: last
              duration: 1month
              start_with_last: true
            show:
              datalabels: true
          - entity: sensor.nibe_s2125_heating_energy_last_hour_out
            type: column
            unit: ' kWh'
            color: rgb(192,0,0)
            group_by:
              func: last
              duration: 1month
              start_with_last: true
            show:
              datalabels: true
      - type: custom:apexcharts-card
        apex_config:
          title:
            text: Nibe S2125 - Hot Water
            align: center
            style:
              fontSize: 18px
              fontWeight: Normal
              color: rgb(225,225,225)
          chart:
            stacked: true
            width: 100%
            height: 300px
            labels:
              format: MM
          legend:
            show: false
          xaxis:
            position: bottom
        graph_span: 1year
        span:
          end: month
        show:
          last_updated: false
        header:
          show: false
        series:
          - entity: sensor.nibe_s2125_hot_water_energy_last_hour_in
            type: column
            unit: ' kWh'
            color: rgb(128,128,128)
            group_by:
              func: last
              duration: 1month
              start_with_last: true
            show:
              datalabels: true
          - entity: sensor.nibe_s2125_hot_water_energy_last_hour_out
            type: column
            unit: ' kWh'
            color: rgb(47,85,151)
            group_by:
              func: last
              duration: 1month
              start_with_last: true
            show:
              datalabels: true
      - type: custom:apexcharts-card
        apex_config:
          title:
            text: Nibe S2125 - Heating & Hot Water
            align: center
            style:
              fontSize: 18px
              fontWeight: Normal
              color: rgb(225,225,225)
          chart:
            stacked: true
            width: 100%
            height: 300px
            labels:
              format: MM
          legend:
            show: false
          xaxis:
            position: bottom
        graph_span: 1year
        span:
          end: month
        show:
          last_updated: false
        header:
          show: false
        series:
          - entity: sensor.nibe_s2125_heating_energy_last_hour_in
            type: column
            unit: ' kWh'
            color: rgb(128,128,128)
            group_by:
              func: last
              duration: 1month
              start_with_last: true
            show:
              datalabels: false
          - entity: sensor.nibe_s2125_heating_energy_last_hour_out
            type: column
            unit: ' kWh'
            color: rgb(192,0,0)
            group_by:
              func: last
              duration: 1month
              start_with_last: true
            show:
              datalabels: false
          - entity: sensor.nibe_s2125_hot_water_energy_last_hour_in
            type: column
            unit: ' kWh'
            color: rgb(128,128,128)
            group_by:
              func: last
              duration: 1month
              start_with_last: true
            show:
              datalabels: false
          - entity: sensor.nibe_s2125_hot_water_energy_last_hour_out
            type: column
            unit: ' kWh'
            color: rgb(47,85,151)
            group_by:
              func: last
              duration: 1month
              start_with_last: true
            show:
              datalabels: false

Thanks, @wijsman ! I’ll put these into my configuration and hopefully I can then also find a way to make my modbus interation more stable. For some reason it keeps on changing the sensor names by adding _2 or _3 to them, so I keep on getting unavailable sensors. :cry:

I also noticed the graphs only show data for 2 months … maybe it has something to do with the way I have created the utility meters. When I have the time I will check & fix and afterwards share the outcome here.

Hi, has anyone been able to program the “periodic hot water” times through modbus? This is now handled through the heatpump in the middle of the night on a Tuesday. I want to be able to start this manually when the energyprices are low/negative.
What temperatures do you heat your hot water to? My heat pump stops at 58 degrees, but I imagine you can go higher using the electrical heating element. I would like to go higher during surplus energy times.

1 Like