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

Evening All,

I had an issue with my emulated_hue component and the fix was to:

  1. Delete the emulated_hue_ids.json
  2. Delete all the deviced on alexa.amazon.com

The above two steps have generally fixed the issue for me in the past. This time I had to do carry out a third step.

  1. Stop the “offending” amazon devices.

Now my question is about the last point “Stop “offending” amazon devices.”. For some reason, although I deleted all the devices shown at alexa.amazon.com, some of the echo dots are still retaining the lights and sending requests to my pi.:

> 2020-06-02 21:00:40 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Unknown entity number: 31 not found in emulated_hue_ids.json
> 2020-06-02 21:00:40 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Unknown entity number: 22 not found in emulated_hue_ids.json
> 2020-06-02 21:00:40 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Unknown entity number: 34 not found in emulated_hue_ids.json
> 2020-06-02 21:00:40 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Unknown entity number: 34 not found in emulated_hue_ids.json
> 2020-06-02 21:00:40 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Unknown entity number: 48 not found in emulated_hue_ids.json
> 2020-06-02 21:00:40 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Unknown entity number: 48 not found in emulated_hue_ids.json
> 2020-06-02 21:00:40 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Unknown entity number: 48 not found in emulated_hue_ids.json

This was stopping the emualted_hue from working. I tried removing the devices and adding them again (as others have suggested in the cominuty) however this did not work for me. I ended up unplugging all the amazon devices and leaving one which I hopped wasn’t one of the *“offending” devices. I got lucky as when I rebooted the pi I didn’t get the above errors. I then scanned for devices and added all my lights again. A new emulated_hue_ids.json was created (the “offending” devices were stopping this from happenign it seems).

I’ve since plugged them back in and I am getting the errors again. The lights do work, however if my emulated_hue breaks again it would be nice to know how to properlly “flush” the amazon devices so I don’t have to go round unplugging all my dots & echos.

I’m having the same problem for some time now.
Removing the devices from amazon and deleting the json file doesn’t change anything.

It’s looks like the “entity numbers” are stored somewhere else as well but I couldn’t find anything on my system.

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.
2 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.