Controlling Ecoforest heatpumps via Modbus

I have a setup that works well with the next settings:

modbus:
  - name: serial1
    type: serial
    method: rtu
    port: /dev/ttyS0
    baudrate: 19200
    stopbits: 2
    bytesize: 8
    parity: N
    
  - name: serial2
    type: serial
    method: rtu
    port: /dev/ttyS1
    baudrate: 9600
    stopbits: 1
    bytesize: 8
    parity: N


sensors:
  #kwhmeters
  - platform: modbus
    scan_interval: 30
    registers:
    - name: KWHMeter02_72
      hub: serial2
      unit_of_measurement: kwh
      register: 72
      register_type: input
      count: 2
      slave: 2
      precision: 2
      data_type: float
    - name: KWHMeter02_52
      hub: serial2
      unit_of_measurement: W
      register: 52
      register_type: input
      count: 2
      slave: 2
      precision: 2
      data_type: float
    - name: KWHMeter01_72
      hub: serial2
      unit_of_measurement: kwh
      register: 72
      register_type: input
      count: 2
      slave: 1
      precision: 2
      data_type: float
    - name: KWHMeter01_52
      hub: serial2
      unit_of_measurement: W
      register: 52
      register_type: input
      count: 2
      slave: 1
      precision: 2
      data_type: float

  - platform: modbus
    #EcoForest
    scan_interval: 10
    registers:
    - name: Heatpump Buitentemperatuur
      hub: serial1
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      slave: 17
      register: 11
    - name: Heatpump Boiler
      hub: serial1
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      slave: 17
      register: 8
    - name: Heatpump Pressure Brine
      hub: serial1
      unit_of_measurement: Bar
      scale: 0.1
      precision: 1
      slave: 17
      register: 13

When I change to the new style settings, the secondary serial port is not read and values stay zero:

modbus:
  - name: serial1
    type: serial
    method: rtu
    port: /dev/ttyS0
    baudrate: 19200
    stopbits: 2
    bytesize: 8
    parity: N
    binary_sensors:
    - name: heatpump_alarm
      slave: 17
      address: 50
    - name: Heatpump Summer
      slave: 17
      address: 127
    - name: Heatpump Winter
      slave: 17
      address: 128
    sensors:
    - name: Heatpump Buitentemperatuur
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      slave: 17
      address: 11
    - name: Heatpump Boiler
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      slave: 17
      address: 8
    - name: Heatpump Pressure Brine
      unit_of_measurement: Bar
      scale: 0.1
      precision: 1
      slave: 17
      address: 13
    
  - name: serial2
    type: serial
    method: rtu
    port: /dev/ttyS1
    baudrate: 9600
    stopbits: 1
    bytesize: 8
    parity: N
    sensors:
    - name: KWHMeter02_72
      unit_of_measurement: kwh
      address: 72
      count: 2
      slave: 2
      precision: 2
      data_type: float
    - name: KWHMeter02_52
      unit_of_measurement: W
      address: 52
      count: 2
      slave: 2
      precision: 2
      data_type: float
    - name: KWHMeter01_72
      unit_of_measurement: kwh
      address: 72
      count: 2
      slave: 1
      precision: 2
      data_type: float
    - name: KWHMeter01_52
      unit_of_measurement: W
      address: 52
      count: 2
      slave: 1
      precision: 2
      data_type: float

If I change the first serial interface to the new settings, it works well.
Only the second interface is not read and stays zero.

Is this a misconfiguration or a bug?

ps: the sensor list for the serial1 interface is way longer than this and is shortened for convenience.

1 Like

Does anyone have the same kind of setup for Modbus with 2 serial interfaces?

And tried again with a newer version of HA (2020.8.4) and still no clue why it does not work.
Changed to one port that uses RTUoverTCP and the other a USBserial converter on a RS232 to RS485 converter.
Working version but obsolete style:

modbus:
  - name: "hub1"
    type: rtuovertcp
    host: 192.168.30.21
    port: 502
    binary_sensors:
    - name: heatpump_alarm
      slave: 17
      address: 50
    - name: Heatpump Summer
      slave: 17
      address: 127
    - name: Heatpump Winter
      slave: 17
      address: 128
    sensors:
    - name: Heatpump Buitentemperatuur
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      slave: 17
      address: 11
    - name: Heatpump Boiler
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      slave: 17
      address: 8
    - name: Heatpump Pressure Brine
      unit_of_measurement: Bar
      scale: 0.1
      precision: 1
      slave: 17
      address: 13
    - name: Heatpump Pressure Heating
      unit_of_measurement: Bar
      scale: 0.1
      precision: 1
      slave: 17
      address: 14

  - name: "serial2"
    type: serial
    method: rtu
    port: /dev/serial/by-id/usb-FIDI_usb_serial_converter_FTCBXHSW-if00-port0
    baudrate: 9600
    stopbits: 1
    bytesize: 8
    parity: N


sensor:
  - platform: modbus
    # scan_interval: 30
    registers:
    - name: KWHMeter02_72
      hub: "serial2"
      unit_of_measurement: kwh
      register: 72
      register_type: input
      count: 2
      slave: 2
      precision: 2
      data_type: float
    - name: KWHMeter02_52
      hub: "serial2"
      unit_of_measurement: W
      register: 52
      register_type: input
      count: 2
      slave: 2
      precision: 2
      data_type: float
    - name: KWHMeter01_72
      hub: "serial2"
      unit_of_measurement: kwh
      register: 72
      register_type: input
      count: 2
      slave: 1
      precision: 2
      data_type: float
    - name: KWHMeter01_52
      hub: "serial2"
      unit_of_measurement: W
      register: 52
      register_type: input
      count: 2
      slave: 1
      precision: 2
      data_type: float

And this does not work (new style):

modbus:
  - name: "hub1"
    type: rtuovertcp
    host: 192.168.30.21
    port: 502
    binary_sensors:
    - name: heatpump_alarm
      slave: 17
      address: 50
    - name: Heatpump Summer
      slave: 17
      address: 127
    - name: Heatpump Winter
      slave: 17
      address: 128
    sensors:
    - name: Heatpump Buitentemperatuur
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      slave: 17
      address: 11
    - name: Heatpump Boiler
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      slave: 17
      address: 8
    - name: Heatpump Pressure Brine
      unit_of_measurement: Bar
      scale: 0.1
      precision: 1
      slave: 17
      address: 13
    - name: Heatpump Pressure Heating
      unit_of_measurement: Bar
      scale: 0.1
      precision: 1
      slave: 17
      address: 14

  - name: "serial2"
    type: serial
    method: rtu
    port: /dev/serial/by-id/usb-FIDI_usb_serial_converter_FTCBXHSW-if00-port0
    baudrate: 9600
    stopbits: 1
    bytesize: 8
    parity: N
    sensors:
    - name: KWHMeter02_72
      unit_of_measurement: kwh
      address: 72
      count: 2
      slave: 2
      precision: 2
      data_type: float
    - name: KWHMeter02_52
      unit_of_measurement: W
      address: 52
      count: 2
      slave: 2
      precision: 2
      data_type: float
    - name: KWHMeter01_72
      unit_of_measurement: kwh
      address: 72
      count: 2
      slave: 1
      precision: 2
      data_type: float
    - name: KWHMeter01_52
      unit_of_measurement: W
      address: 52
      count: 2
      slave: 1
      precision: 2
      data_type: float

The serial port does not read any values and stay zero.
The only thing I see in the logs is that it tries to convert an INT value but that is for both TCP and serial connections.

2021-08-08 13:27:13 WARNING (MainThread) [homeassistant.components.modbus.validators] Heatpump Buitentemperatuur with int is not valid, trying to convert
2021-08-08 13:27:13 WARNING (MainThread) [homeassistant.components.modbus.validators] Heatpump Boiler with int is not valid, trying to convert
2021-08-08 13:27:13 WARNING (MainThread) [homeassistant.components.modbus.validators] Heatpump Pressure Brine with int is not valid, trying to convert
2021-08-08 13:27:13 WARNING (MainThread) [homeassistant.components.modbus.validators] Heatpump Pressure Heating with int is not valid, trying to convert

Am I doing something wrong here?

Found the issue: the kwh meters were missing the input_type: input
That’s why the values stayed zero.

Hi NielsS,

Do you have this working with an ecoforest heatpump?

I also have an ecoforest heatpump using an easynet-module of Eplucon to have browser-access.
And what should I exactly need for that connection?

kind regards,
Gerlof

1 Like

This connection is made with a RS232/RS485 converter on the BMS2 port (inside on the main controler) of the Ecoforest.
I do not have the Easynet module installed. Maybe your BMS2 port is occupied with the module. If not, you can use that port. The port must be enabled (which was in my configuration)

For convenience I attach the config I use: (the USB to serial converter needs to be configured as in your HA config available)

# modbus
modbus:
  - name: "ecoforest"
    delay: 5
    type: serial
    method: rtu
    port: /dev/serial/by-id/usb-Prolific_Technology_Inc._USB-Serial_Controller-if00-port0
    baudrate: 19200
    stopbits: 2
    bytesize: 8
    parity: N
    binary_sensors:
    - name: heatpump_alarm
      slave: 17
      address: 50
    - name: Heatpump Summer
      slave: 17
      address: 127
    - name: Heatpump Winter
      slave: 17
      address: 128
    sensors:
    - name: Heatpump Buitentemperatuur
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      slave: 17
      address: 11
      data_type: int16
    - name: Heatpump Boiler
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      slave: 17
      address: 8
      data_type: int16
    - name: Heatpump Pressure Brine
      unit_of_measurement: Bar
      scale: 0.1
      precision: 1
      slave: 17
      address: 13
      data_type: int16
    - name: Heatpump Pressure Heating
      unit_of_measurement: Bar
      scale: 0.1
      precision: 1
      slave: 17
      address: 14
      data_type: int16
    - name: Heatpump Brine air outlet
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      slave: 17
      address: 29
      data_type: int16
    - name: Heatpump Brine out
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      slave: 17
      address: 1
      data_type: int16
    - name: Heatpump Brine in
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      slave: 17
      address: 2
      data_type: int16
    - name: Heatpump Heating out
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      slave: 17
      address: 3
      data_type: int16
    - name: Heatpump Heating in
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      slave: 17
      address: 4
      data_type: int16
    - name: Heatpump Compressor suction temperature
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      slave: 17
      address: 5
      data_type: int16
    - name: Heatpump Compresor suction pressure
      unit_of_measurement: Bar
      scale: 0.1
      precision: 1
      slave: 17
      address: 6
      data_type: int16
    - name: Heatpump Compressor discharge pressure
      unit_of_measurement: Bar
      scale: 0.1
      precision: 1
      slave: 17
      address: 7
      data_type: int16
    - name: Heatpump Condensation temperature
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      slave: 17
      address: 94
      data_type: int16

    - name: Heatpump Superheat
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      slave: 17
      address: 132
      data_type: int16
    - name: Heatpump Expansion valve position
      unit_of_measurement: "%"
      slave: 17
      address: 133
      data_type: int16

    - name: Heatpump Supply Temperature SG2
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      slave: 17
      address: 194
      data_type: int16
    - name: Heatpump Supply Temperature SG3
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      slave: 17
      address: 195
      data_type: int16
    - name: Heatpump Supply Temperature SG4
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      slave: 17
      address: 196
      data_type: int16
      
    - name: Heatpump Start Temperature DHW
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      slave: 17
      address: 198
      data_type: int16

    - name: Heatpump Evaporation temperature
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      slave: 17
      address: 199
      data_type: int16
    - name: Heatpump Compressor discharge temperature
      unit_of_measurement: °C
      scale: 0.1
      precision: 1
      slave: 17
      address: 203
      data_type: int16
    - name: Heatpump COP
      unit_of_measurement: COP
      scale: 0.1
      precision: 1
      slave: 17
      address: 30
      data_type: int16
    - name: Heatpump EER
      unit_of_measurement: EER
      scale: 0.1
      precision: 1
      slave: 17
      address: 202
      data_type: int16


    - name: Heatpump Compressor RPM
      unit_of_measurement: RPM
      slave: 17
      address: 5002
      data_type: int16
    - name: Heatpump Scroll temperature
      unit_of_measurement: °C
      slave: 17
      address: 5004
      data_type: int16
    - name: Heatpump Inverter temperature
      unit_of_measurement: °C
      slave: 17
      address: 5005
      data_type: int16
      
    - name: Heatpump Working Hours L
      slave: 17
      address: 5080
      data_type: int16
    - name: Heatpump Working Hours H
      slave: 17
      address: 5081
      data_type: int16

    - name: Heatpump Powerconsumption
      unit_of_measurement: W
      slave: 17
      address: 5082
      data_type: int16
    - name: Heatpump Condensation capacity
      unit_of_measurement: W
      slave: 17
      address: 5083
      data_type: int16
    - name: Heatpump Evaporation capacity
      unit_of_measurement: W
      slave: 17
      address: 5185
      data_type: int16
      
    - name: Heatpump Condensation Energy january
      unit_of_measurement: kWh
      slave: 17
      address: 5144
      data_type: int16
    - name: Heatpump Condensation Energy february
      unit_of_measurement: kWh
      slave: 17
      address: 5145
      data_type: int16
    - name: Heatpump Condensation Energy march
      unit_of_measurement: kWh
      slave: 17
      address: 5146
      data_type: int16
    - name: Heatpump Condensation Energy april
      unit_of_measurement: kWh
      slave: 17
      address: 5147
      data_type: int16
    - name: Heatpump Condensation Energy may
      unit_of_measurement: kWh
      slave: 17
      address: 5148
      data_type: int16
    - name: Heatpump Condensation Energy june
      unit_of_measurement: kWh
      slave: 17
      address: 5149
      data_type: int16
    - name: Heatpump Condensation Energy july
      unit_of_measurement: kWh
      slave: 17
      address: 5150
      data_type: int16
    - name: Heatpump Condensation Energy august
      unit_of_measurement: kWh
      slave: 17
      address: 5151
      data_type: int16
    - name: Heatpump Condensation Energy september
      unit_of_measurement: kWh
      slave: 17
      address: 5152
      data_type: int16
    - name: Heatpump Condensation Energy october
      unit_of_measurement: kWh
      slave: 17
      address: 5153
      data_type: int16
    - name: Heatpump Condensation Energy november
      unit_of_measurement: kWh
      slave: 17
      address: 5154
      data_type: int16
    - name: Heatpump Condensation Energy december
      unit_of_measurement: kWh
      slave: 17
      address: 5155
      data_type: int16

    - name: Heatpump Evaporation Energy january
      unit_of_measurement: kWh
      slave: 17
      address: 5156
      data_type: int16
    - name: Heatpump Evaporation Energy february
      unit_of_measurement: kWh
      slave: 17
      address: 5157
      data_type: int16
    - name: Heatpump Evaporation Energy march
      unit_of_measurement: kWh
      slave: 17
      address: 5158
      data_type: int16
    - name: Heatpump Evaporation Energy april
      unit_of_measurement: kWh
      slave: 17
      address: 5159
      data_type: int16
    - name: Heatpump Evaporation Energy may
      unit_of_measurement: kWh
      slave: 17
      address: 5160
      data_type: int16
    - name: Heatpump Evaporation Energy june
      unit_of_measurement: kWh
      slave: 17
      address: 5161
      data_type: int16
    - name: Heatpump Evaporation Energy july
      unit_of_measurement: kWh
      slave: 17
      address: 5162
      data_type: int16
    - name: Heatpump Evaporation Energy august
      unit_of_measurement: kWh
      slave: 17
      address: 5163
      data_type: int16
    - name: Heatpump Evaporation Energy september
      unit_of_measurement: kWh
      slave: 17
      address: 5164
      data_type: int16
    - name: Heatpump Evaporation Energy october
      unit_of_measurement: kWh
      slave: 17
      address: 5165
      data_type: int16
    - name: Heatpump Evaporation Energy november
      unit_of_measurement: kWh
      slave: 17
      address: 5166
      data_type: int16
    - name: Heatpump Evaporation Energy december
      unit_of_measurement: kWh
      slave: 17
      address: 5167
      data_type: int16

    - name: Heatpump Electrical Consumption january
      unit_of_measurement: kWh
      slave: 17
      address: 5168
      data_type: int16
    - name: Heatpump Electrical Consumption february
      unit_of_measurement: kWh
      slave: 17
      address: 5169
      data_type: int16
    - name: Heatpump Electrical Consumption march
      unit_of_measurement: kWh
      slave: 17
      address: 5170
      data_type: int16
    - name: Heatpump Electrical Consumption april
      unit_of_measurement: kWh
      slave: 17
      address: 5171
      data_type: int16
    - name: Heatpump Electrical Consumption may
      unit_of_measurement: kWh
      slave: 17
      address: 5172
      data_type: int16
    - name: Heatpump Electrical Consumption june
      unit_of_measurement: kWh
      slave: 17
      address: 5173
      data_type: int16
    - name: Heatpump Electrical Consumption july
      unit_of_measurement: kWh
      slave: 17
      address: 5174
      data_type: int16
    - name: Heatpump Electrical Consumption august
      unit_of_measurement: kWh
      slave: 17
      address: 5175
      data_type: int16
    - name: Heatpump Electrical Consumption september
      unit_of_measurement: kWh
      slave: 17
      address: 5176
      data_type: int16
    - name: Heatpump Electrical Consumption october
      unit_of_measurement: kWh
      slave: 17
      address: 5177
      data_type: int16
    - name: Heatpump Electrical Consumption november
      unit_of_measurement: kWh
      slave: 17
      address: 5178
      data_type: int16
    - name: Heatpump Electrical Consumption december
      unit_of_measurement: kWh
      slave: 17
      address: 5179
      data_type: int16

    - name: Heatpump Number Of Starts L
      slave: 17
      address: 5281
      data_type: int16
    - name: Heatpump Number Of Starts H
      slave: 17
      address: 5282
      data_type: int16

HI gerlof,
I just came accoss your question regarding the easynet-module together with a EcoForest stove. I’m currently trying to setup a connection with Home Assistant and the stove as well. But I would like to save the money for the easynet module and access the stove by RS485. Nevertheless I found this project easynet proxy. Maybe this helps you.

Hi NielsS
I just installed a EcoForest ecoGEO B4 Heatpump a few days ago. While searching for a way to interact with the stove by HomeAssistant or Homematic I came across your configuration example. Could you provide me some hints how you integrated that into your Home Assistant instance? Especially how you did the visualization of the data. I’m quite new to Home Assistant, so I would be very happy getting some hints here.
Thanks Sydney

First you need to attach a RS485 converter that is able to work with HA. (have a look at Configuration> Add-ons,Backup & Supervisor> System. Click the three dots on the Host tile, then Hardware and search for your converter, if USB look at TTYUSBx) you need this in your configuration.yaml as described in an earlier post.

The full modbus configuration for the Ecoforest in an earlier post is what you put into your configuration.yaml file. (change the USB port setting discovered in the above description)

Restart your system and go to Developer Tools and search for the heatpump entities. If they show data you can create a dashboard for HA.

You can then install InlfuxDB with Grafana to visualize for over a longer time.

Thank you very much for the hints. I will test that as soon as my RS485 Adapter is delivered.

Hey NielsS,
many thanks for the great work. Would like to include Ecoforest HP in HA without Eeasynet(not working anymore). Your work brings me close to my goal. But not quite yet.
I’m trying to connect the Protoss PE11 (I still have it here) to the BMS2 port. PE is an RS485 to LAN converter. Do you have an idea if and how that could work? I’m still at the beginning and have already invested a lot of time.

I would be very happy to receive support.
kind regards
Al

can someone help me to bring the adapter Protoss-PE 11 to HM to read out the Ecoforest heat pump on the BMS2 interface.

At first you need to make a connection with rtuovertcp:
More about that at: Modbus - Home Assistant

Example configuration.yaml entry for a TCP connection:

modbus:
  - name: "hub1"
    type: rtuovertcp
    host: IP_ADDRESS
    port: 502

The IP(make this fixed to be sure always connecting the same IP) and port needs to match you IP to RS485 converter. The name is ‘just’ a name you choose.

Log in into your converter to be sure to set the right speed and communications for the EcoForest (assuming all units use the same settings):
baudrate: 19200
stopbits: 2
bytesize: 8
parity: N

The sensors for HA is the same as for a serial connection. So copy paste these into your config. For convenience, use one sensor for faster debugging if there are communication issues and faster startup of HA.

Thanks NielsS

sorry i have limit for this topic, so i eding the post.

the connection works! :ok_hand:

but i got no conection to the sensors
which host ip for modbus:
IP from Converter PE11
or the ip from HA

in BM2 Ecoforest i have this settings
MB Slave
baudrate: 19200
stopbits: 2
bytesize: not there
parity: N
Adresse: 17

the adresse 17 in BM2 ist the “slave 17” in yaml
is thats ok?

Hey Niels, Thank you … it works perferkt now

TCPserver as connection type.
As server port 502 (this is a safe port to choose for HA)
Local port can be anything, so keep that default if there is a port or for convenience choose 501 or 503

Somewhere you need to set the Uart settings to:
baudrate: 19200
stopbits: 2
bytesize: 8
parity: N

Apologies for Digging up this thread, but seems to be the only one relating to the ecoforest heatpumps.

I’m looking into getting one, and I am wondering do you have control of it? or is it just monitoring?

1 Like

Welcome to the community and your first post!

For now it is only monitoring. If you enable control, then all requests for heating and cooling are via Modbus only.
I will address that after this winter (don’t want to have issues with heating)

1 Like

I’ve just got an Ecoforest installed and stumbled upon this thread. As many other I bought a PE11 and connected it to my Ecoforest (there was already something connected to the BM2 with one of those Wago 221’s, so I just added my PE11 to there as well). The + of the PE11 is connected to the + of the Ecoforest and the - to the -.

My PE11 is configured as in below screenshots.

For the HA config I have set it up the following

modbus:
  - name: "Protoss PE11"
    type: tcp
    host: 192.168.178.11
    port: 502
    timeout: 0.5
    sensors:
      - name: Heatpump Buitentemperatuur
        unique_id: ecoforest_buitentemp
        unit_of_measurement: °C
        scale: 0.1
        precision: 1
        slave: 17
        address: 11

But for some reason I can’t get any data out of it. Does anyone have any suggestions?

It looks like you try having 2 master devices on one bus.
Disconnect the other device and try again. If that works, then you know that you had 2 master devices connected.

Thanks for the recommendation NielsS, after reading a bit more about modbus this morning this was exactly what came to my mind. After removing the TH-touch it started to work.

Is there a way to connect the TH-touch to the Ecoforest and have modbus available?