Emulated Hue Issue- Trying to change setting

2019-04-22 16:25:48 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not exposed: switch.nodemcu_01

I’ve tried everything I can think of and I keep having this show up. It just keeps trying and trying over and over. Under emulated hue I tried to have this entity hidden, but it still shows up. What is the proper way in your opinion to reset. Like with Homekit I can just remove home or delete the file. Anything like this for Amazon devices? Like a way to start fresh.

It seems like once the entities are in there it’s impossibly for Home Assistant to not search for them. Like there is a residual. Or am I missing something?

2019-04-22 16:25:48 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not exposed: switch.nodemcu_01
2019-04-22 16:25:58 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not exposed: switch.nodemcu_01
2019-04-22 16:26:22 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not exposed: switch.nodemcu_01
2019-04-22 16:26:41 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not exposed: switch.sonoff_01
2019-04-22 16:26:54 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not exposed: switch.sonoff_01
2019-04-22 16:27:01 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not exposed: switch.sonoff_01
2019-04-22 16:27:15 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not exposed: switch.sonoff_01
2019-04-22 16:27:58 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not exposed: switch.nodemcu_01
2019-04-22 16:28:11 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not exposed: switch.sonoff_01
2019-04-22 16:30:12 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not exposed: switch.sonoff_wall_switch_02
2019-04-22 16:30:20 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not exposed: switch.sonoff_wall_switch_02
2019-04-22 16:30:26 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not exposed: switch.sonoff_wall_switch_02
2019-04-22 16:30:48 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not exposed: switch.sonoff_wall_switch_02
2019-04-22 16:31:55 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not exposed: switch.sonoff_01
2019-04-22 16:32:16 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not exposed: switch.sonoff_wall_switch_02
2019-04-22 16:34:22 ERROR (MainThread) [homeassistant.components.emulated_hue.hue_api] Entity not exposed: switch.nodemcu_01

Just an endless loop of errors.

As I said…

Mon Apr 22 2019 17:04:15 GMT-0700 (Pacific Daylight Time)
Error handling request
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py”, line 418, in start
resp = await task
File “/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py”, line 458, in _handle
resp = await handler(request)
File “/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py”, line 119, in impl
return await handler(request)
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/http/real_ip.py”, line 33, in real_ip_middleware
return await handler(request)
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/http/view.py”, line 112, in handle
result = handler(request, **request.match_info)
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/emulated_hue/hue_api.py”, line 172, in get
entity = hass.states.get(entity_id)
File “/usr/local/lib/python3.7/site-packages/homeassistant/core.py”, line 829, in get
return self._states.get(entity_id.lower())
AttributeError: ‘NoneType’ object has no attribute ‘lower’

I deleted everything in alexa and kept getting cant discover on all devices now.

Ok so I deleted type: alexa as per wiki page.and I get the error above.

Here is my .yaml

#  type: alexa
  host_ip: 192.168.1.20
  listen_port: 80
  off_maps_to_on_domains:
  expose_by_default: false
#  exposed_domains:
#
#    - light
#    - switch
#    - input_boolean
#    - fan
#    - cover
#    - alarm_control_panel
    
  entities:
  
#    switch.sonoff_01:
#      hidden: true
#    switch.sonoff_wall_switch_02:
#      hidden: true 
#    switch.nodemcu_01:
#      hidden: true
      
      
      
    cover.garage_door:
      name: "Garage Door"
    light.homeseer_hswd100_wall_dimmer_level:
      name: "Living Room Light" 
    light.homeseer_hswd100_wall_dimmer_level_2:
      name: "Kitchen Light"
    light.homeseer_hswd100_wall_dimmer_level_3:
      name: "Kitchen Table"

Any other ideas what I’m messing up here? It’s getting so frustrating becuase I just want to set expose by default to false and add my own entities. I am approaching more than 45 now.

OMG it was the port. I just changed the port and all is well!!

Sorry about all of this.

Hello,
I’m having the same problem. I want to “reset” all the Alexa devices and start fresh, but when I discover again, I get all the old devices. I’ve tried EVERYTHING except the correct one…
So, I have about 38 devices and a few groups. Z-wave lights, TP-link switches and such. After the Echo update things went crazy, I changed the emulated_hue to port 80, removed all devices and re-discovered on the alexa.amazon.com website and it worked, but gave the “this device appears not to be working” but worked. The wife started to complain, so I decided to fix it… Deleted the emulated_hue_id.yaml file - then re-discover the devices. At first I was getting 3-4 copies of each. I’ve tried different hue ports, I do a reboot of the Pi, not just a service restart - but it seems Hassio has a cache of the emulated_hue_id file in components/emulated_hue/hue_api.py - where ever that is. I do not know much about Docker but that it is like little VMs. I looked for it…
Anyway, I have set the emulated_hue in the config file to exposed_by_default: false
Here is my config - I have tried to setup one of the z-wave

emulated_hue:
  host_ip: 192.168.1.23
  listen_port: 80
  off_maps_to_on_domains:
    - scene
    - script
  expose_by_default: false
#  exposed_domains:
#   - light
#    - switch
#   - group
  entities:
    light.jims_den_lamp_level:
      name: "Jims Lamp"
      hidden: false

Here is a sample of the error log I get, after deleting the emulated_hue_ids file.
Unknown entity number: 12 not found in emulated_hue_ids.json
5:43 PM components/emulated_hue/hue_api.py (ERROR) - message first occured at 5:31 PM and shows up 24 times

It shows 38 or so devices, why doesn’t it clear, and how can I reset it.

Thanks for reading!
jim

A piece of advice. Delete each device individually in the Amazon Alexa UI and run Discover again. Your actual valid devices should show up.

Thanks PeteA that did work and only 1 of the devices showed up. But the problems continued. I read it’s the bridge listing all the devices as lights and need a dim setting or it craps out.
Anyway, it’s a losing battle. emulated_hue in HA is pretty much dead. I went ahead and moved to the HA cloud thing, works great and took a few minutes to setup. I already used the Alexa script tools, have to open a port, but will continue it to use it for my sensors.
It will cost $5 a month, oh well, another thing to pay for. I’m glad the HA guys might make a little money, I’ve been using there tech for free for years, they deserve it.
I don’t like the fact that I can’t run the z-wave and IP switches local. I will have to work on that, but until then, the wife is happy and the lights work!!
thx

Search the forum a bit more. I think I saw a solution that may work that doesn’t involve a subscription. The Hue emulator is a bit of a mess at the moment though.

Have a look at this Emulated Hue suddenly stopped working with Echo Dot V2

Does somebody have a solution to reduce the number of exposed entities? If I set it to exposed by default false it does not expose ANY. How are we supposed to change the configuration ?

by following the direction and exposing what you want to expose…

taking a look at the provided example:

# Example configuration.yaml entry
emulated_hue:
  host_ip: 192.168.1.186
  listen_port: 8300
  advertise_ip: 10.0.0.10
  advertise_port: 8080
  off_maps_to_on_domains:
    - script
    - scene
  expose_by_default: true
  exposed_domains:
    - light
  entities:
    light.bedroom_light:
      name: "Bedside Lamp"
    light.ceiling_lights:
      hidden: true #<------ THIS WILL HIDE/UNHIDE

1 Like

I appreciate your answer.
Do you mean that I can not do it the other way around?
I tried setting expose_by_default to false and specified the entities. But this leads to an empty entities list.
Is hiding the only way of changing the behavior? Once you setup emulated_hue once there is no way back to choose a different strategy?

expose_by_default: false
exposed_domains:
- light
entities:
  light.bedroom_light:
    hidden: false

to get just light.bedroom_light

Again, thank you. Here is my actual configuration:

host_ip: 192.168.0.12
listen_port: 80
expose_by_default: false
exposed_domains:
  - input_boolean
  - switch
entities:
  switch.xperia_video_recording:
    name: graba sotano
  switch.xperia_torch:
    name: xperia torch
  input_boolean.camera_hall:
    name: camera hall
  switch.sonoff_relay:
    name: sonoff

That configuration led me to several warnings on my log about the entities not being exposed and the /api/pi/lights to return an empty value.
As I said before, I started with a simple configuration like this:

host_ip: 192.168.0.12
listen_port: 80
expose_by_default: true
exposed_domains:
  - input_boolean
  - switch
  - lights

And now I want to restrict it

So add hidden: false for each one under name.

Ok, I’ll try that and report

Hey! that worked! thank you very much

1 Like

Thank you for this… this was my third attempt to try to get only few lights and switches to show on my harmony hub. I spent way too much time it should be part of the documentation for anyone trying to set up emulated hue on HA.

my working config…

emulated_hue:
  host_ip: 192.168.1.XX
  listen_port: 8300
  off_maps_to_on_domains:
    - script
    - scene
  expose_by_default: false
  exposed_domains:
    - light
    - switch
    - input_boolean
  entities:
    light.88568006cc50e34432eb:
      name: "Theater Wall Scones"
      hidden: false
    switch.theater_room_pots:
      name: "Theater Lights"
      hidden: false
    switch.bar_cabinets:
      name: "Bar Cabinets"
      hidden: false
    switch.bar_light:
      name: "Bar Light"
      hidden: false
    switch.basement_loft:
      name: "Basement Loft"
      hidden: false
    switch.basement_stair:
      name: "Basement Stairs"
      hidden: false

I have two homes with near identical HA configurations. Both are doing what I am about to describe.

I added some color bulbs to my lamps and created a group then in emulated hue I replace the original light.xxx entity to a group.xxx entity. rebooted but alexa still controls the original bulb and not the new group. I deleted the emulated.hue.json.id file and again rebooted, same result. I then deleted all my alexa devices manually in the alexa app one by one, deleted the json.id file again, did a cold hard reboot (by removing power from HA). and re-discovered my devices. Again the original bulb is being controlled and not my new group. I have another group in emulated hue which is working so I know I have the visibility settings ok. Why will it not change to my new device? I really don’t want to call it something else as the wf is used to how things work. Thankx for any advise in advance. J

PS, I have updated to the latest and greatest release as of 2/2/21 (both core and op-sys, using ras-pi HASS canned load)