Hi Folks, as so many others have, I am battling the emulated_hue for Alexa feature. I have read countless threads and spent quite a bit of time troubleshooting before posting here.
I initially added the emulated Hue a few days ago so that we could use Alexa voice commands to turn on/off our lights. Everything went smooth and worked fairly quickly.
THEN… I changed a device on my HA side, and or, deleted a device from Alexa. Everything went down hill quickly from here.
First of all, many threads talk about the …/config/.storage/emulated_hue.ids file, and many threads repeat the theme of “I cannot find it” yet very few actually say this is because the .storage directory is hidden by default and must be un-hidden. Man, that alone could have saved me and many others some time!
I am at a point now where I have deleted all of my emulated hue devices from my Alexa and I cannot for the life of me get back on track to rediscover them. Here is what I have, or have done:
I have deleted the /.storage/emulated_hue.ids file. When I do an Alexa discover, a new and what appears to be correct file is generated. Here is a look at the content:
{
"version": "1",
"minor_version": 1,
"key": "emulated_hue.ids",
"data": {
"1": "light.island_lights",
"2": "light.counter_lights",
"3": "light.desk_lamp",
"4": "light.marks_bedside_light",
"5": "light.mollys_bedside_light",
"6": "light.top_of_stairs_lamp",
"7": "switch.closet_light",
"8": "switch.garage_lights",
"9": "switch.patio_rope_lights",
"10": "climate.fireplace_livingroom"
}
}
My configuration.yaml content is the same as when I originally set it up, and it was working:
emulated_hue:
host_ip: 192.168.0.34
listen_port: 80
expose_by_default: false
exposed_domains:
- light
- switch
- climate
entities:
light.island_lights:
name: "island lights"
hidden: false
light.counter_lights:
name: "counter lights"
hidden: false
light.desk_lamp:
name: "desk lamp"
hidden: false
light.marks_bedside_light:
name: "marks bedside light"
hidden: false
light.mollys_bedside_light:
name: "mollys bedside light"
hidden: false
light.top_of_stairs_lamp:
name: "top of stairs lamp"
hidden: false
switch.closet_light:
name: "closet light"
hidden: false
switch.garage_lights:
name: "garage light"
hidden: false
switch.patio_rope_lights:
name: "patio rope light"
hidden: false
climate.fireplace_livingroom:
name: "livingroom fireplace"
hidden: false
climate.fireplace_basement:
name: "basement fireplace"
hidden: false
When I try to load the URL- http://<My_IP>:80/api/pi/lights, this returns a server error 500
When I load http://<My_IP>:80/description.xml it appears to return a valid response of:
This XML file does not appear to have any style information associated with it. The document tree is shown below.
1
0
http://192.168.0.34:80/
urn:schemas-upnp-org:device:Basic:1
Home Assistant Bridge (192.168.0.34)
Royal Philips Electronics
http://www.philips.com
Philips hue Personal Wireless Lighting
Philips hue bridge 2015
BSB002
http://www.meethue.com
001788FFFE23BFC2
uuid:2f402f80-da50-11e1-9b23-001788255acc
I have repeatedly deleted the emulated_hue.ids file, rebooted my Pi, cleared all devices in Alexa and even opened my Amazon account and deleted my smart home device history.
I saw a comment about adding the Integration for UpNP so I added that and it appears to see my google mesh router and report traffic ok.
Next, I unplugged all my Echo Dots (I think they are gen 2 or 3) except for one which I factory reset, and unplugged all my Sonos ONE’s which have alexa enabled, then repeated all the steps above, clearing everything. Then plugged in the one Alexa dot I factory reset. When I set it back up, it did remember it’s name (garage echo) but I definitely factory reset the device.
From here, I did a discover and it still does not find any of these emulated Hue lights. I am using the discover Hue V1 round device option, the same as I did when it initially worked.
I see some log file errors related to this but do not know how to interpret them:
Log Details (ERROR)
Logger: aiohttp.server
Source: components/emulated_hue/hue_api.py:673
First occurred: 1:51:25 PM (12 occurrences)
Last logged: 2:02:43 PM
Error handling request
Traceback (most recent call last):
File “/usr/local/lib/python3.10/site-packages/aiohttp/web_protocol.py”, line 435, in _handle_request
resp = await request_handler(request)
File “/usr/local/lib/python3.10/site-packages/aiohttp/web_app.py”, line 504, in _handle
resp = await handler(request)
File “/usr/src/homeassistant/homeassistant/components/http/view.py”, line 133, in handle
result = handler(request, **request.match_info)
File “/usr/src/homeassistant/homeassistant/components/emulated_hue/hue_api.py”, line 221, in get
return self.json(create_list_of_entities(self.config, request))
File “/usr/src/homeassistant/homeassistant/components/emulated_hue/hue_api.py”, line 845, in create_list_of_entities
json_response: dict[str, Any] = {
File “/usr/src/homeassistant/homeassistant/components/emulated_hue/hue_api.py”, line 846, in
config.entity_id_to_number(state.entity_id): state_to_json(config, state)
File “/usr/src/homeassistant/homeassistant/components/emulated_hue/hue_api.py”, line 736, in state_to_json
state_dict = get_entity_state_dict(config, state)
Any suggestions on what the issue(s) or resolution would be are appreciated. Thanks.