Badly missing Device ID in sensor names for iOS companion app

I like the new iOS app. However, I really miss having sensors prepended (or appended) with a device ID. It is really hard to find out which sensor is bound to what device. We have 3 phones and 3 iPads in our household.

Can I add a prefix in the integration UI?

Would it be possible to add a prefix manually in .storage?

Will it be a future feature to add device IDs?

You can rename any entity from the frontend entity registry. I prepended all of my sensors with device name.

1 Like

No need to edit .storage you can edit the entity ids in configuration / entities or configuration / integrations.

1 Like

I was just looking for the same thing and found this. It would be really helpful to group the sensors by device and make it easy to figure out what device they belong to. Is there an issue open for this?

How do I figure out which sensors belong to which device? It doesn’t look like there is a consistent set of devices between iPhones and iPads.

EDIT: Currently I’ve only got two devices running the companion about, but I have at least 3 sets of battery sensors. There is one set that included the device name, but it doesn’t look like it has been updated in a long time.

If you go to HA Settings > Integrations > Mobile App: xyz you have all registered devices to the mobile app integration.

If you go down those again and select the device with the battery (ignore the second device) you get a list of all sensors and entities connected to that device. If you then click the settings cog next to those entities you can rename them and add your prefix.

It’s a bit annoying but you only have to do it once.

Thanks @olbjan - That will help with some of the renaming, but I seem to have more clean up to do.

Migrating to Home Assistant Companion 2019.1 covers some of the details about what’s changed.

Regarding the entity naming and the original question:

The 2019 release note talked about the entity name changes to remove the device ID:

The battery level and state sensors will be change from sensor.<device_id>_battery_level and sensor.<device_id>_battery_state to sensor.battery_level and sensor.battery_state . When you set up additional devices, the new sensors for those device will be distinguished with an identifier on the end (i.e. sensor.battery_level_2 ).

I don’t really see why this change was made - from my limited perspective it seems to be a step backward. It also seems to be inconsistent with the other entities. This gets even more confusing with entities like sensor.sim when the devices have more than 1 sim, so you get sensor.sim_1, sensor.sim_1_2, sensor.sim_2, sensor.sim_2_2. I’ve only added my devices so far, it will get worse when I add my wife’s iPhone, iPad.

It would be useful if there was something in the sensor attributes that could be used to link them back to the device either by name or what ever is considered the “main entity” for the device.

Regarding clean up from the device name changes:

  • Using the integration view lets you see the current entity names, but doesn’t help for cleaning up no longer used entity names.
  • Probably as a result of the changes for the 2019.1 release, I’ve wound up with two sets of entities for my iPad.
1 Like

Well no point in beating on that horse. I begged for weeks during beta to fix this in the mobile_app integration and I suppose that will happen eventually but it wasn’t done and I don’t know enough python to fix it myself.

FWIW, I’m struggling a bit with the cleanup.

  • I can’t rename the new sensor.battery_level_N to what I want. The old sensor name still seems to exist, even though I thought I get rid of it. When I try to rename I get save failed: Entity is already registered
  • I’ve gotten rid of .ios.conf and restarted, but I can’t get rid of the old entry for my iPad. There is an entry for it in .storage/core.device_registry. I don’t how to safely delete that. There doesn’t seem to be a way to do it from the GUI.
    • The migration instructions say to remove it from known_devices.yaml but my system doesn’t have that file.

Check Integrations and delete the ios entry. That should get rid of the entry in .storage

I tend to agree with @rct regarding the sensor names

I have 5 iPhones and 3 iPads in my home. Which one is which?

Yes, I understand renaming is currently the “workaround” but would just be better to have left the “device_id” in the sensor name