Connect heat pump (Qsilence) via MODBUS to gather data - [no data]

Would like to connect my HA system via MODBUS to our QSilence heat pump.
Objective:

  1. Gather data and create graphs to tune performance.
  2. To optimize energy consumption by aligning solar panel production with heat pump

Heat pump has a Carel industries interface and I have access to the console by adding the IP-address in my browser. I get a graphical representation of the console and have access (read) to various parameters.

I have a dedicated RPI5 running

  • Core 2024.2.1
  • Supervisor 2024.02.0
  • Operating System 12.0
  • Frontend 20240207.1

I used the HA modbus description ( Modbus - Home Assistant) to build the integration.

First step is to get the data:
Although I see some connection errors (time-out) in the log, apparently there is communication. I did not find a way to get communication ‘success’ confirmation.
Unfortunately, I cannot find the integration, nor the sensor data to build graphics. I expected to find qsilence as a Device and the sensor variables as Entity. (they might be 0 if I approach the wrong address.)

When I reload the all yaml configurations, I get a green confirmation. Log file has message

2024-02-28 16:52:45.212 WARNING (MainThread) [homeassistant.components.modbus.modbus] modbus qsilence communication closed

Probably due to the fact that modbus communication is closed before opened again.

To simplify the solution, I added the code in the Configuration file:

# File to read Heatpump 1, central heating
modbus:
  - name: qsilence
    type: tcp
    host: 192.168.xx.yy
    port: 502
#    delay: 0
#    message_wait_milliseconds: 1000
#    timeout: 5
    sensors:
      - name: Verwarming_aanvoer
        address: 0x0006
        data_type: float32
        unit_of_measurement: °C
        scan_interval: 30
        precision: 1
      - name: Verwarming_retour
        address: 0x0008
        data_type: float32
        unit_of_measurement: °C
        scan_interval: 30
        precision: 1
      - name: Bron_in
        address: 0x000A
        data_type: float32
        unit_of_measurement: °C
        scan_interval: 30
        precision: 1
      - name: Bron_uit
        address: 0x000C
        data_type: float32
        unit_of_measurement: °C
        scan_interval: 30
        precision: 1
#

My initial questions

  • can I indeed assume the communication is working?
  • where can I find the data or what is wrong in my code?

Test with QModMaster.

You may need to enable Modbus TCP

Made quite some progress.

  1. there is no confirmation for a successful modbus connection. The only sign is a warning “… connection closed” after reloading ‘all YAML configuration’. So do a reload to test your initiation
  2. The right indention solved the issue. See code below
  3. If you change the modbus initiation, for example the name, you have to restart HA. A reload is not activating the new parameters
  4. you can find the sensor data under Settings > Devices & Services > Entities as sensor in column integration. They don’t appear under Device (tab)
    Question: how to add device name and make them appear grouped under Devices tab.
    Next step is to discover sensor data addresses. Suggestions are welcome

My configuration code to initiate the connection

# File to read Heatpump 1, central heating
modbus:
 - name: Qube WP1_CV
   type: tcp
   host: 192.168.xx.yy
   port: 502
   delay: 0
   message_wait_milliseconds: 1000
   timeout: 5
   sensors: !include wp1_modbus.yaml

File wp1_modbus.yaml to create sensor data (only 2 items)

#  sensors:
 - name: WP1 Verwarming aanvoer
   address: 0x0006
   data_type: float32
   unit_of_measurement: °C
   scan_interval: 30
   precision: 1
 - name: WP1 Verwarming retour
   address: 0x0008
   data_type: float32
   unit_of_measurement: °C
   scan_interval: 30
   precision: 1