Basic Question: What is a device_id?

I must have missed something but what is a device_id and how is it different in function from an entity_id?

Is it something just to do with the UI - I only use YAML?

The Templating docs have this

  • device_id(entity_id) returns the device ID for a given entity ID or device name. Can also be used as a filter.

So I am assuming there is some use to us (rather than the system) in knowing what it is?

Again, sorry for such a fundamental question…

A device is something that is created through integrations that use config flow. And if the device supports more then one function, it can have several entities attached to it.

Thanks for explaining that.

But what is the value in knowing the device_id?

device_id was created for the automation editor. If you don’t use the automation editor, it has no use.

How do you do that ?

because that’s how the framework works I thought you said, how do you know that.

You can’t do that unless you wrote the integration to do that.

1 Like

If you know the device_id, you can use it to find device_attributes, like what area it’s in, what integration it comes from, if it needs a firmware update. All done through templates. Otherwise it’s a identifier for the device so home assistant knows how to get it’s own stored information about said device.

1 Like

Actually, I was wrong.
Technically, you just define an additional property on the entity, but the doc says it’s only effectively used for config_flow enabled integrations.