Customize all devices of same manufacturer/model

I am thinking about adding extra fields for groups of devices of the same type. For example, I would like to add a battery_type to TPLink/P100 plugs and this can hold the text “1xCR2450”. I will want to do similar changes for other battery driven devices.

If this is feasible, I could see that other device type added data could be useful in the future.

I realise that I could customize each device one-by-one in yaml. However, as HA is basically run by a relational database of devices, it seems logical that there should be a means of programatically adding this info as a group update to all matching manufacture/models.

Has anyone done something like this?

Search for: “customize glob”.

What “relational database of devices” are you talking about?

The basic database that sits under HA is a sqllite database, as far as I understand? Or have I got that wrong?

I have only seen customize_glob examples using the device names and wildcards

I was hoping not to have to rename all my devices but use the device info instead.

If I can do that, it would be good to see examples.

There is no information in that database about devices, integrations or any config at all. The only information in that database is history of the state of your entities and the events that have been fired. If you stopped HA, deleted the entire thing and then started HA again absolutely nothing would break. The only thing that would happen is your history graphs and your logbook would start fresh.

Fair enough. I misunderstood the database data. Still would like to cusomize at the device type level