Moved zones to zones.yaml but Dev Tools still shows old zones

I noticed that despite renaming Zones in the Map page, when I displayed people’s location it was still using the old names. So in an attempt to tidy this all up I created a new “zones.yaml” file under /config and deleted the “zone” file under ./storage

The new zones seem to work just fine and when I look at Zones under Developer Tools I can see the new (correctly named) zones in the list. However despite me deleting the old .storage/zone file its still also showing the old zones!

How can I clear out these old zones? You can see what I mean from the below screengrab.

Please don’t do this. You can delete zones from the frontend UI or from your YAML, depending on how you created them.

All bets are off now that you have messed with the registry. But it was probably just a matter of resetting your frontend cache. Or it could be a bug that should have been reported.

1 Like

Oops!

I originally emptied out the values in the zone file and left an empty array but when I restarted it gave me an error. Removing the file sorted the error.

I’ll see if I can recreate it.

EDIT: Commented out the include of my “zones.yaml” file, and went and created a new zone via the frontend. Its recreated the “.storage/zone” file. I then deleted the test zone I’d created in the frontend (using the frontend to delete it) and then uncommented the zones.yaml include.

My zones are all back, I have a barebones .storage/zone file, but I’m still seeing the issue above with the old zones seeming still existing somewhere. Could they be cached somewhere?

Actually - just noticed the old ones have an attribute of “restored” set to true so I think they’ve somehow been saved from a backup, maybe when I deleted the zone file.

image

  1. delete the yaml
  2. restart
  3. go to Devices & Services → Entities list. Delete the restored entity.

Thanks Tom. I think you were right originally with your comment about all bets being off!

I’ve removed the zones.yaml file I created completely. I’ve also removed any automations I’d set up that use zones. I restarted, and then deleted the restored entities.

However when I go into Map its STILL showing the old zones and I can’t edit them as it says they don’t have a unique id!!

They’re obviously still hiding somewhere but for the life of me I don’t know where!

EDIT: Maybe it took a minute or two to refresh its cache somewhere but although I didn’t do anything else, it now seems they’ve finally all disappeared and I can restart from scratch.

Same issue here, but Shift+F5 to reset my frontend cache fixed it. Thanks!