How to Associate Modbus Entity with a Home Assistant Device

I have the modbus integration working over TCP.

The “sensor” defined in the configuration.yaml file does expose a useable “entity”.
The data is properly being queried and its history stored/displayed properly.

However, where would one define the association of this working “entity” with a parent “device” ? Is not that what the yaml property of - name supposed to define?

When looking for “Devices”, I do not see a device name ESP32-1.

configuration.yaml section:

modbus:
  - name: ESP32-1
    type: tcp
    host: 192.168.1.14
    port: 502
    sensors:
      - name: AC-Voltage
        input_type: holding
        unit_of_measurement: Volts
        data_type: uint16
        slave: 1
        address: 0
        unique_id: AC_Voltage_ESP32-1
        scale: .01
        offset: 0

Also related:

The “Developer Tools/YAML configuration reloading” sub-feature does NOT appear to work for any changes I make to the “modbus:” section of the configuration.yaml file.

I have to do a “full” RESTART of the Home Assistant platform for any modbus-section changes to be recognized.

Thanks for the help.

1 Like

Here is a snippit my modbus. I put it in a seperate file modbus.yaml and yes I have to restart HA to see changes.

# Example configuration.yaml entry for multiple TCP connections
  - name: hub1
    type: tcp
    host: 192.168.1.11
    port: 502
    sensors:
      - name: Modbus_Voltage_A
        slave: 1
        address: 0
        input_type: holding
        unit_of_measurement: V
        device_class: voltage
        state_class: measurement
        count: 1
        scale: 0.01
        offset: 0
        precision: 1
        data_type: uint16
        scan_interval: 6

The name hub1 is arbitrary as is the name Modbus_Voltage_A name. But yes hub1 does not appear in tthe list. See screen dump of this variable.

image

Thanks for the reply, but I’m not sure how this relates to the creation of a parent “device” which would contain all of the working “entities” (as a “container”).

Are you just confirming that my observation of the:

modbus:
  - name: ESP32-1

also DOES NOT work for you?

I would have imagined that EPS32-1 should have been a new "device" name...

Everything works perfectly for me for 2 different modbus meters. But your ESP32-1 and my hub1 do not exist. So my take is you are looking for something that does not exist. I just used consistent sensor names. eg Modbus_*

Did you manage to create a parent device? I’m having the same problem.

Unfortunaltely NO.

It would logically seem that the added ESP32-1 Modbus “device” should be visible and all of its “sensors/entities” should be associated with the device as are most integrations.

  • Seems odd no?

Yes - I am looking for the same. I will reply if I find a solution.

1 Like

Hi Devs,
thanks for your incredible work!

I integrated an Eastron SDM630 three-phase power meeter via modbus.
I would love to to see the 86 sensors/entities to be grouped into one device.
It would be awesome whene opening “related” to see the grouping device and the “related” entities.

First and default grouping could be the “name” from modubus device.
If you have connected several devices via modbus, an optional “device” in sensor config could be a solution.

Br, Bjoern

I really support the idea to align Modbus entities to a HA devices.

please vore for device support - grouping all sensors for one modbus entity - at:
Modbus sensors - Unique ID and Device support - Feature Requests - Home Assistant Community (home-assistant.io)