Entity name question

Here’s my sequence:
Start with a working yaml file for device A.
Create a new device in ESPHome. Call this device B.
Copy the contents of device A yaml file into device B.
Changed all name references from device A to device B names.
Compile and download the yaml file for flashing to device B.
Add device B to the ESPHome configuration in HA.

Device B works fine and as expected. However some of the entities still have the name from device A.

Further, in Developer Tools → states, most of the entities are “unknown”.

Any ideas??

=====UPDATE=====
I deleted both integrations, restart HA, then added both integrations. Now the entity names make sense and the states are correct.

Is this the correct fix?

Well. Almost.

esphome:
  name: solar
  platform: ESP8266
  board: d1_mini
...
sensor:
  - platform: adc
    pin: A0
    update_interval: 2s
    name: "Battery"
    unit_of_measurement: 'V'
    filters:
    - multiply: 10.0

Becomes the entity: sensor.analog_sensor

Shouldn’t it be sensor.solar.battery?