Emulated Hue with Amazon Echo (Dot) - Selective Exposure [SOLVED]

Hi,

I’m having problems with the emulated_hue component and Hass.io (I’m running the latest version, 0.52.0).

Using the following in configuration.yaml, works:

emulated_hue:
host_ip: 192.168.0.20
listen_port: 8300

http://192.168.0.20:8300/description.xml renders correctly.
I can see all entities advertised at http://192.168.0.20:8300/api/pi/lights.

The Amazon Alexa app can see all these devices (I’ve since ‘forgotten’ them, to remove them).

However, I don’t want all entities advertised. I just want to use it to turn my TV on and off (which HomeAssistant can do). So I tried the following to advertise the media_player domain only:

emulated_hue:
  host_ip: 192.168.0.20
  listen_port: 8300
  expose_by_default: false
  exposed_domains:
    - media_player

However, this doesn’t advertise anything. http://192.168.0.20:8300/api/pi/lights just returns an empty JSON string.

Any ideas?

Thanks,

Robin

Use emulated_hue: false

in customize. yaml for all the entity_id you do not want

You won’t get anything that way because you set expose to false. The exposed domains option only limits it if it’s true.

Leave it as false, delete the domains and add emulated_hue: true to the individual ones you want exposed in customize.yaml.

1 Like

or in config.yaml under customize:

customize:
  light.livingroom:
    emulated_hue: false

i think i made it like this.

Thanks for the replies everyone. I feel as though the documentation is unclear on this; I have set “expose_by_default” to false - the key part here being “by default”. It’s not a setting simply called “expose”.

To me (and I suspect others) this suggests that nothing would be exposed “by default” but then you could override this by then manually choosing to expose a domain with the “expose_domain” option. Surely a default setting is something that can be set to begin with, with the option to alter it afterwards?

@Bobby_Nobble I tried what you suggested, by leaving “expose_by_default” as false and creating a new entry like so (using a 2-space indentation for customize, as required):

 customize:
  media_player.samsung_tv_remote:
    emulated_hue: true
    emulated_hue_name: "tv"

… unfortunately checking the configuration before rebooting results in the error:

Failed config
emulated_hue:
customize: [source /config/configuration.yaml:113]
media_player.samsung_tv_remote: [source /config/configuration.yaml:114]
emulated_hue: True
emulated_hue_name: tv
expose_by_default: False
host_ip: 192.168.0.20
listen_port: 8300

General Errors:
- Setup failed for emulated_hue: Invalid config.

Successful config (partial)
emulated_hue:

I’m really hoping that the other suggestions aren’t the only way to do this. It seems rather backwards to have a setting that exposes everything, and then you have to write an entry for every single entity to hide them.

Ah, problem solved. Thank you @Bobby_Nobble

The following must be at the top and indented, within the “homeassistant:” section. In a default configuration.yaml, this is before the “introduction:” section starts:

  customize:
    media_player.samsung_tv_remote:
      emulated_hue: true
      emulated_hue_name: "tv"

You can then use the following, without indentation, anywhere in the configuration.yaml and this will hide everything except for the above entity:

emulated_hue:
  host_ip: 192.168.0.20
  listen_port: 8300
  expose_by_default: false
1 Like

No probs, glad to hear you got it sorted.

Bad spacing is so easily done, been there many times. Using an editor that shows them makes life much easier.

Indeed, especially with yaml! I use Notepad++ / VS Code, but my issue was that I’d (quite stupidly) put the customize block in the wrong part of the file :slight_smile: