1. Introduction
What is the best way to name Home Assistant devices and entities as the default name provided by Home Assistant is most often not a handy/easy recognisable name for a device or entity. This complicates setting up dashboard cards, creating automations or filtering entities on the entity overview screen. Hence we apply a naming convention for Home Assistant devices and entities which makes this easier.
This article describes how we name our Home Assistant devices and entities with the goal to have a structured approach and make it possible to filter / search devices on the different screens in Home Assistant. This will aid in maintenance and developing dashboards and automations.
Other sources of info w.r.t. naming convention:
- Home Assistant developers blog “Adopting a new way to name entities“
- Home Assistant community “Device Naming Scheme – Recommendations?“
- Home Assistant community “Device/Entity Naming Standards / Best Practices“
It is work in progress and might change in future.
2. Name Home Assistant devices and entities
We have a different naming convention for Home Assistant devices versus entities.
2.1 Device
The device name itself will be a friendly name with between brackets the brand, type and if relevant the unique number:
friendly name (brand+type [unique no])
Example: “Lijmpistool (Plugwise Circle 79264)”
Reason to include the brand+type is that on the device overview screen (Settings > Devices) the model name is not always that clear. For example we have a model name “lumi.remote.b1acn01”, which is a Aqara Wireless Mini Switch…
The location is not included as it will lead to long friendly device names. leading to cut off of the names in several screens. Instead we use the device area for this. The location will be part of the entity names (see below).
2.2 Entity
The entity has a friendly name and an entity ID name:
2.2.1 Entity name
This is a friendly name displayed by default on dashboards (can be changed per dashboard card later if you wish). We provide a friendly name combined with info about the type/funcion of the entity
friendly name – type
Examples: “Lijmpistool – switch”, “Lijmpistool – power usage”
It is wise to have the friendly name unique to prevent issues with future voice commands. So if there is a computer in the living room and in a other room include for example the room in the friendly name.
2.2.2 Entity ID
The entity ID naming scheme is:
domain.location_brand+type_device name_[unique no]_sensor name
Domain is provided by Home Assistant, can be for example switch, sensor, etc. and cannot be changed in the maintenance dialog of an entity.
Example:
sensor.zolderkamerwerkbank_plugwisecircle_79264_lijmpistool_power_usage
Be aware that for the entity ID only lowercase characters are allowed and no spaces.
3. Example; Plugwise switches
A Plugwise Circle is a remote power switch including energy measurement. When added to Home Assistant it gets a default name like “Circle type F (000D6F0002603652)”. I.e. the Plugwise device type combined with it’s unique number. Not easy to remember where it has been used for…
It’s entities are named:
- switch.relay_state_03652
- sensor.energy_consumption_today_03652
- sensor.power_usage_03652
Having some 30+ of these plugwise devices and a lot of other devices makes it a nightmare to find the correct one when creating dashboard cards, creating automations, filtering the entity overview screen, etc.
We want to find them based on their purpose, area of use, brand/type of device and their unique number. So we end up for this example with the following:
- Device
12Name: Lijmpistool(Plugwise 79264)Area: Zolderkamer - Werkbank - Switch
12Friendly name: Lijmpistool - switchEntity ID : switch.zolderkamerwerkbank_plugwise_79264_lijmpistool - Sensor energy consumption today
12Friendly name : Lijmpistool - energy consumption todayDevice ID : sensor.zolderkamerwerkbank_plugwise_79264_lijmpistool_energy_consumption_today - Sensor power usage
12Friendly name: Lijmpistool - power usageDevice ID : sensor.zolderkamerwerkbank_plugwise_79264_lijmpistool_power_usage
All the names can be set via the device properties screen:
0 Comments