Entity is no longer being provided by the esphome integration after upgrade

Dear all!

I updated HA2023.11.3 to HA2024.1.0
AND did an update of an “espHome”-device at the same time two days ago. I’m not pretty sure, whether I used exactly the identical yaml for that device that worked before for half a year. After starting the updated HA with the updated device, at least two entities vanished. I will show for example one of them…

  • This entity is no longer being provided by the esphome integration. If the entity is no longer in use, delete it in settings.
    

Data is now collected with a new entity called with additional “_2”. The old one is still available but is not supplied with sensor data…

This is out of the (new/actual) esphome-sensor.yaml file:

substitutions:
  name: "esphome-pv-deye12k"
  device_description: "ESPHome component for Deye SUN-12K"
  modbus_controller_id: sun12k

esphome:
  name: ${name}
  friendly_name: "ESPHome PV Deye12K"

sensor:
- name: "sun12k-Out-of-grid–total power"
    platform: modbus_controller  
    modbus_controller_id: ${modbus_controller_id}
    id: sun12k_out_of_grid_total_power
    register_type: holding
    address: 619
    unit_of_measurement: "W"
    state_class: "measurement"
    accuracy_decimals: 0
    value_type: S_WORD

In core.entity_registry afterwards I could find this:

   7241       {
   7242         "aliases": [],
   7243         "area_id": null,
   7244         "capabilities": {
   7245           "state_class": "measurement"
   7246         },
   7247         "config_entry_id": "4eaa1d6f23a379f7796f2c3ba52a723a",
   7248         "device_class": null,
   7249         "device_id": "1c6e51c755f1ac6fc3af2de4d9dde069",
   7250         "disabled_by": null,
   7251         "entity_category": null,
   7252         "entity_id": "sensor.esphome_pv_deye12k_sun12k_out_of_grid_total_power",
   7253         "hidden_by": null,
   7254         "icon": null,
   7255         "id": "186c47f1dc8cdc647e5e66f1a298bd92",
   7256         "has_entity_name": true,
   7257         "name": null,
   7258         "options": {
   7259           "conversation": {
   7260             "should_expose": false
   7261           }
   7262         },
   7263         "original_device_class": null,
   7264         "original_icon": null,
   7265         "original_name": "sun12k-Out-of-grid–total power",
   7266         "platform": "esphome",
   7267         "supported_features": 0,
   7268         "translation_key": null,
   7269         "unique_id": "8C:CE:4E:82:57:B0-sensor-sun12k-out-of-gridtotal_power",
   7270         "previous_unique_id": "esphome-pv-deye12ksensorsun12k-out-of-gridtotal_power",
   7271         "unit_of_measurement": "W"
   7272       },
  14787       {
  14788         "aliases": [],
  14789         "area_id": null,
  14790         "capabilities": {
  14791           "state_class": "measurement"
  14792         },
  14793         "config_entry_id": "4eaa1d6f23a379f7796f2c3ba52a723a",
  14794         "device_class": null,
  14795         "device_id": "1c6e51c755f1ac6fc3af2de4d9dde069",
  14796         "disabled_by": null,
  14797         "entity_category": null,
  14798         "entity_id": "sensor.esphome_pv_deye12k_sun12k_out_of_grid_total_power_2",
  14799         "hidden_by": null,
  14800         "icon": null,
  14801         "id": "ed1821c056cfe0585a7d6a65f5550b18",
  14802         "has_entity_name": true,
  14803         "name": null,
  14804         "options": {
  14805           "conversation": {
  14806             "should_expose": false
  14807           },
  14808           "sensor": {
  14809             "display_precision": null
  14810           }
  14811         },
  14812         "original_device_class": null,
  14813         "original_icon": null,
  14814         "original_name": "sun12k-Out-of-grid–total power",
  14815         "platform": "esphome",
  14816         "supported_features": 0,
  14817         "translation_key": null,
  14818         "unique_id": "8C:CE:4E:82:57:B0-sensor-sun12k-out-of-grid_total_power",
  14819         "previous_unique_id": null,
  14820         "unit_of_measurement": "W"
  14821       },

Whereas it was before modifications (looked into backup):

   7391       {
   7392         "aliases": [],
   7393         "area_id": null,
   7394         "capabilities": {
   7395           "state_class": "measurement"
   7396         },
   7397         "config_entry_id": "4eaa1d6f23a379f7796f2c3ba52a723a",
   7398         "device_class": null,
   7399         "device_id": "1c6e51c755f1ac6fc3af2de4d9dde069",
   7400         "disabled_by": null,
   7401         "entity_category": null,
   7402         "entity_id": "sensor.esphome_pv_deye12k_sun12k_out_of_grid_total_power",
   7403         "hidden_by": null,
   7404         "icon": null,
   7405         "id": "186c47f1dc8cdc647e5e66f1a298bd92",
   7406         "has_entity_name": true,
   7407         "name": null,
   7408         "options": {
   7409           "conversation": {
   7410             "should_expose": false
   7411           }
   7412         },
   7413         "original_device_class": null,
   7414         "original_icon": null,
   7415         "original_name": "sun12k-Out-of-grid–total power",
   7416         "platform": "esphome",
   7417         "supported_features": 0,
   7418         "translation_key": null,
   7419         "unique_id": "8C:CE:4E:82:57:B0-sensor-sun12k-out-of-gridtotal_power",
   7420         "previous_unique_id": "esphome-pv-deye12ksensorsun12k-out-of-gridtotal_power",
   7421         "unit_of_measurement": "W"
   7422       },

Maybe it is related to have used a special character between “grid–total” (it isn’t a regular “minus”) ?!

How can I get the old entity back (sensor data gets collected for that entity)?
And additionaly: Would it be possible to insert all that wrongly mapped values with SQL into the dedicated-table as select from table-with-values_2

I would really appreciate any hint.

Best Regards, Gregor

check this: https://community.home-assistant.io/t/esphome-devices-all-renamed-with-2-added/388146

removing and adding the device from the integration, brings back normal behavior, also the former data remains. But everything logged into “_2” entities seems to vanish.
Are these lost datasets recoverable from database? And migrate-able into the entity without “_2”? In which table(s) are the values of entities logged?