Git Product home page Git Product logo

Comments (1)

Joe3n avatar Joe3n commented on July 29, 2024 1

At the moment i don't know how this can be done automated. Homeassistant saves all registered entitys in "/config/.storage/core.entity_registry". With this change in the unique ID a new entry per sensor will be generated with a different unique_id (HA thinks this will be a new entry, while the old entry is orphaned)

Example for one sensor

e. g. Entry for temperature with old unique_id format (my sensor is called airdata)

{
"entity_id": "sensor.airdata_humidity",
"config_entry_id": null,
"device_id": null,
"area_id": null,
"unique_id": "airdata Humidity",
"platform": "local_luftdaten",
"name": null,
"icon": null,
"disabled_by": null,
"capabilities": null,
"supported_features": 0,
"device_class": "humidity",
"unit_of_measurement": "%",
"original_name": "airdata Humidity",
"original_icon": null
}

After the update the new entry would look like this:

{
"entity_id": "sensor.airdata_humidity_2",
"config_entry_id": null,
"device_id": null,
"area_id": null,
"unique_id": "airdata-BME280_humidity",
"platform": "local_luftdaten",
"name": null,
"icon": null,
"disabled_by": null,
"capabilities": null,
"supported_features": 0,
"device_class": "humidity",
"unit_of_measurement": "%",
"original_name": "airdata Humidity",
"original_icon": null
}

  1. After the update, you can see in HA (Configuration->Entity) two entries:
    grafik
  2. Delete the old entry (the one with the red sign at the end). This will also delete the entry in the core.entity_registry
  3. Open the new Entry
    grafik
  4. Change "Entity-ID" to the value of the deleted sensor
    grafik
  5. So only one entry per sensor remains, the history data will not be lost if you do it like this
    grafik
    grafik
    The gap in the graph was the time i took to work this update procedure out 😁

Not so smart alternative

Alternatively you could edit "/config/.storage/core.entity_registry" but i think this is a bad idea to directly edit a HA file... This i haven't tested and would be a hassle for the most users

from local_luftdaten.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.