Platform esphome does not generate unique IDs

I have an air gradient air quality sensor which has a name and friendly_name of ag1. It contains a pms5003 particulate matter sensor which provides pm1.0, pm2.5 and pm10 values. There seems to be some kind of clash between the ID’s that are chosen for the pm1.0 and pm10 entities. I guess the names for the pm1.0 and pm10 entities are somehow getting munged such that they are identical? Is this an ha problem or an esphome problem? How can I resolve this so I can view all of the values produced by this sensor?

Log message:

ERROR (MainThread) [homeassistant.components.sensor] Platform esphome does not generate unique IDs. ID ag1sensorpm_10m is already used by sensor.pm_1_0um - ignoring sensor.ag1_pm_10m

Relevant sections of ag1’s config:

esphome:
  name: ag1
  friendly_name: ag1

sensor:
  - platform: pmsx003
    type: PMSX003
    uart_id: uartuno
    pm_1_0:
      id: pm11
      name: "pm 1.0µm"
    pm_2_5:
      id: pm251
      name: "pm 2.5µm"
    pm_10_0:
      id: pm101
      name: "pm 10µm"
    update_interval: 120s

There are fixes for ESPHome unique ids in 2023.11.0 which will be available the first Wednesday of November.

I’m not sure if the planned fixes made it in. I’m running 2023.11.1 but still seeing the error message about unique IDs. The sensor naming clash seems to persist as well.

You’ll still need to delete the entry and add it back again.

If that doesn’t solve it, please continue at Sign in to GitHub · GitHub

Unfortunately deleting and re-adding the device and entities didn’t do the trick. I opened #5135 for this issue.

Thanks for opening the issue. At first glance, that looks like problem with the the id generation so the issue is in the right place. Its going to need to some more investigating to know for sure.