How can I understand entity_category?

This is the doc:

But I still can’t understand what entity_category does. Could you explain it a little bit further?

The category determines if the entity is a diagnostic or config type, which determines how it is grouped in the device page.

2 Likes

If I change the category of an entity from config to diagnostic, will it only move the entity from the configuration group to diagnostic group without affecting anything else?

Yes.

Diagnostic and configuration entities aren’t added to auto generated dashboards either.

You should make sure your entity matches the category descriptions though. In simple terms: diagnostic category = read only system output from the device, configuration category = takes some form of user input to configure or control the device.

1 Like

Be aware that the type of the entity / entity_category is checked when adding the entity to home assistant. It is not only a UI-feature in which section an entity is shown.

I had an ESPHome device with a binary_sensor (template) defined as

entity_category: config

The binary_sensor was added to Home Assistant, even in the category “config”, but was marked with an error. Reading the error log an the code did show, that binary_sensors are not allowed with type config (but in ESPHome they are allowed). I had to change it to “diagnostic” to work properly.

That makes sense. ESPHome is wrong.

Config entities are changed by the user.
Binary sensors are not (input_booleans are).