Setup emulated_hue with HA as Docker container

Hi,

I’m wondering if anyone is successfully running emulated_hue with HA inside a Docker container (official image).
As already stated here: https://community.home-assistant.io/t/alexa-doesnt-find-any-emulated-hue-devices - I just can’t get it working.

My configuration currently looks like this:

emulated_hue:
  type: alexa
  advertise_ip: 192.168.x.x
  advertise_port: 8300
  upnp_bind_multicast: true
  listen_port: 8300
  expose_by_default: false
  exposed_domains:
    - input_boolean

The 192.168.x.x ip is the address of the Docker host system that HA runs on.
HA itself has some 172.17.0.x address and I’m mapping the relevant ports to the host:

# docker port hass
8123/tcp -> 0.0.0.0:8123
8300/tcp -> 0.0.0.0:8300

I can access the description.xml and /api/pi/lights URLs using the host IP without any issue, but I can’t find the emulated_hue bridge (or the exposed devices) with Alexa or the Philips Hue app (as I understand it, it should at least be listed in there after a device search).

So is anyone having a working emulated_hue setup inside a Docker container?

TIA,
Sebastian

I believe you will need the container running on the host network, rather than the bridge. Hue is using broadcast behavior, which won’t get into your container.

Hm, that would certainly explain things.
Though, I’m not quite convinced yet, since in the emulated_hue docs it says:

advertise_ip (Optional): If you need to override the IP address used for UPNP discovery. (For example, using network isolation in Docker)

So, to me that sounds like that option was created with a separate container network in mind.
I have no idea though, how UPNP discovery works. It sounds like it was similar to mDNS/Bonjour/Avahi, but I might be wrong.

Sebastian

Hmm good catch, this looks pretty new. Looking at what they did.

What stands out for me is the listen and advertise ports are different, also host_ip has been set to any. I guess futz with those?

Did you get this working in the end?

I have it working find with alexa, but can’t get it working with google home.

No, I didn’t get it to work. I stopped trying because I ran out of ideas and things to try.
A few days later I sold my Echo again, because I found I had only limited use for it.
Here in Germany, about 95% of the skills for the Echo are crap (IMO) and I found the way to interact with them pretty annoying (e.g. “Alexa, ask $SKILL for $INFO” instead of “Alexa, how is $INFO”).

Sebastian

how did you get it working with alexa? i have gotten nowhere with this, it just doesn’t work no matter what options i try…

Just checking if anyone got this to work with Alexa?

I am running HA on docker, I can access the xml using the local network IP address, but Alexa just cant seem to find it.

Likewise.
Anyone get Alexa to discover this?

It’s been working for me for years now.
This is a stripped-down version of the docker-compose.yaml I’m using:

version: "3"
services:
  hass:
    image: ghcr.io/home-assistant/home-assistant:stable
    container_name: hass
    volumes:
      - '/srv/Container/hass/appdata:/config'
      - '/etc/localtime:/etc/localtime:ro'
    restart: always
    network_mode: host
    privileged: true

I have reserved a specific IP address for HA in my local network (192.168.10.8) and bound it to the host and I have set up emulated hue using this IP address.

configuration.yaml:

emulated_hue:
  advertise_ip: 192.168.10.8
  upnp_bind_multicast: true
  host_ip: 192.168.10.8
  listen_port: 80
  advertise_port: 80
  expose_by_default: false
  entities:
    switch.usb:
      name: USB
      hidden: false
    switch.monitor:
      name: Monitor
      hidden: false
[...]

As you can see, I’m only exposing a specific list of entities to emulated_hue.

Hope this helps.

Sebastian