Assigning Category to YAML Created Sensor

Hi,

Does anyone know how to add categories to binary sensors defined in YAML? When I try to do it from the GUI, I get the following message:

You can’t assign a category to this automation

To assign a category to an automation it needs to have a unique ID.

Simple: add a unique_id to the yaml created sensor. Note that there are two ways to create a binary sensor in yaml though. The old way does not provide the possibility, the new format does. So you may need to convert it to the new format.

Sorry, are categories provided for sensors? For automations -yes, for sensors - do not remember (cannot check it now).
(honestly, see no need to use categories at all since labels are supported)