Skip to content

Improve HA device registry and support multiple devices in one config #1335

Closed
@iMicknl

Description

@iMicknl

Describe the problem you have/What new integration you would like

I recently got started with ESPHome and I like it very much! Most of my cases for ESPHome are in situations where I try to build a 'digital twin' for multiple physical devices. Think of a physical standing desk or Xiaomi MiFlora devices.

However, currently when you configure this, it will add all entities to a single espressif device in Home Assistant. It would be great if you could use the ESPHome YAML to create devices and decide which sensors are linked to which devices.

Use cases:

  • ESP32 with Xaomi MiFlora devices
  • ESP32 with multiple Switchbot Curtains
  • ESP32 with multiple Oral B toothbrushes
    (or even a combination of the ones above)

Eventually, this would allow us to show the model, manufacturer and firmware of the device we mimic, instead of our ESPHome device. I was looking to port https://github.com/devWaves/SwitchBot-MQTT-BLE-ESP32, however the features regarding device registry and information are not possible (yet) with ESPHome. And for bluetooth devices, you could perhaps even add the mac address to the connection info.

Screenshots
Current situation
image

Proposed situation:
image

(and with multiple devices, there would be multiple entries)

Please describe your use case for this integration and alternatives you've tried:

Prefixing all entities with the digital twin device name, however this will be messy at some point and doesn't show up nice in the Home Assistant device registry.

Additional context

This would mainly be a cosmetic change, so I can understand that this is not something which has any priority over the other issues. However, perhaps there is someone that would like to tackle this, or work with me to see how we can add this.
(unfortunately my C++ is really limited, however I can do Python :-)).

Example YAML

# If not added to a device, it will be added to the main device
sensor:
  - platform: wifi_signal
    name: "WiFi Signal"
    update_interval: 60s

# If added to a device, it will create a new device in the Device Registry
device:
  desk:
    name: Desk Mick
    model: EK5
    manufacturer: Flexispot

  - platform: uart
    name: "Preset 1"
    id: switch_preset1
    icon: mdi:numeric-1-box
    data: [0x9b, 0x06, 0x02, 0x04, 0x00, 0xac, 0xa3, 0x9d]
    uart_id: desk_uart

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions