Hue-emulation: Alexa doesn't detect devices?

Hi there,

I’m trying to re-add my Switches in Alexa using hue-emulation since I have change the server/config of OpenHab (2.4).

This is what I’m doing:

  • Enable hue-emulation
  • Set discovery address to my Openhab IP
  • Change OpenHab Port from 8080 to 80 (Docker)
  • Enable Pairing
  • Alexa Android App: Try to discover Hue Bridge V1 devices

Unfortunately nothing is discovered. If I use hue-essentials and connect to my openhab IP, it discovers all the devices.

In the logs I seem to get an error as well:

2019-03-09 18:27:31.503 [ERROR] [org.openhab.io.hueemulation         ] - bundle org.openhab.io.hueemulation:2.4.0 (247)[org.openhab.io.hueemulation.internal.HueEmulationService(258)] : The modified method has thrown an exception
java.lang.NullPointerException: null
	at org.openhab.io.hueemulation.internal.Utils.getMAC(Utils.java:50) ~[?:?]
	at org.openhab.io.hueemulation.internal.HueEmulationService.restartDiscovery(HueEmulationService.java:413) ~[?:?]
	at org.openhab.io.hueemulation.internal.HueEmulationService.modified(HueEmulationService.java:257) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[?:?]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod.invokeMethod(BaseMethod.java:228) ~[39:org.apache.felix.scr:2.1.2]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod.access$500(BaseMethod.java:41) ~[39:org.apache.felix.scr:2.1.2]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod$Resolved.invoke(BaseMethod.java:664) ~[39:org.apache.felix.scr:2.1.2]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod.invoke(BaseMethod.java:510) [39:org.apache.felix.scr:2.1.2]
	at org.apache.felix.scr.impl.inject.methods.ActivateMethod.invoke(ActivateMethod.java:317) [39:org.apache.felix.scr:2.1.2]
	at org.apache.felix.scr.impl.inject.methods.ActivateMethod.invoke(ActivateMethod.java:307) [39:org.apache.felix.scr:2.1.2]
	at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeModifiedMethod(SingleComponentManager.java:810) [39:org.apache.felix.scr:2.1.2]
	at org.apache.felix.scr.impl.manager.SingleComponentManager.modify(SingleComponentManager.java:765) [39:org.apache.felix.scr:2.1.2]
	at org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure(SingleComponentManager.java:683) [39:org.apache.felix.scr:2.1.2]
	at org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure(SingleComponentManager.java:647) [39:org.apache.felix.scr:2.1.2]
	at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.configurationUpdated(ConfigurableComponentHolder.java:435) [39:org.apache.felix.scr:2.1.2]
	at org.apache.felix.scr.impl.manager.RegionConfigurationSupport.configurationEvent(RegionConfigurationSupport.java:288) [39:org.apache.felix.scr:2.1.2]
	at org.apache.felix.scr.impl.manager.RegionConfigurationSupport$1.configurationEvent(RegionConfigurationSupport.java:91) [39:org.apache.felix.scr:2.1.2]
	at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.sendEvent(ConfigurationManager.java:1667) [9:org.apache.felix.configadmin:1.9.4]
	at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.run(ConfigurationManager.java:1635) [9:org.apache.felix.configadmin:1.9.4]
	at org.apache.felix.cm.impl.UpdateThread$1.run(UpdateThread.java:126) [9:org.apache.felix.configadmin:1.9.4]
	at org.apache.felix.cm.impl.UpdateThread$1.run(UpdateThread.java:123) [9:org.apache.felix.configadmin:1.9.4]
	at java.security.AccessController.doPrivileged(Native Method) ~[?:?]
	at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:122) [9:org.apache.felix.configadmin:1.9.4]
	at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:105) [9:org.apache.felix.configadmin:1.9.4]
	at java.lang.Thread.run(Thread.java:748) [?:?]

Can anyone tell me what I’m doing wrong?

Hue emulation does not work in docker containers where IP interfaces do not have a mac address assigned.

That was fixed with oh 2.5m1 (or snapshots not sure).

Thanks @David_Graeff I’ve switched to 2.5m1 but it doesn’t seem to work.
The two files (description and api/) are there.

description.xml contains: URLBase: http://172.17.0.9:80/ which is the internal docker IP

Should this be different?

Do you still experience the error in the log file? That should be gone now. If your “description.xml” and /api works, it is actually the Echos fault. A lot of people struggle with the current Amazon implementation, including me. You need to remove all devices from your Echo (best is to hard reset it even) to make it discover the bridge.

Have a look at the troubleshoot section of the hue emulation doc. Check the debug page if your devices are really exposed.

No error anymore.

Hmm… what settings are you using in the service config? Do I need to enable the Alexa fix and IP/Port?

The port is required if you use a reverse proxy. If you start openHAB on port 80 it is not required.

If you start a hard-reseted / newly installed / just unboxed Echo discovery process, then no. But most of the time yes.

I’ve removed all Hue devices, and did as above, but it doesn’t work :frowning:
I’m not sure if I should really reset the Echo - does this just affect the echo or also my skills or training data?

It sometimes works without a full Echo reset. You need to try the discovery by asking multiple different Echos, use the webpage and use the App as well. Apparently they all perform the discovery in a slightly different way, it also seem to depend on the firmware version.

Is this definitely resolved?

Running 2.5.0.M1 on docker and I can get everything except HUE/Alexa bridge working now.
I have a spent plenty time getting this far…

There is one remaining pull request that need to be merged because Alexa sends incorrect requests. Apart from that it works, yes.

Ok - will try again.
I’m running 2.5.0.M1 in docker on port 8888 - am I missing a critical change?
My network is host mode - but do I maybe have to force port 80 (or 8300?) requests at 8888?

Thanks for any suggestions

Most Alexa Echo firmwares are happier with port 80, sometimes it works on other ports but that’s not guaranteed.

Even without the patch Alexa should find devices. It just cannot command them.

Thanks David,

If I keep struggling, will have a go at using the Alexa Openhab cloud skill instead.

Thanks for your assistance

If you are familiar with AWS I’d recommend to install your own OH skill instance (find that in the openhab alexa repository). Openhab Cloud is not known for its stability at peak times.

Oh dear, that’s a nuisance :slight_smile:
It’s a long downward spiral . . .what started with a quick migration to Docker has become a re-write for Alexa integration and a vitis to AWS.

I would not say so. The latest issues are more likely due to the huge increase of users and a onetime outage of one of our app servers.

1 Like