Working on multiple emulated_hue instances

Does it matter, mine just have logical names?

Despite the current craze for the Google component, I’m still finding emulated_hue the best solution for my needs, mainly down to the desire to use it with my Harmony set up and it’s stupidly simple set up, but the phone use with Assistant is a draw.

Based on that I revisited accessing Alexa from my phone and was very pleased to find the improvements made to the Reverb app since I last looked at it many moons ago. Apart form the hotword detection, which I’m not bothered about, it now has a nifty little 1x1 widget that just works with a single touch without anything else opening and you get proper Alexa acknowledgements back.

I walked around the block to make sure it was happy outside my LAN and all is good. You need the Amazon app installed to set it up but can delete it once you have which means I’ve also set it up on the families phones for all to use with the same login. Works virtually instantaneously as opposed to waiting an age for the HA front end to update. Voice control of my HA devices anywhere in the world without any need to jump though hoops or SSL. One very happy chappy :grin:

It is because of the new Smart Group feature in Alexa app. Right now, if I created a new Group call “Living Room” and added my Echo in Living Room into that group together with some switches in the living room such as…

  1. Living room lights
  2. Living room fans
  3. Living room TV
  4. Living room aircond

…when I say this to the living room Echo, “Alexa, turn on the lights”, it will turn on every lights, fans, TV and aircond in the living room instead of just the lights. I believe this is due to Alexa treats every devices exposed by emulated hue as light.

yes exactly.

I hope they will implement this.

Logical products: LIGHTS, FAN, TV, AIRCO, etc…

Echo or Google Home IN Living room and making the following group

Living room (the room)
Living room lights
Living room fans
Living room TV
Living room aircond

turn on lights will turn only lights in living room
turn on fans will turn on only fan in living room
turn on tv will turn on only tv in living room

and so on

The obvious answer would be call them something different eg lamps or maybe try lighting but probably too close to lights.

Yes, emulated_hue makes a device to look like a Hue light, kind of the whole point :slight_smile:

Have you tried the new smart home group in Alexa? If not, please give it a try and you will understand what I meant. The new feature is really useful for user with multiple dots in multiple rooms with multiple occupants. Everyone does not have to remember the unique name of each devices. They can naturally address each components as lights, fans, TV, aircond, etc…

Haven’t as I currently have no use for it, one Dot and multiple phones.

Are you saying you have to call them lights?

Yes. If u have a dot in every rooms, u can set it so that when u say “turn on lights” to let say a Dot in your kitchen, it will just turn on lights in your kitchen. If you say the same to your office, it will turn on lights in your office. No more “turn on kitchen lights” or “turn on office lights”.

Unfortunately with emulated hue, it just works with lights. I wish it can work with other type of devices such as fans, TV, Aircon, etc…

Hmm…that’s a bit average. Is it possible to use the traditional style groups in Alexa and then assign them to the new style ones?

Anyone has any problem using this with the latest version of HA?

Yep, something’s borked it. I know they’ve made a couple of changes recently but they obviously don’t apply as we’re overriding with the custom component.

My guess is the move to a newer version of Python?

I’ll take a look to see what the differences are with the new HA.

1 Like

I looked at the logs and found that there was a specific issue. The HomeAssistantWSGI class no longer has a parameter for the constructor called ‘development’. I removed this parameter from the list of parameters and emulated_hue was able to run.

I updated the repo. Try it out and let me know how it goes.

While you are at it, is it possible for you include this feature request?..

I don’t have a good protocol specification. The current value for the type is “Dimmable light”. I’ve tried just replacing the string with switch, thermo, etc. And Alexa doesn’t seem to recognize it.

I see, thanks for trying this out anyway.

By the way, I notice the official component is now using emulated_hue_hidden: false instead of emulated_hue: true in the customize section. Is it possible to follow the official version for consistency?

Sure - I’ll look into that some time this week/weekend.

2 Likes

Instead of switch can you try
eWelink WiFi Device

(i put the correct caps

Fantastic, thank you so much. Too many threads discussing the same thing :slight_smile:

Updated to 58.0 today, and now receiving this error.

Error during setup of component emulated_hue
Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/setup.py", line 193, in _async_setup_component
    component.setup, hass, processed_config)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/home/homeassistant/.homeassistant/custom_components/emulated_hue/__init__.py", line 99, in setup
    is_ban_enabled=False
TypeError: __init__() got an unexpected keyword argument 'development'

So, commented out the below line in init.py and the error has gone. # development=False

def setup(hass, config):
    """Activate the emulated_hue component."""
    hue_list = []

    for hue_name, conf in config[DOMAIN].items():

        _LOGGER.info("emulated hue {}".format(hue_name))

        config = Config(hass, conf, hue_name)
        server = HomeAssistantWSGI(
            hass,
           # development=False,
            server_host=config.host_ip_addr,
            server_port=config.listen_port,
            api_password=None,
            ssl_certificate=None,
            ssl_key=None,
            cors_origins=None,
            use_x_forwarded_for=False,
            trusted_networks=[],
            login_threshold=0,
            is_ban_enabled=False
        )
1 Like

Has anyone tried this multiple emulated hue functionality on any recent version of HA? I couldn’t get the basic setup as shown on the github to show anything in http://localhost:8301/description.xml or on port 8302. Using the regular emulated_hue it does work on port 8300. I am running HA in a Docker container and i just mapped the location of the emulated_hue component to /usr/src/app/homeassistant/components/emulated_hue and it replaces the files so before I debug further I wanted to know if anyone actually uses this anymore.

I am right at the 49 device limit and could drop 4 of my light groups I exposed to Alexa to stay under but I really want to get this working so I can continue expanding. I’ve not looked into the HA cloud and did get a single skill to work when I created an Amazon developer account. It is much more cumbersome though to say “alexa tell home assistant to turn on cooking time” to turn all kitchen lights to 100% vs saying “alexa turn on cooking time” which is how it works with emulated hue. Also it did not work quite as fast nor as consistently when I had the long sentence. If I missed a thread that someone recommends please link me to it as this discussion is a bit old at this point.