Can we do a sanity check on the basics? I have the exact same problem while my api/pi/lights and description.xml work fine, but discovery via app or echo or alexa.amazon.com turns up empty. I was thinking Gen3 Echos are probably the culprit, but @Antasp3136 has a Gen1.
So:
1- i have only one skill in the Smart Home tab enabled for “Hue”, that’s for my physical Hue bridge
2- when using alexa to search for devices she asks if i have the Smart Home skill enabled. What is “THE” smart home skill? There are thousands including the Nabucasa one. Is that in any way relevant?
3- She also says if it is hue i shall press the button, but naturally there is no button to press for emulated Hue
4- is it possible that the component is just outdated and newer discovery just plain doesn’t work while in older versions discovered devices simply work because they are already stored in the devices?
You shouldn’t have any smarthome skills (unless you are running something else) Nevermind I didn’t fully read your sentence.
There is no smarthome skill. This is a built in process to alexa’s discovery.
Correct. No button, it’s ‘on’ at all times.
I don’t believe so. I’m starting to think that these RGB values that were added are causing discovery issues. I’m not willing to perform a discovery myself if it doesn’t work as I don’t want to lose my stuff.
So, if you guys could try this:
create a custom component using an older version of emulated hue. Use this version:
If discovery works then we know there is an issue with the current version and discovery.
I think i have a partial success. While looking at your suggestion i saw a upnp.py and wondered if I have that enabled. And yes, I needed to enable UPnP on my router, apparently the echo uses that for discovery. I’d rather have it disabled, and all other devices where discovered without it, but hey… progress.
Now, after trying to actually do something with one of my switches i get a traceback with:
File “/srv/homeassistant/lib/python3.7/site-packages/aiohttp/web_protocol.py”, line 418, in start
resp = await task
File “/srv/homeassistant/lib/python3.7/site-packages/aiohttp/web_app.py”, line 458, in _handle
resp = await handler(request)
File “/srv/homeassistant/lib/python3.7/site-packages/aiohttp/web_middlewares.py”, line 119, in impl
return await handler(request)
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/http/real_ip.py”, line 33, in real_ip_middleware
return await handler(request)
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/http/view.py”, line 112, in handle
result = handler(request, **request.match_info)
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/emulated_hue/hue_api.py”, line 172, in get
entity = hass.states.get(entity_id)
File “/srv/homeassistant/lib/python3.7/site-packages/homeassistant/core.py”, line 838, in get
return self._states.get(entity_id.lower())
AttributeError: ‘NoneType’ object has no attribute ‘lower’
Without being able to read anything into that error, my guess would be a wrongly interpreted light command to me. I was trying to tell alexa: “turn discovered switch name off”
I’m willing to bet that the old version will work. Which means you are running into an issue that you and one other guy has. For some reason your instances don’t return entity_ids. If you’re willing to test, I can make some versions to debug what is going on in your system. This might take a few weeks though as only you can test it.
Sure I’ll test it. Not sure if I’m knowledgeable enough to do so. There are twothreads with that error concerning hue emulation that are older than the code you linked above, though.
#edit: That is a funny way of testing. Talking to the device Again, without being able to read python alexa now does the switch on(!) command and follows it immediately up with “The value is out of the limits for the device mydevice” (i’m translating, it might be a bit different in english) and turns it off. So, i think it identifies the device in some way, but throws around weird values that then cause it to revert?
Interesting… But many people have had this issue. Basically we would need to make a version that plops information into debug logs to see what alexa is sending to HA.
Two tasmotas and a couple of command line switches. I wanted to go away from the wemo emulation by using the hue_emulation. So platform mqtt and command line.
Hi, all. I’m having the same issue. Both my description.xml and api/pi/lights.xml both return values but my alexa echo won’t discover devices. I have two lights and a motion sensor, currently, so well below the limit.
I’m running hass.io on a raspberry pi 3. Any thoughts would be appreciated.
Thats odd… ive never had upnp enabled on my unifi system and never had an issue. I just tried to enable it and it does not seem to have solved the issues. Turning it back off now…
Well, i guess the Echos have redundant discovery systems. Mine discovered things just fine without UPnP but didn’t start to discover hue_emulation devices until i enabled it. Since i don’t know how to troubleshoot Alexa’s discovery i’m afraid it’s only a guessing game. UPnP seems only needed for discovery btw, i disabled it again just now and all devices stay in their … well weird quantum on and immediately off state
@petro I’m 90% there i think. Instead of a custom component I have replaced hue_api.py directly in /srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/emulated_hue. Any other combination did throw errors with requirements that i’m not able to troubleshoot. Now the situation is that alexa successfully executes the commands on and off. Only she complains that “device doesn’t answer, please check the power state on the device”. I guess she expects a state information that she doesn’t get. When i do a diff of the old and new hue_api.py i see mostly “brightness” related differences, so that may be the problem?
@Antasp3136 ntasp3136 One thing i forgot. I could not discover anything by telling alexa to discover devices. She always responded with no devices found after the 20s scanning period. Same with the app on my iphone. What worked (with upnp enabled) was going to https://alexa.amazon.de/spa/index.html#smart-home and hitting the discover button at the bottom. Maybe that “enforces” UPnP search? Worth a try maybe.
Yes, the one you linked above. Specifically this file. I remember the voice message about “please check the power of the device” happening to an emulated wemo device as well if that helps.
It sounds like this might be an issue with your devices not reporting a change.
Alexa will perform a put followed by a get. If the results from the put are not in the get, alexa will audibly say “device isn’t responding blah blah blah”
Hm, my command line sensors mostly don’t give any return value. About the Tasmotas, but i’m tracking their status just fine with mqtt, so at least hass should know their status. Is there a way to just tell alexa to not care about the state? I remember her asking “is device on?” and she replied with “That device doesn’t support that function”