Amazon Alexa app fails to discover devices using Emulated_Hue integration

Perhaps I’ve missed some important concept because I thought it would be a cakewalk to setup the Emulated Hue integration. Nevertheless, despite all my efforts, attempts to discover new devices via the Alexa app result in finding none.

In configuration.yaml:

emulated_hue:
  host_ip: <MyServerIP>
  listen_port: 80
  expose_by_default: false
  entities:
    light.kitchen:
      name: "Kitchen Light"
      hidden: false
    light.family:
      name: "Family Light"
      hidden: false

Home Assistant 0.103.2 is running in a venv so I’ve executed setcap as per the documentation

sudo setcap 'cap_net_bind_service=+ep' /usr/bin/python3.7

and I confirmed the service is alive by browsing to this URL:

http://<MyServerIP>:80/api/pi/lights

It returns JSON data containing the lights I specified in configuration.yaml.

It seems to me all the needed pieces are in place. Using the Alexa app on my phone, I instruct it to discover devices (Add Device > Other > Discover Devices) and, after a 45-second wait, it returns and reports it found none.

I have a few Ecobee Switch+ devices with built-in Amazon Alexa. They have most of the capabilities of an Amazon Echo Dot. If I tell one to “Discover Devices”, it promptly replies it found none.

So where’s my mistake? Can the Alexa app be used to discover devices generated by Emulated Hue? Do I need a genuine Amazon Echo to discover devices?

From my undertsanding, let me know if im wrong.
you need at least 1 echo plus, or echo show to connect.

@Harry13 Incorrect.

@123 Unless something has changed, you’ll need at least a 2nd gen Echo Dot.

OK, there’s one en route to our home (part of a promotional deal with SiriusXM) and should be here in a day or two. It’s a gen 3 Echo Dot and I’ll give it a try when it arrives.

The Echo Dot hasn’t arrived yet but I have a question:

How does the presence of the Echo Dot change how Emulated Hue is discovered?

To put it another way, if my phone’s Alexa app currently fails to discover Emulated Hue, how will the presence of an Echo Dot help it?

Echo Dot arrived this morning and is now connected and working. I’m not sure how its presence changes the dynamics of the discovery process but, after asking it to Discover Devices, it found the entities I added via Emulated Hue. That’s a huge step forward and implies the Alexa-enabled Ecobee Switch+ devices lack something needed to perform the same task.

On to a new problem. The Emulated Hue devices can be controlled (either by voice or the Alexa app) but they appear to report their status a little too slowly.

  • If I ask to have a light turned on, the physical light turns on promptly, but Alexa immediately states there is a problem with the device.
  • If I repeat the procedure using the app, I see that the “problem” is because it isn’t getting a prompt status response from the Emulated Hue integration. The app shows “Device Malfunction”. A few seconds later (2-3 seconds), the message disappears and the device’s correct new status is displayed.

So there’s a delay before the new status is received and that is reported as “Device Malfunction”. Has anyone else seen this behavior? Is there anything I can do to fix it?

Hey, you’re finding the reasons why I moved to the smart home skill 5 months back!

EDIT: Just as a side note, emulatedhue was broken for a long time. During that time, i switched to the smarthome skill (Which is 1000x better btw). Since then, it’s been fixed according to other users. Just make sure you are using a new version of HA and you shouldn’t have issues.

The node-red alexa control works great.
DrZz’s & Rob from The Hookup did a video on it.

My HA server is not exposed to the Internet, so I have a bunch of prerequisites to complete before I can even start implementing Amazon Alexa Smart Home Skill. I was hoping to avoid all of that work by using Emulated Hue, especially since all I want is to just turn a few things on/off.

Basically, Emulated Hue works but with a lousy ‘customer experience’. If I say:

“Turn on Kitchen Light”

the kitchen light turns on promptly but Alexa reports:

“Sorry, kitchen light appears to be malfunctioning.”

:poop:

There’s more than one available; which one are you recommending?

Before Emulated Hue, I tried node-red-contrib-amazon-echo. I had it installed but my Alexa app could not discover it (in retrospect, for the same reason Emulated Hue failed to be discovered; I didn’t have a real Echo or Dot available at the time).

When I realized node-red-contrib-amazon-echo does the same thing as Emulated Hue (pretends to be a Philips Hue hub) I uninstalled it. It’s less work to configure Emulated Hue (although the final result has been sub-optimal). I may try switching back to node-red-contrib-amazon-echo and see if it works any better.

Yeah but you do have more control with what happens

Can you elaborate?

Sadly, node-red-contrib-amazon-echo has proven to be a disappointing experience.

  1. I commented out the Emulated Hue integration and restarted Home Assistant.
  2. I used the Alexa app to delete all the devices it had found via Emulated Hue.
  3. Using node-red-contrib-amazon-echo, I created and deployed a simple flow containing one echo hub and two devices.
  4. I checked http://<Node-Red-ServerIP>:80/api/pi/lights and confirmed the displayed JSON contained the two devices.
  5. I asked the Echo Dot to discover devices and it found the two I had defined in the flow.
  6. I asked the Echo Dot to turn on one of the two devices and it replied OK. The Alexa app showed the device had been turned on.

Encouraged by these results, I proceeded to do the following:

  1. I added seven more devices plus logic to publish MQTT messages (to control the real devices). I deployed the flow.
  2. I asked the Echo Dot to discover devices again. It found no additional devices (i.e. it failed to find the seven I added).
  3. I used the Alexa app to delete the two devices it originally found.
  4. I asked the Echo Dot to discover devices again. It found the same two devices again (and not the other seven I added).
  5. I used the Alexa app to delete the two devices it found.
  6. I also deleted those two devices from the Node-Red flow (and deployed it).
  7. I checked http://<Node-Red-ServerIP>:80/api/pi/lights and confirmed it displayed JSON containing the seven new devices (and not the two I had deleted).
  8. I used the Alex app to discover devices. It found the two devices that I had deleted from the flow and nothing else. (???)

It’s behaving like it cached the data it found during the very first discovery and now retrieves it every time it performs a discovery.

Anyone have any ideas on how to sort out this mess?


EDIT
I deleted the echo hub from the flow, added a fresh one, configured it, and deployed the flow. I hoped this would cause something somewhere to reset itself but it did not. The Echo Dot continues to discover only the two devices that no longer exist in the flow.

You gotta delete the devices using the web app for Alexa. Then you have to restart 9 gazillion times. Alexa has caching issues.

3 Likes

Just when I thought I would need to stoop to burnt offerings, I tried your suggestion to “restart 9 gazillion times”. Well, just once; it was the one thing I had not tried yet (power-cycle the Echo Dot).

I would imagine that “Discover Devices” behaves the same way if you use:

  1. the Alexa app (phone)
  2. a voice command
  3. the web app

I had tried the first two but not the third, so this time I used the web app to discover devices … but only after I had powered off the Echo Dot for several minutes.

  • I added several more devices (total of 19) to the Node-Red flow.
  • Powered up the Echo Dot.
  • Used the web app to discover devices.

This time it reported 21 devices, the 19 new ones I just defined plus the 2 that had been deleted yesterday … so it still had them cached despite having been deleted using the Alexa app (on my phone). The two cached devices were marked as ‘unavailable’ (or something like that).

  • I used the web app to “Forget” the two devices.
  • I returned to the Node-Red flow and added the two devices to make a total of 21.
  • I used the web app to discover devices.
  • It found the two devices I just added (and their status was normal).

Long story short, although the power-cycling didn’t flush the two cached devices (suggesting they are probably cached in Amazon’s cloud and not the Dot), everything else seems to be behaving correctly now.

Using the web app to “Discover Devices” did allow it to discover all the devices I added (which it failed to do in yesterday’s tests). It’s hard to pinpoint the actual solution here but it appears I’m getting better results using the web app (as strange as that may sound). Or the Echo dot needed to be power-cycled. Or both. :man_shrugging:

I asked Alexa to turn on/off several lights, setting their brightness, etc. It promptly responds “OK” and the action is performed. Success, finally.


The one thing that node-red-contrib-amazon-echo does not do (which Emulated Hue does) is support switches. Everything is a dimmer whereas in Emulated Hue you can define on/off devices. In practice, it means you can ask Alexa to set brightness for a device that doesn’t support brightness … and she will cheerfully respond “OK” as opposed to something like “I can’t find a way to do that”.

For example, I can say “Set furnace fan to 50” and Alexa will reply “OK” and the furnace fan is turned on. Similarly, we have a fountain and Alexa has no trouble accepting “Set fountain to 75”.

Owing to the flow’s logic I’ve created, it ignores the received brightness level and simply turns on the furnace fan (or fountain). However, the end-user is misled to believe the furnace fan, or fountain, can support more than just on/off. It’s not a deal-breaker but something to keep in mind (especially when designing the flow’s logic).

1 Like

I am able to add node-red-contrib-amazon-echo with my echo dot. Added Echo hub and one echo device. Alexa discovered it and I linked to a light. When I say “turn on light”, light turned on but echo dot said “I’m not quite sure what went wrong”. say “turn off light”, same.

until I saw this post and restart echo dot, now she happily says “ok”.

magic.

questions:
does it only support light?
how to pass other information to call service to light, such as color and brightness?

thanks.

node-red-contrib-amazon-echo emulates a Philips Hue Hub. Therefore all devices the Echo discovers from this node will be represented as lights.

  • Turn on Kitchen Light.
  • Set Kitchen Light to 50.
  • Turn Kitchen Light red.

Should clarify that is ‘gen 1 hue emulation’. Which at the time, only supported lights. Therefor, emulation will only support lights.

got it. we can add as many of devices as we want and use them to control various things supported in node-red/hass.

Yes. I’ve defined 22 items. Each item controls a physical device via MQTT. Therefore each one of the 22 items has a unique MQTT topic that controls its associated physical device.

For example the first light’s topic is something like this:

premise/command/home/kitchenlight/brightness

whereas a switch’s topic looks something like this:

premise/command/home/kitchenfan/powerstate

All items feed into one of two function nodes (one is for dimmable lights and the other is for on/off switches) to convert the payload into a required format before transmitting the message to MQTT.

Although I chose to use MQTT, it could have also been done using node-red-contrib-homeassistant-websocket and its Call Service node.