Emulated Hue - "only local IPs allowed"


I’m new to HA. I haven’t had too many problems so far connecting zigbee and z-wave devices. I’m to the point where I want to have some of these devices controlled via Alexa (without having to pay for a monthly subscription). I have added the following to the configuration.yaml file to enable Emulated Hue.

listen_port: 8300
expose_by_default: true

When I tested the URL to see if the devices are exposed i get the following response:

{“message”: “only local IPs allowed”}

I’m currently in the local network configuring from ( and not sure whats blacklisting my IP.

I’m running a RPi 3B+ 32Bit HA with HUSBZB-1 gateway.

Any help is much appreciated.

You are using a Department of Defense ip address range at home!

You should be using one of the private address ranges. In your case, the easiest may be to change the first 11 to 10


I have the same problem and this is the only topic that comes out from searching. Mine network is and when i’ve searched on the whois db it comes out as some usa military shit again… I cannot change my whole network with a snap of my fingers and i cannot wrap my head around the connection of the private ips and networks with the public ones and even emulated_hue component???
Is there another solution or the solution is dead in the water?

looks like this is a restriction from home assistant. Debugging into the code shows that home assistant only allows the following local networks and there’s no way around it.

"""Network utilities."""
from ipaddress import IPv4Address, IPv6Address, ip_address, ip_network
from typing import Union

# IP addresses of loopback interfaces

# RFC1918 - Address allocation for Private Internets

def is_local(address: Union[IPv4Address, IPv6Address]) -> bool:
    """Check if an address is local."""
    return address in LOCAL_IPS or \
        any(address in network for network in LOCAL_NETWORKS)

EDIT: Well, home assistant in general isn’t blocking it, emulated hue is using the func is_local. Which is why you’re getting the error.

1 Like

Can something be changed so that emulated_hue accepts other networks?

Why are you using public network subnets within your LOCAL AREA NETWORK?

Because I can? :thinking: and that’s not the point. The point is, is it possible to use these network subnets within my PRIVATE network?

Sure. If you want to break apps that don’t expect you to be using non-sanctioned private subnets.

1 Like

Same here. My Home Assistant has a public IP adress in a /27 network which is assigned to my DSL line. There’s nothing wrong with this setup, but Emulated Hue refuses to use it.

Any way to change / override the is_local function without changing HA code?

EDIT: I’ve filed an issue: https://github.com/home-assistant/home-assistant/issues/30701

EDIT 2: Workaround:

  1. Create folder custom_components/emulated_hue
  2. Download all files from https://github.com/home-assistant/home-assistant/tree/dev/homeassistant/components/emulated_hue and put them into the newly created folder custom_components/emulated_hue
  3. Edit file hue_api.py and remove all IP checks - several occurrences; look for lines like these and delete them:
        if not is_local(request[KEY_REAL_IP]):
            return self.json_message("Only local IPs allowed", HTTP_UNAUTHORIZED)
  1. Save file
  2. Restart Home Assistant

The custom component overrides the build-in one.

Not a great workaround, but it works for the time being.