Echo Dot with Emulated Hue (Fall 2017)

Ok, so this topic has been asked many times before, and I’ve been trying all different combinations over and over for last few days without any progress. TL,DR: Alexa is not able to find emulated hue bridge.

My environment details:

  • Using Hass.io 0.60 (with HA 0.52.1 upgraded from HA 0.51.2)
  • I’ve installed Hass.io on my Raspberry Pi 3 (I have also tried everything with my old Raspberry Pi B+ too, but the results are exactly the same)
  • I don’t have any physical hue bulbs or bridges
  • I’ve Echo Dot 2 (bought this month)
  • I’m trying to control switch.rpi_gpio with Alexa (I have connected 4 relays connected to GPIO pins and I’m able to control these using the UI toggles)

My configuration (I’m posting entire configuration, since I think I might be missing something silly):

homeassistant:
  name: Home
  latitude: 22.5726
  longitude: 88.3639
  elevation: 91
  unit_system: metric
  time_zone: Asia/Kolkata
  # NOTE: Tried adding here, but same results!
  #customize:
  #  switch.bedroom:
  #    friendly_name: "Bedroom"
  #    emulated_hue: true

frontend:

config:

http:
  api_password: "p@$$w@rd"
  base_url: "mydomain.duckdns.org:8123"
  ssl_certificate: "/ssl/fullchain.pem"
  ssl_key: "/ssl/privkey.pem"

updater:

discovery:

conversation:

history:

logbook:

# NOTE: Logs for `emulated_hue` doesn't show any errors
logger:
  default: error
  logs:
    homeassistant.components: warning
    homeassistant.components.emulated_hue: debug
    
# NOTE: Tried removing `type: alexa` 
# NOTE: Tried removing `advertise_ip: ...` 
# NOTE: Tried removing `listen_port: 80` and changing to `listen_port: 8300` 
emulated_hue:
  type: alexa
  advertise_ip: 192.168.0.101
  listen_port: 80
  expose_by_default: true

switch:
  - platform: rpi_gpio
    invert_logic: true
    ports:
      26: "Tubelight"
      19: "Fan"
      20: "Refrigerator"
      16: "TV"

light:
  - platform: rpi_gpio_pwm
    leds:
      - name: "Bedroom"
        driver: "gpio"
        pins: [17]
        type: "simple"

sensor:
  - platform: yweather
    forecast: 0
    name: "Today's Weather"
    monitored_conditions:
      - weather

group: !include groups.yaml
automation: !include automations.yaml

I’ve tried every combinations as mentioned in the config comments (and of course restarted homeassistant every time after making changes with hassio homeassistant restart). I have SSL setup which is working great. The problem is when I ask alexa to search for devices, it first says “Starting discovery. This can take up to 20 seconds. If you have Philips Hue, press the button on your bridge.”. After 20 seconds it says “Discovery is complete. I couldn’t find any smart home devices. If your Philips bulbs were not discovered, please press button on your bridge and rerun discovery”. I’m getting I do not see anything in the logs too when discovery is running.

Also I do see an XML response when I open http://192.168.0.101/description.xml from my browser (or http://192.168.0.101:8300/description.xml when the port is configured as 8300 – see comment in config). I also see a JSON response at http://192.168.0.101/api/pi/lights containing all the switches and lights as below:

{
   "group.all_automations":{
      "modelid":"HASS123",
      "name":"all automations",
      "state":{
         "bri":0,
         "on":false,
         "reachable":true
      },
      "swversion":"123",
      "type":"Dimmable light",
      "uniqueid":"group.all_automations"
   },
   "group.all_devices":{
      "modelid":"HASS123",
      "name":"all devices",
      "state":{
         "bri":255,
         "on":true,
         "reachable":true
      },
      "swversion":"123",
      "type":"Dimmable light",
      "uniqueid":"group.all_devices"
   },
   "group.all_lights":{
      "modelid":"HASS123",
      "name":"all lights",
      "state":{
         "bri":0,
         "on":false,
         "reachable":true
      },
      "swversion":"123",
      "type":"Dimmable light",
      "uniqueid":"group.all_lights"
   },
   "group.all_switches":{
      "modelid":"HASS123",
      "name":"all switches",
      "state":{
         "bri":0,
         "on":false,
         "reachable":true
      },
      "swversion":"123",
      "type":"Dimmable light",
      "uniqueid":"group.all_switches"
   },
   "light.bedroom":{
      "modelid":"HASS123",
      "name":"Bedroom",
      "state":{
         "bri":0,
         "on":false,
         "reachable":true
      },
      "swversion":"123",
      "type":"Dimmable light",
      "uniqueid":"light.bedroom"
   },
   "switch.fan":{
      "modelid":"HASS123",
      "name":"Fan",
      "state":{
         "bri":0,
         "on":false,
         "reachable":true
      },
      "swversion":"123",
      "type":"Dimmable light",
      "uniqueid":"switch.fan"
   },
   "switch.refrigerator":{
      "modelid":"HASS123",
      "name":"Refrigerator",
      "state":{
         "bri":0,
         "on":false,
         "reachable":true
      },
      "swversion":"123",
      "type":"Dimmable light",
      "uniqueid":"switch.refrigerator"
   },
   "switch.tubelight":{
      "modelid":"HASS123",
      "name":"Tubelight",
      "state":{
         "bri":0,
         "on":false,
         "reachable":true
      },
      "swversion":"123",
      "type":"Dimmable light",
      "uniqueid":"switch.tubelight"
   },
   "switch.tv":{
      "modelid":"HASS123",
      "name":"TV",
      "state":{
         "bri":0,
         "on":false,
         "reachable":true
      },
      "swversion":"123",
      "type":"Dimmable light",
      "uniqueid":"switch.tv"
   }
}

If everything is fine, why alexa is not able to find it? What else am I missing here? Please help, as I’ve started getting frustrated listening the same “press the philips hue button” response from alexa (I know from other posts that emulated_hue component fakes the bridge button and that button is always pressed).

Note that I do not have any skills enabled. Are such skills even required? I’ve tried installing the Hue skill but this also tries to search a Philips Hue bridge before I can enable the skill. I hope that such skills are not required to make this work.

Thanks in advance!

1 Like

Have you tried using literally just…

emulated_hue:

…as that’s all you need unless you specifically want to set other variables.

you got a switch.bedroom? isn’t it light.bedroom in the customize part?

@Bobby_Nobble Yes, that was my very first attempt.

@loki Ahh, good catch! Thanks! Lemme try that too.

@loki, I’ve changed the config from

to

and of course, restarted homeassistant, but she’s still not able to find any smart home devices. :confused:

@Bobby_Nobble, is there any way to test/debug if emulated_hue really works? As mentioned in the config, I’ve enabled debug logs entry for emulated_hue, but all I get is the following:

2017-09-01 01:26:53 WARNING (SyncWorker_4) [homeassistant.components.emulated_hue] Alexa type is deprecated and will be removed in afuture version
2017-09-01 01:26:53 WARNING (SyncWorker_4) [homeassistant.components.emulated_hue] Listen IP address not specified, auto-detected address is 192.168.0.101

There are logs of other components when UI page is refreshed, but none related to emulated_hue. No more logs are generated during discovery. I’ve also started doubting that alexa may not be able to reach home assistant. Is there any way I can verify that the issue is not in the alexa or my router?

I tried using Emulated WeMo just to test if that works. But unfortunately, alexa couldn’t find it too. I’ve immediately checked my router settings to see if UPnP is working properly since I think hue and wemo both works on UPnP (?). The UPnP is enabled on the router and I can even see my Plex server (which also uses UPnP) mappings on it. So I don’t think the UPnP has to do anything with it. But can there be any other setup related issue that we need to take care of? My firewall is already disabled too:

$ sudo ufw status
Status: inactive

Sorry for being greedy. I’m actually getting frustrated hearing the thing every time: https://goo.gl/qRVuux
:confounded::man_facepalming:

Didn’t know you could do it by voice, only scan read your OP, I always use the app.

The warnings in your log are perfectly normal for how you set your config. If you’re going to add emulated_hue: true to your expose specific devices, literally all you should need in the config for Alexa is…

emulated_hue:
  expose_by_default: false

As far as I’m aware all emulated_hue function is internal so upnp shouldn’t be a factor for discovery at least, nothing showing in my router log either.

Don’t think it’s relevant but have you tried removing SSL just to cross it off the list? Is the Dot definitely on the same network and subnet?

voice is the only reason i got an alexa! :smiley:

sorry @mihirgokani007 i can’t see anything wrong, looks like my config and i can start my pc via wake on lan on emulted hue over alexa by voice. :star_struck:

I did mean discovery :rofl:

Thanks for the reply! @Bobby_Nobble, I’ve tried with the minimal configuration like below:

emulated_hue:

since I want to expose everything, I didn’t write expose_by_default: false (omitting emulated_hue: true for each individual devices). But that too has the same results - nothing found! You have a valid point though. I should try removing SSL once, since it’s among the first things I configured. I’ll update the thread with results.

@loki, your configuration seems stunning! :+1:

I wish I could at least go past the step 0 :sob::sob:

Nope, no luck :expressionless:. Without SSL also everything is the same: the logs, response from description.xml, response from the api endpoints, and alexa. The URL is http:// though instead of https://.

Does anyone know how to debug this using low level tools like wireshark or something?

This has gotta be a bug, I’ve tried everything same as you, the only thing I haven’t tried is not using any groups.yaml and exposing everything selectively at a entity ID level, the max discoverable devices is 40 I believe with hue.

But that’s gonna take too much work, I have a echo show and switched from openHAB 2 to HASS.IO just so I can get HomeKit covers support. OpenHAB 2 alexa worked perfectly, and the learning curve has been steep. Alexa is the last feature before completely relocating my openHAB setup. HASS is much more powerful and flexible and overall the community supporting is waaay better then OpenHAB

I’ve tried many combinations, but still it’s not working. I guess I’m still outta luck here.

I’m still going to do a last try by getting my echo replaced and buying a new router, because these are the only components which are same from the beginning. I’ll update here about the results.

If you’ve got a spare SD card, try it with a completely clean install, config as simple as possible and add one device to see if it works. You should then know for sure if it’s something you’ve done in HA or a problem with your hardware.

It’s going to take too much work to cut and paste three words a few times?

I have a lot of zwave switches and dinners which I’ve hidden, the problem with zwave is there’s around 5 sensors and 2 switches per device.

I’ve got about 30x devices so yeah too much work.

Though I could try what you say and just add expose a wemo switch.

Just afraid of having to go and rename all my zwave again. Took ages

I was having issues with this when I tried to use emulated hue at first too. As soon as I added host_ip: to my config.yaml, it found them.

Also, it could be that by exposing all domains by default (which it does) you’re exposing more than 40 devices, which will make Alexa not able to find them.

I’d try expose_by_default: false

then in customise.yaml, add one specific device as a time with emulated_hue: true.

Your config.yaml entry would look like this:

emulated_hue:
  listen_port: 80
  host_ip: 192.168.1.213 #ip of your HA install
  expose_by_default: false
  exposed_domains:

then cusomise.yaml entry like this:
#switches

switch.powerboard:
  friendly_name: "Power Board"
  icon: mdi:power-plug
  emulated_hue: true

Then ask alexa (using your voice) to discover devices. I’ve found that asking her to do it with your voice makes it more likely that she will find them than clicking the discover devices button in the app.

Hope that helps