Emulated Hue problems

Hey guys

I’m new to Home Assistant, but so far most things have worked well with little configuration, sweet. However I’m having issues with the emulated hue component.

I’m trying to connect my Alexa app to HA with little success. In the Alexa app when I click discover nothing shows up. I’ve tried using the actual Hue app to see if that works and it doesn’t (should it?)

If I go to http://my-ip:8300/description.xml I do see a response, so it seems it’s running properly.

I’ve tried running as regular user “hass” on port 8300, root on 8300 and port 80, and each try I can see the response in my browser, but neither app can find the bridge.

Both devices (phone and server) are running on the same subnet, addresses are 10.3.37.22 and 10.3.37.26 with successful communication between them (pings and nmap)

I’ve also tried turning the api_password off, but that didn’t make any difference.

Also, nothing is showing up in the log, except “Listen IP address not specified, auto-detected address is 10.3.37.22”

Does anybody have any suggestions of things I can try?

Thanks,
Eric

Not sure if this is related, but when I started doing custom intents with Alexa, I had to have HASS set up for SSL. All endpoints in Alexa Voice Services have to be https, even if it’s a private skill in test mode.

@ericfri can you post your emulated_hue: settings in the configuration.yaml

The more information we have to go on the better chance we can pinpoint the problem :slight_smile:

Yeah, this would only apply when using the custom skills with Alexa, but https is not necessary for connecting Alexa to Home Assistant over the network :slight_smile:

1 Like

Yeah.
Currently it’s just
emulated_hue:

But I’ve tried different combinations of:
emulated:hue:
host_ip: 10.3.37.22
listen_port: 8300 (and 80)

I’ve also tried with and without the rest of the options.

I essentially have the same problem you described, yet to find a solution.

I personally can’t recommend the embedded hue emulation feature of Home Assistant, as it is still pretty buggy and relies upon restarting Home Assistant on any changes.

I would still recommend HA Bridge as your hue emulator, as it gives you control over not only home assistant, but ANY third party API as well as terminal commands to be accessed by Alexa as on/off devices. It supports dimming, which can also be used as a feature to control a thermostat through Alexa, as it passes through the temperature while thinking it is passing through a brightness level, so I currently tell Alexa to set my thermostat to 74 and it passes through the number to the HA Bridge which calls the Home Assistant API which sets my temperature to 74. It can even be hooked up to existing hue bridges to proxy their devices through so that Alexa only has to connect to the HA Bridge and still see all devices on all of your physical hue bridges.

It’s perfect for those that don’t even own hue bridges as well as those that do.

It also works well with homebridge, so those with iOS devices can do the same things with Siri as they can with Alexa. I am using both Alexa and Siri and both have acces to the same set of devices setup on HA Bridge.

3 Likes

I’ve looked at this before but it looks like a bear to set up and config for less experienced users. Any good tutorials or setup guides you could point us to, @jbardi? I’d like to give it a try but am a little apprehensive.

2 Likes

For what it’s worth, I’m trying this using http://alexa.amazon.com/ and https://echosim.io/ and the “Discover Devices” does not find anything either. Not sure if it will in this configuration but thought I’d try anyway. My YAML looks like this:

emulated_hue:
  host_ip: 10.0.1.204
  listen_port: 8300
  off_maps_to_on_domains:
  expose_by_default:
  exposed_domains:

http://10.0.1.204:8300/description.xml also returns information so system looks alive. Once my DOT2’s arrive, I’ll have another crack!

Can’t remember, are you running on Raspberry Pi?

Here are steps for Raspberry Pi, you can change these to match your system. Let me know if you have any problems:

*** UPDATE *** Thanks to @xbmcnut

I had forgotten that java may not be installed already on your Raspberry Pi, so you must do the following before running:


  1. On your Raspberry Pi, make sure you are in the Pi home folder:

cd /home/pi/

  1. Then make an habridge folder:

mkdir habridge

  1. Now change to the folder and download the latest ha-bridge jar file:

    cd habridge
    wget https://github.com/bwssytems/ha-bridge/releases/download/v3.1.0/ha-bridge-3.1.0.jar

  2. I can’t remember if ha-bridge automatically creates the data folder or not, but I could have sworn it wasn’t created for me, so you an just create it yourself:

mkdir data

  1. Now you have to create the systemd service file:

nano habridge.service

  1. Then copy and paste the following:

    [Unit]
    Description=HA Bridge
    Wants=network.target
    After=network.target

    [Service]
    Type=simple
    ExecStart=/usr/bin/java -jar -Dconfig.file=/home/pi/habridge/data/habridge.config /home/pi/habridge/ha-bridge-3.1.0.jar

    [Install]
    WantedBy=multi-user.target

  2. Now, to save the file, hit CTRL-X, then hit Y and RETURN

  3. This step was added thanks to @xbmcnut as I forgot that Java may not already be installed on your system.

  1. Next you need to enable the systemd service so it will automatically start every time you reboot your Raspberry Pi:

sudo systemctl enable /home/pi/habridge/habridge.service

  1. Now that it is enabled, you have to start it. Since it is enabled, you don’t need the full path to run it:

sudo systemctl start habridge

  1. The default port for HA Bridge is 8080, so open your browser and go to your RPI address, port 8080:

http://[your-ip-address]:8080

4 Likes

This is awesome and looks a lot easier than I thought. (I am on Pi BTW, so these were perfect.)

I assume I can change the port in the configs if there is a conflict, right?

Thanks very much for taking the time to write this out!

Thanks for the instructions. Followed step by step but http://[your-ip-address]:8080 does not load. Here is my service log.

pi@raspberrypi:~ $ systemctl status habridge.service
● habridge.service - HA Bridge
   Loaded: loaded (/home/pi/habridge/habridge.service; enabled)
   Active: failed (Result: exit-code) since Mon 2016-09-19 21:08:57 NZST; 9min a                 go
  Process: 556 ExecStart=/usr/bin/java -jar -Dconfig.file=/home/pi/habridge/data                 /habridge.config /home/pi/habridge/ha-bridge-3.1.0.jar (code=exited, status=203/                 EXEC)
 Main PID: 556 (code=exited, status=203/EXEC)

On my Jessie build, there is no folder usr/bin/java. Assume that is the cause?

FIXED. You need Java 8 JDK

sudo apt-get update && sudo apt-get install oracle-java8-jdk

Then run:

sudo update-alternatives --config java

And select the JDK 8 version (/usr/lib/jvm/jdk-8-oracle-arm32-vfp-hflt/jre/bin/java).

Then run:

java -version

I found that my Echo and Dot had to be on the same network as my HA. Multicast is sometimes not forwarded correctly through routers, I think is the cause. When I say network, I mean the same wifi network. Otherwise it will find no devices.

I’ve done some more research and testing on this. I setup HA Bridge, which was pretty straight forward, and created a test device that works via the HA Bridge console.

Still having the same results, Echo doesn’t find any new devices. So this is leading me to believe that either my router has something to do with it (Asus RT-AC88U), or the fact that I run it on Ubuntu and the OS is doing something to block the discovery traffic (UFW Firewall Off), or that the Ubuntu is a VM running on a QNAP with 802.3ad port trunking and that is interfering with the multicast traffic.

I might throw HA Bridge on a Pi and see if I get better results.

Oh, sorry about that, it had been months since I installed this, so I totally forgot that java may not have been installed already. I’ll add that to the steps above, thanks!

Thanks. Is there a trick to getting Alexa to ‘see’ the bridge. HA-Bridge is working and I’ve added my Vera and can initially control two switches and a scene through the bridge using the web gui. When I scan for devices though, nothing is found either in http://alexa.amazon.com or the app. Same thing that is happening with the new Emulated Hue. Do would I go about debugging that?

I’m having the same issue. HA-Bridge on Pi2 now with Linksys EA6500 router with UPnP enabled. Pi is connected via LAN and I’m running http://alexa.amazon.com in Firefox to test, connected to the same network but via WiFi. Just tried connecting laptop via LAN, no difference. App on phone ‘sees’ nothing either.

Try rebooting the Echo by unplugging and plugging it back in. For some reason that worked for me, no clue why tho…

I’ve tried rebooting a few times, no luck.