Config sensors in ESPHome yaml to show them grouped in Home Assistant

Hello,

I’m having a cosmetic problem and am wondering if there is an solution for this except for the obvious one.
I have a ESP32 that will read a lot of data from a Modbus device. Usually those sensor data is put together into one “group” (panel?), when showing it in Home Assisstant. Because this are so many sensors, this it very confusing. I could of course change and sort this in Home Assistant when adding those values to the dashboard. But it would be nicer to group this in the actual ESPHome config.

I know from another ESPHome device, that there can be different groups (Sensors, Config, Diagnose etc.), but I do not know how those are defined.
Maybe I just do not know the correct term to search for, so any help is appreciated :slight_smile:

What it looks like:

What I would like to achieve:

Thanks,
Chris

You just need to define an entity_category for each entity:

https://esphome.io/components/sensor/
image

e.g.

sensor:
  - platform: adc
    pin: GPIOXX
    name: "System Battery"
    update_interval: 60s
    entity_category: DIAGNOSTIC

Thank you, that worked. But to get it working I had to remove the device from ESPHome and add it again.

One additional question about those categories: Can I define those as I wish or are you limited to the predefined DIAGNOSTIC and CONFIG?

You can not define your own categories.