Uninstalled Hue Emulation -- items still discovered

I wanted to switch to the Alexa Cloud Integration via the openHAB Cloud Connector, since the Hue Emulation is causing me a lot of trouble lately.

The bad thing is: although I uninstalled the Hue Emulation service Alexa still discovers the items previously exposed by the Hue Emulation service.

Does anyone have an idea how to get rid of these items for a clean start with the Cloud Connector?

Hello @ceedee,

are you using the paperUI or a textual configuration?

I’m using PaperUI for Hue Emulation and Cloud Connector. But how is this relevant? I uninstalled Hue Emulation via PaperUI.

Yes: The method of configuration seems to be relevant as I did experience the same issue with paperUI (but not with textual configuration). In my case, a complete restart of openHAB has led to success.

Your last discovery results are stored in /var/lib/openhab2/jsondb/org.eclipse.smarthome.config.discovery.DiscoveryResult.json.
Can you open a GitHub issue please to ask for removal/regeneration of that when bindings are uninstalled?

1 Like

Which version of the hue emulation service?

To be sure, have you already installed the OH Alexa skill? If so, it will discover the Items that you have tagged or added V3 Alexa metadata to.

For a clean start, remove the skill, remove hueemulation, delete the devices through the Alexa app, try to rediscover (should not find anything), then install the skill and rediscover.

Ok, thank you all for your help. As I’ve run more tests on myself in the meantime I can answer some of your questions and hopefully reveal more details which help solving this mysterious case:

@gs4711 I’m assuming that you’re referring to the configuration of Hue Emulation itself, not thing configuration or something like that. If so: yes, I’ve used PaperUI for conf. Anyway, I’ve performed several reboots without any success. – But I think the problem is not coming from openHAB, although it is somehow related to it, please see my detailed test description below.

@mstormi The file you are referring to stores information on the devices I can see in PaperUI -> Inbox. My problem is that the Amazon Echo detects devices which were exposed via the Hue Emulation service, but now are not longer exposed since the addon has been uninstalled. – Please have a look at the description of what I’ve tested. I think it will help narrowing down the cause.

@5iver It was misc-hueemulation-2.4.0. Regarding to the OH Alexa skill: what are you referring to? A binding within openHAB or a real Alexa skill on Amazon Skill Store side? The latter i’ve done – the openHAB skill is installed and connected to myopenhab.org. But that’s a second problem for which I will open a new issue here since this is not working for me neither. Within this issue I’d like to focus on getting rid of the old items coming from Hue Emulation to avoid any conflicts when working with cloud connector.

So here’s what I’ve tested and found out so far:

  1. Preparation: I’ve uninstalled the Hue Emulation service, followed by a reboot of openHAB.

  2. I’ve opened open alexa.amazon.com and deleted all discovered Smart Home devices via Smart Home -> Devices -> Remove all. I triggered a re-discover with the other button on that site. Besides the devices which are actually configured in the hue app on my smartphone all the devices coming from openHAB via Hue Emulation re-appeared. Such devices carry the subtitle “Royal Philips Electronics Smart Device” in the Alexa app – the name comes from the Hue Emulation service (https://github.com/openhab/openhab2-addons/blob/master/bundles/org.openhab.io.hueemulation/src/main/resources/discovery.xml)

  3. I’ve uninstalled the Hue skill via alexa.amazon.com, performed another reboot of openHAB and repeated the steps in 1. Now only all the devices coming from openHAB via Hue Emulation re-appeared.

  4. I’ve shut down the openHAB raspi and repeated step 2. Still all the devices coming from openHAB via Hue Emulation re-appeared.

  5. I’ve used the clean-up function in the Hue app on my smartphone to re-init the Hue bridge in such way that only devices configured from the Hue app remain on the bridge. I did this to make sure the re-discovered items somehow came from the Hue bridge. I’ve repeated step 3, but the result did not change.

  6. I’ve registered as Hue developer to verify that the clean-up job of the Hue app was successful. I could then enumerate the devices stored on the Hue bridge. This confirmed, that only the devices from the Hue app were stored on the bridge.

  7. I’ve contacted Amazon first level support on this. They recommended a factory reset of the Echo device since the discovered items might be stored on the Echo device. As expected, the assumption was wrong since another execution of test 3 led to the same result. Anyway, the support officer filed a ticket for the Alexa engineers to prune these devices – I don’t know if or when this will happen.

What I’ve concluded from the tests:

  1. Test 3 shows that the issue is not directly related to openHAB, since it could not give any items to the Echo item discovery routine.
  2. Test 4 and 5 excluded the Hue Bridge from causing these problems.
  3. The discovered items can only come from some kind of cache or database on Amazon side, thus I let the support file a ticket.

Do you agree with my conclusion or have I missed something?

Best regards,
ceedee

Did you find a solution for this issue?
I have the same problem (but without a physical Hue bridge).
I deleted the cache and tmp stuff and removed the still existing hueemulation.config, but this did not help either.

The remaining hue stuff seems to be blocking the discovery of the „real“ Openhab skill items, because I have created a brand new item and tagged it for the skill, but it does not show up in the results at all.
Still all the old Royal Philips devices only.

Could it be possible, that the shutdown was not recognized by OpenhabCloud and the devices have still been somewhere buffered in the cloud and stayed accessible for Alexa?

EDIT:
I tried the same thing and shutdown OH, disconnect it separately from the cloud service and made sure that it’s shown as offline.

However, Alexa still recognizes the same old items / devices.
:frowning:

If I remember correctly, I deleted every single discovered smart home device item at alexa.amazon.com. After that and restarting openHAB everything worked out. Using the delete all button did not work in the same way – the Amazon support didn’t comment on this, but somehow there were different implementations under to hood.

Thanks, @ceedee.
I played around with it as well:

  1. deleted the devices
  2. deleted the still existing hueemulation.config
  3. rebooted OH
  4. Took Alexa from power
  5. Contacted Amzon support and described my issue (maybe they deleted something in the background!?)
  6. Discovered the new Devices - the old were gone.

I am not quite sure, what I did differently.
Maybe I deleted the devices one by one as well.

Glad to hear that it works now!

Unfortunately I have the same issue and I cannot resolve it with the steps mentioned :frowning:
I am using openHAB 2.5.9 Release Build.

Alexa always discovers 149 items, regardless if I uninstall the hue emulation, shutdown openhab2, shutdown the PC, remove the network cable and delete /var/lib/openhab2/config/org/openhab/hueemulation.config.
I tried to delete all items manually one by one but they all appear again when I discover devices.

I believe the issue started after I replaced my old PC with OH2 with a new PC (same IP address as the old PC). However this may be unrelated and just my imagination.

There seems to be some cache somewhere on an Alexa server or on an Alexa device which stores those old devices.
Any hint would be appreciated, Alexa control with OH2 is completely broken for me now :frowning:

Have you been in contact with the Amazon support?
As far as I remember they change something in the system and my items were gone.

However, I strongly recommend to use the Alexa skill instead.
This is much more reliable.

I moved to the Alexa skill, too and am happy with it!

Yes I did that, they only mentioned to delete all devices, remove HUE permissions from the HUE website, start over and rediscover again. And If I still have an issue I should get in contact with the Philips HUE Team …

Nevertheless, I found a clue in the HASS forum and got it working for me now. Hopefully it stays that way. A post in the HASS forum mentioned that it may be related to older Echo Gen2 devices, I have 2x Echo Dot Gen2.

What solved it for me:

  • Uninstalled the Hue Emulation Binding, deleted hueemulation config, restart OH2
  • Uninstalled the Hue Skill from Alexa and also removed permissions for Alexa in the Hue App Permissions
  • Unplugged all my Echo devices (Flex, Dot, Echo) and waited 10 minutes
  • I only plugged in my newest Echo Gen3
  • Started discovery in Alexa, nothing was found, not even the devices from my real Hue Bridge (->that is strange)
  • Installed the Hue Emulation Binding, configured it, restarted OH2
  • Started discovery in Alexa, nothing was found again

At this point I decided to just install the OH2 skill in Alexa. Anyway the Alexas only work if Internet is available, so I anyway cannot get it completely running locally.

  • Started discovery in Alexa, all my items were found with the note “Connected via OpenHab”
  • plugged in all my Echo devices
  • works now

Great, thanks a lot for sharing this with the community.
I am not sure if Amazon really did change something.
They said they’re gonna check the system and delete the cache.
After that and deleting all the items again, it was working fine.
After experience with a hue emulation as well as the Amazon openhab skill, I must say, that the Amazon openhab skill is working much better.

If anyone comes across this thread looking to solve this issue. It is still a problem, but not an OpenHAB problem. Devices remain cached with Alexa/Amazon even when OpenHAB is disconnected.

Simply deleting all the Alexa smarthome items won’t clear this background cache. A new discovery finds them again straight away.

The ‘fix’ (once you’ve made sure the OpenHAB Hue Emulation has been uninstalled or at least check the ‘/api/status’ page shows no published lights) seems to be delete all the smarthome items on alexa.amazon.com and unplug any Echo devices for a period of time. Not quite sure specifically how long but I unplugged them for an hour and this was sufficient to clear any cached old items permanently.