Modbus sensors - Unique ID and Device support

Unique_id is now supported

But how to assign it. I just finished a ModBus configuration.yaml for a Eastron kWh meter. I can see the registers in de Developer Area but I cannot put in one of those entries (like kWh consumed) in th energy dashboard as it has no Unique-ID. How can a MOdbus integration with 20 attributes be given a Unique ID?

1 Like

Not sure what you mean by an integration having 20 attributes, but you can have a look at how I have incorporated unique_id for a bunch of modbus sensors here: home-assistant-config/ctc.yaml at 6a98585cb6094465db7ce61e688f5924f0f17cf3 · knudsvik/home-assistant-config · GitHub

I would appriciate device support and link according thread talking baout the need to group all the sensors of one device.

How to Associate Modbus Entity with a Home Assistant Device - Configuration - Home Assistant Community (home-assistant.io)

1 Like

I am developing a YAML-based modbus integration for Sungrow Inverters.

As each inverter comes with around 100 registers / sensors values, it would be great to “link” them to a device and also assign them a location/ room.

Several users have 2 (or even more) Sungrow inverters, which complicates device / sensor handling even more.

Please support the “modbus device support” :slight_smile:

1 Like

I’m using @mkai’s stunning modbus integration and it gets really messy in HA without a device that groups all entities from modbus. Would be great if that would be supported in the near future!

I am trying to add a Dimplex heatpump with cooling option by the Modbus integration. I am able to add the registers and may be with the HVAC option it will be possible to switch the different modes of it in a Home Assistant natural way.
The missing ids and the missing option to group sensors etc to a device make it quite difficult to get it going as it should be.

I know, HA is mostly developed and maintained by volunteers, so many thanks for your great work so far. I have no clue how to make the needed changes myself, otherwise I would start now.

I’d like to add my vote for the modbus integration to support concept of marking up entries such that there is the concept of a parent device, with it’s own unique_id and name, which then that device’s sensors each inherit as a prefix to allow them to be created in HA as unique identities that are tied to the parent device.

So like:

modbus:

  • name: [parent_name]
    type: [type]
    host: [ip_address]
    port: [port]
    unique_id: [parent_unique_id]
    sensors:
    • name: [sensor_1]
      address: [address]
    • name: [sensor_2]
      address: [address]

And have that passed up to HA such that there is a [parent_name] device created with the [parent_unique_id] as unique_id

Tied to that would be each of the sensors with names like:
[parent_name].[sensor_name1]
[parent_name].[sensor_name2]

Each sensor could also have autogenerated unique ids that are a concatenation of [parent_unique_id].[sensor_name1]
[parent_unique_id].[sensor_name2]

Not sure exactly how it should be laid out but that’s the ‘vibe’ of the thing.

Bonus would be to have syntax to pass to HA the concept of sensor types if that doesn’t already exist, so that sensor type could configured by a template in HA.

2 Likes

I agree with my predecessors and would also be very happy to see an improvement in the structuring. I would add to xanderphillips’ concept. Or attach a question.

name: [parent_name]

type: [type]

host: [ip_address]

port: [port]

unique_id: [parent_unique_id]

This section describes the connection hub, right? In my case it is a Modbus RTU RS485 to USB stick that connects to 4 electricity meters. All 4 counters again have dozens of entities. That’s why I prefer this structure:

Connection hub (TCP or RTU ...)

    Device (e.g. meter_1) > with name and unique_id: [parent_unique_id]

        Entity (e.g. Power A) > with name and unique_id: […]

        Entity (e.g. Voltage A) > with name and unique_id: […]

        Entity (e.g. Frequency A) > with name and unique_id: […]

    Device (e.g. meter_2) > with unique_id: [parent_unique_id]

        Entity (e.g. Power A) > with name and unique_id: […]

        Entity (e.g. Voltage A) > with name and unique_id: […]

        Entity (e.g. Frequency A) > with name and unique_id: […]

Connection hub (TCP or RTU ...)

    ...

I would be very happy about a realization.

+1

Will this ever be implemented?

modbus:
  - name: modbus_hub

I really don’t understand what this “name” (from the docs) is used / intended for.

1 Like

I’m just adding my vote here too. Did anyone find a workaround for this? I’ve added two different heatpumps over modbus and the data is all over the place. Any tricks on how to solve this maybe on the dashboard level?

Can we get some movement here? That would be awesome, currently a huge pain to have like 40 sensors…

1 Like

I’m also looking for a way to group my modbus sensors into devices and stumbled over this thread. I could not believe that this would not work as the grouping within yaml takes place with the name section.

Please make this work in a next release as it seems that many people are in need of this.

And not to forget: many thanks for that wonderful piece of software!

I have the same problem, an energy meter that supplies many different sensors/entities via modbus (serial / rtu). I would like to combine these entities in one device. Many thanks in advance!

It would be really great to have a device of modbus config and gui configuration as well.

Chiming in here as well - I have an air handling unit connected via modbus and would also love the option to create a logical device for it in HomeAssistant. Would also be very useful when connecting multiple devices over Modbus

Created an account just to cast my vote for device grouping. I was surprised it was not yet an option as it exists for MQTT.

I also need a device “name” for my modbus entities

Would be great if that would be supported in the near future!

Hi everyone,
I just switched to Modbus for one of my integrations and ran across the same issue.
I’ve opened an issue for this, as I’ve not seen one being created so far:

Hope this get’s some drive on fixing this. In MQTT this is also possible with the addition of some lines per sensor, but in Modbus this should be far easier, based on the “main” device being created for the connection info’s.

1 Like