#Re-adding a Device With New ID

1 messages · Page 1 of 1 (latest)

thick gyro
#

A couple years ago I was exploring solar in my area with a smaller setup and wanted to have the data in HA. In order to do this I bought a smart plug (Kasa) with energy monitoring and it would report power which I piped into the solar dash. All good.

Since then I have upgraded to a “real” solar system and decomissioned the old one. The other day I wanted to use the smart plug for monitoring the energy for something else but I’m stuck in a loop of issues and data loss.

If I remove the smart plug from HA or remove the entity from the energy dash I lose all the solar history, I would like to keep that.
If I use the device anywhere else the energy dashboard adds solar because the entity is still there.

What I want to do is re-add the device to HA with a new unique identifier or name but I cant figure this out. I think the ID is based on the MAC address so it recognizes that it's the same plug and thus I'm stuck in this loop.

stone swan
#

You can remove the smart plug from HA. The old entity ID will stay in the energy dashboard. The old statistics will stay.

#

Then you can re-add it with a different entity id, and re-use it, breaking the connection with the old data.

thick gyro
#

This is my problem, When I re-add it, I don't see a way where I can "force" the entity ID to be anything other than default, which ties it back to the old plug

stone swan
#

Can you:

  • change the entity id to something unique
  • then delete it
  • then re-add it?
#

I assume it will not re-add with the modified ID.

#

or at least I hope not

thick gyro
#

ok This is my current ID.

#

so you think change this to something like *_2. delete the plug, then re-add it?

stone swan
#

hmm nevermind. When you re-integrate the device it automatically calls it that?

thick gyro
#

yes

stone swan
#

hmm

#

You may have to also delete the entity_id after removing the device, don't know if you did that.

#

it will show something like "Not provided"

thick gyro
#

{
"aliases": [],
"area_id": null,
"capabilities": {
"state_class": "total_increasing"
},
"config_entry_id": "fd4440744d68db1b164007194bc47067",
"device_class": null,
"device_id": "b5007118f20ebb97f3ffb95601a76afc",
"disabled_by": null,
"entity_category": null,
"entity_id": "sensor.solar_panels_total_consumption",
"hidden_by": null,
"icon": null,
"id": "b484e4ef14a350cb2fdddce47fbb3746",
"has_entity_name": true,
"name": null,
"options": {
"conversation": {
"should_expose": false
},
"sensor": {
"display_precision": null
}
},
"original_device_class": "energy",
"original_icon": null,
"original_name": "Total consumption",
"platform": "tplink",
"supported_features": 0,
"translation_key": "total_consumption",
"unique_id": "54:AF:97:08:4E:21_total_energy_kwh",
"unit_of_measurement": "kWh"
},

#

in my .storage/core.entity_registry is this. I wonder if I can change the device_id?

#

seems risky

#

or more likely the config_entry_ID