Naming Convention Suggestion

Hello!

First of all, apologies in advanced for being a newb. I just started my journey with Home Assistant. Been doing a lot of reading of what to expect and what the best practices are. I’m on the early stages and I’ve only added a handful of z-wave/zigbee devices just to get a feel of HA. I’m migrating from Smartthings little by little.

One of the suggestions is to rename the “Entity IDs” to easily identify them when you plan to do scripts/automations/etc.

This is where I got a little confused of what “Entity ID” actually needs to be renamed.

I went to Settings > Device & Services > Entities (tab) – and it displayed all my entities with names, integrations, Area, and Status.

I noticed that each device have a bunch of entities and I assume/read that each entity corresponds to a function of the device itself (If I’m not mistaken, this is called an attribute).

For example (screenshot below), I have added 3 motion sensors in my Attic. The Device names are (friendly):

Attic - Motion Sensor - Entrance

Attic - Motion Sensor - Back

Attic - Motion Sensor - Side

I could foresee only using maybe 3-4 options (if available) – Motion detection itself, battery levels, temp, and firmware (maybe).

However, there are a bunch of other Entities that I’m not sure what they do. For example – node ping, status etc. I’m not even sure if I’m going to use them or if they are important for future automation.

As best practice, do I have to rename ALL of them?

Some of the examples I’m planning to rename them with are:

Actual Device Name: Attic - Motion Sensor - Entrance

Name under Entities Tab (one of many): Attic - Motion Sensor - Entrance Node status

Entity ID →

FROM: sensor.node_3_node_status

TO: sensor.attic_motion_sensor_entrance_node_3_status

Do I actually rename the “Name” from the Entities tab and the Entity ID too?

Again, apologies as this maybe a basic question but I was not able to find any tutorials that specifically mention “where” to rename it. Most video tutorials and posts just suggests to rename it but not exactly where or what not to rename.

If you can also advice what’s the best naming convention, that would be great too!

TIA!

Attributes are different things but it’s not Germaine to this conversation.

Best practice is thrown around a lot. There really isn’t one so much as what works best in some situations… Personally I point at a device and ask my spouse what it’s called. Then that device (device level) is then named [Room name] [device name]. All a devices entities then result as (domain).(roomname)_(devicename)_foo-specific-to-entity-type

Easiest alway to rename ive found - Look at the device in device view then rename the Device at that level. The UI will offer to rename all the entities associated with that device using the new name. Then clean up any one-offs that remain. (that way you don’t have to manually hunt them down)

Some of those entities may be useful (like the Ping entity on a ZWave node.) but for most entities if you’re not going to use it feel free to disable it. You can always turn something back on if you need to.

2 Likes

Thanks for the info.

It’s strange for me though because sometimes the mass rename HA offers doesn’t rename the Entities even though I clicked rename. I’ve seen it work with sometimes but from my screenshot, you will notice that all my motion sensors didn’t pickup the mass rename change.

That actually gave me the urge to rename all of them since I won’t be able to know which is which.

1 Like

FWIW … any device that can be moved I prefer to give a generic brand-based name that points me to where it is initially set up, and then (re)name each entity to match the intended use. So if I get a white light from Arlec for the kitchen I might call it “Arlec 13” and change the entity to “light.kitchen”.

Yes, this seems tedious, but less so when I decide to buy a color light and want it in the kitchen in place of the existing one. This has a cascade effect around the house, where the white light might also upgrade one in another room for whatever reason, etc. That new one might be “AnotherBrand 7”, and so I’d rename the old entity based on where it’s moving (eg “light.bathroom”) and rename the new one to “light.kitchen” so all the automations work.

Initially I did this brand-style naming to help me make the link between the device in HA and the corresponding phone app’s device. With the “related” tab in HA, this is not required so much, but it does still help highlight when I’m having problems with multiple devices that all suspiciously come from one brand (or integration). I also put a dymo label on each device which helps when, for example, you have multiple light globes in a light fitting.

And adding to what Nathan said, there’s devices, entities and attributes. Each physical device has one device and one or more entities (eg. a Hue motion sensor device will have separate entities for motion, temperature, light-level, battery, and delay). And each entity can also optionally have attributes (eg. Hue’s light-level entity has attributes for Dark and Daylight). Device-entity data can be seen in the Integrations page, whereas entity-attribute data can be seen in Dev Tools.

I know this is an old post, but your advice is priceless! :+1:

3 Likes