How to efficiently "flush" emulated hue? (Solved)

Everything is being stored on the Alexa. You have to clear Alexa’s cache. From what I can tell, the only way to clear the cache is to delete the devices on Alexa’s side and reboot all the echos (with emulated hue off).

1 Like

Thanks for the suggestion but this didn’t work either. I’ll so some more googling / research and post back here since other’s have had the same issue.

1 Like

Right so I went completely nuclear (very over kill) on this and it seemed to do the trick:

  • Deleted emulated_hue_ids.json
  • Re-wrote my “emulated_hue:” in the configuration.yaml to allow for individual items.
  • Shut Down Pi.
  • Soft Reset All Echos / Dots.
  • Unplugged All Echos / Dots over night.
  • Deregistered each device.
  • Cleared smart devices from alexa.amazon.com
  • “Delete Smart Home Devices History” (blue button) from “Manage Smart Home Devices History” on Amazon (not alexa.amazon.com).
  • Deleted all voice history (I appreciate this is not necessary but as I said I went nuclear on this).
  • Did a scan when the pi was not plugged in.
  • Plugged one echo / dot at a time and doing a hard reset before adding back to my account.
  • Tuned on pi.
  • Scanned and now no more “Unknown entity number”.

I know the above is over kill but it was really getting on my nerves. I believe most of the above is not necessary and you should be able to get away with:

  • Delete emulated_hue_ids.json
  • Shut Down Pi.
  • Deregister each device.
  • Clear smart devices from alexa.amazon.com
  • “Delete Smart Home Devices History” (blue button) from “Manage Smart Home Devices History” on Amazon (not alexa.amazon.com).
  • Plug one echo / dot at a time and doing a hard reset before adding back to your account.
  • Tuned on pi.
  • Scan for devices.
5 Likes

@Knottyboy, thank you for the time to get this nuclear “workaround”, I’m still having problems with my echo dot devices 2nd generation, it works perfectly with the 3rd generation, but when I connect a 2nd generation echo dot, all the garbage shows again.

Any idea?

the garbage is stored on the gen2 dot. factory reset it.

1 Like

You just saved my marriage. This was driving me insane and cost me 4 hours of trying things until I found your post. I still have an original 2nd gen dot I can’t seem to fully reset no matter what I do so that one probably will just go in the garbage.

1 Like

I think the menu has changed or moved. I can’t seem to find these two bullet points. Someone can confirm where to navigate?

Clear smart devices from alexa.amazon.com

"Delete Smart Home Devices History" (blue button) from "Manage Smart Home Devices History" on Amazon (not alexa.amazon.com).

Ok, I think I found them.
1 - Smart Home Make sure you are logged in first.
2 - Delete Smart Home Devices History. Make sure you are logged in first.

I have a mix a of gen2 and gen3 devices and was experiencing this same issue. Removing devices seems to work better in the current Alexa app on Android so you may want to try this first. Since I’ve done this, all the removed devices have stopped showing up in my hass log.

  • Shutdown Home Assistant
  • Delete .storage/emulated_hue.ids
  • Edit configuration.yaml to only expose the devices you want
  • Go into the app and delete all hue devices
  • Go to Mange Alex Data and under “Smart Home Device History”, click on “One-time deletion of all history”. Not sure if this step is needed now. If someone wants to try skipping it, let us know.
  • Start Home Assistant
  • Perform a hue gen 1 discovery from the app which will pull in current and old / invalid devices
  • Click on each invalid device within the app and delete it

Your solution worked great for me. I was actually able to skip your 5th step (one time deletion of all history) and still was able to get rid of duplicate devices

Is there any solution without this step?
It can’t be the only way to always delete 100 old devices after a scan for new devices ?!

1 Like

Funny, I’m working through the steps in this thread right now. I was trying many things prior to seeing the steps here and I have deleted all items from within Alexa at least 4 times now. To describe the process in one word = painful
Finding it is faster to manage Alexa from a desktop, but do the device discovery from the app.

For anyone who’s running into this issue and still a bit confused, here’s the solution that ultimately worked for me:

  1. Remove your old devices from config/.storage/emulated_hue.ids (I use terminal and run rm .storage/emulated_hue.ids from the config folder to erase it completely; may want to create a backup first with cp .storage/emulated_hue.ids .storage/emulated_hue.ids.bak)
  2. Ensure your config is setup properly (see example below; verify by checking http://<HA IP Address>:80/api/pi/lights)
  3. Restart HASS
  4. Remove all emulated hue devices from the alexa app (easiest way I’ve found is via this page: https://alexa.amazon.com/spa/index.html#appliances)
  5. Un-register all echo devices (I did this via the android app, bit of a pain unfortunately)
  6. Re-register one echo back on to your account
  7. Repeat device discovery
  8. Et Voila, it’s hopefully now only detecting your currently activated devices from emulated hue. Re-add your other echos and you should be all set.

Now this all is very finicky, it seems the root of the issue is that the echo devices cache a list of old emulated hue devices and restore them even if they’re deleted from the app (and even if you delete smart home history as suggested above, at least in my experience). Of course you should first make sure only the desired smart-home devices are enabled in your emulated hue settings; I’m personally going to be testing out using groups for setting these devices up as I’m hoping this makes rearranging smart-home devices easier in the future. For an example:

/config/configuration.yaml

group: !include groups.yaml

emulated_hue:
    listen_port: 80
    expose_by_default: false
    entities:
        group.kitchen: {hidden: false}
        group.living_room: {hidden: false}

/config/groups.yaml

living_room:
    name: Living Room
    entities:
        - switch.outlet_2
        - switch.switchmate_1
kitchen:
    name: Kitchen
    entities:
        - switch.switchmate_2

Hope this is helpful to some other poor soul who’s been struggling with this same issue for far too long!

1 Like

I don’t have the emulated hue hidden file in storage for some reason. But the integration has greatly messed up my ability to add lights. It mixes them up incorrectly in alexa, so i really want to reset this, but not keen on unregistering all my alexa’s, as i imagine i will have to reset all my TTS routines then as well…

Is this integration not supported by HA anymore?

1 Like

The solution accepted here (lead by google search) is way over-kill.

  1. Remove the file
  2. Restart HA
  3. Remove all your HA devices from Alexa
  4. Launch discovery again.

I actually started toying with the emulated_hue_ids because I had a message about an old device not being found. I just had to remove it from Alexa actually, and not play with that file.

Results will vary. Doing the simplified approach you suggest landed me 300 inaccurate devices being discovered. Factory resetting my Dots was the only way to flush them.
Running discovery showed me which Echo Dot retained what devices in memory.
The Dots were able to remember device IDs for items I no longer have in use, etc. Even with no ID file in place anymore and removing all smart home history from Amazon’s site.

Also getting this really frustrating issue from time to time when i do changes.
So my question is:

Currently i am running just two old Gen 1 Echo’s (not dot).
All others are Show 8, 5 or dot Gen 4.

When i ditch the old Gen 1, is the issue gone with the newer ones?

thx

Going off memory here, but believe you must have a gen 1 or gen 2 device in order for this to even work. Maybe that’s changed?

I hope that’s not the case :frowning:
Struggling with this echo caching bug since i fideld around with smarthome and ha_bridge in the early days. Cant believe big A hasn’t sorted this!

Can anyone with just 3gen+ devices can test if emulated hue works?

thx

Thanks, that also worked for me for my two gen 1 echo’s.

Same for me, i dont have the hidden file in the .storage folder, si i can’t delete it 🥲