Alexa and Hue emulation: HowTo setup

Hi,

I came across differenct threads with difficulties or smaller Setup Problems using the Hue Emulation binding for an echo (=Alexa) Integration. But I don’t find a howto or something similar to start with. Is there something available? Am I just missing a part? :wink: Thanks for helping me out - I wan’t to use my Alexa with OH2.

1 Like

It’s pretty simple. You are probably right, the official documentation at http://docs.openhab.org/addons/io/hueemulation/readme.html is a little bit shorthanded. :wink:

In the thread about the Hue emulation binding you can find a short tutorial from @Toneus:

Other than that, and if you are german, there is another tutorial (combined with a KNX connection, but can be used for general setup also):

The only issue I had (I connected my Echo some days ago): Alexa couldn’t find new items. I found someone who said that I had to disconnect my hue bridge during the Alexa discovery. Done that and then it worked flawlessly! So if you are also using HUE, you should consider this. As the binding uses a HUE emulation, maybe those two don’t like each other?! :wink: After the discovery, the hue bridge can be reconnected of course.

1 Like

Thanks for your help! It seems, the hue-emulation binding isn’t listed at least in my #752 snapshot. I played around with the hue-binding.

I installed the hueemulation binding in the OH2 console with

bundle:install https://openhab.ci.cloudbees.com/job/openHAB2-Bundles/lastSuccessfulBuild/artifact/openhab2-addons/addons/io/org.openhab.io.hueemulation/target/org.openhab.io.hueemulation-2.1.0-SNAPSHOT.jar
bundle:start XXX (number of bundle, can be shown with bundle:list)

after that, everything worked fine with this hueemulation.cfg:

################################ HUE Binding ##########################################
pairingEnabled=true 

I just added the test-items with the homekit-like

Switch  TestSwitch1     "Kitchen Switch" [ "Switchable" ]
Switch  TestSwitch2     "Bathroom" [ "Lighting" ]
Dimmer  TestDimmer3     "Hallway" [ "Lighting" ]
Number  TestNumber4     "Temperature Set Point" [ "TargetTemperature" ]

Then you can tell Alexa simply the following

  1. “Alexa, schalte Hallway aus/an” (my Alexa is german, in english: “Alexa, Switch Hallway ON/OFF”)
  2. “Alexa, setze Temperature Set Point auf 21 Grad” (“Alexa, set Temperature Set Point to 21 degrees”)

But what I didn’t get Alexa to do, was to dim the Hallway to 50%, does anyone know the command for this?

Is it on purpose, that the hueemulation binding isn’t presently in the list of bindings?

Sorry for maybe pointing out something obvious, but: The Hue emulation can’t be found under addons/bindings, but under addons/misc in PaperUI. Did you look there?

2 Likes

Have the same Problem to dim light with

 [ "TargetTemperature" ]

Hey there,

I already got this working, and it works fine the last couple of month. But now I would like to add some more things. So I know color switching is only possibile in the US version atm, but how about controlling my shutter?
Are there any other tags available, except from switchable, lightning and TragetTemperature?
Maybe a CurrentTemperature?

My Echos are in German and I would like to say ‘Alexa, fahre Makise Wintergarten aus/ein’ (Englisch: Alexa, extend awning) I have a lot of Homematic actuators an sensors in use.

Anybody some ideas?

Use “lightning” to dim some lights, lightning works with switches an dimmable lights.

There is no direct control for shutters or awnings, but a workaround.
Setup a virtual dimmer item, tagged as lighting.
Create a rule that reacts in different percentage value like >50% to send a down command to your shutter, <50% fo an up command, 0% or off command to stop. I have this running for my awning, and my two living room windows. No I can say “Alexa, dim Window to 90%” and my shutter will move down. When it should stop at a certain position, I just say “Alexa, switch off window”

Thank you very much!
It works very well.

I was just trying this with no success and I was wondering if my situation is somehow special.

First: I don’t have an Echo or other Alexa device, I was trying to use the Alexa App on Android. From what it looks like it should be sufficient but I don’t find devices.
The app urges me to activate an Alexa skill - yet claims that I don’t need a Hue skill for basic on/off dimm actions.

When I try to activate the hue skill I am asked for a login for my Phillips account (which I don’t have) so this is a hard stop.

The Openhab Skill fails as I don’t use the cloud connector. -> no skill is selected for Alexa

Edit: I belive this is because OH is using port 8080 and not 80 which new Alexa devices require. I have configured IP tables and will see if this helps.

@bernd_boehm
You don’t need the hue skill, items should be found without any specific skill activated. But for newer echo device (I have an echo 2nd generation) you need to forward port 80 to openhab
Nginx-conf:

server {
    listen                   80;
    listen                   8080;
    server_name              homeio;
    
    root                     /var/www/html/;
    index                    index.html index.htm 50x.html 50x.htm index.php;
    
    location = / {
        satisfy                               any;
        allow                                 192.168.0.37; # ip of DLNA speaker
        allow                                 192.168.0.62; # ip of alexa
        allow                                 127.0.0.1;
        deny                                  all;
        auth_basic                            "Username and Password Required";
        auth_basic_user_file                  /etc/nginx/.htpasswd;
        
        proxy_pass                            http://localhost:8070/; # default port of openhab changed to 8070 in /etc/default/openhab2
        index                                 basicui/app;
        proxy_set_header Host                 $http_host;
        proxy_set_header X-Real-IP            $remote_addr;
        proxy_set_header X-Forwarded-For      $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto    $scheme;
    }
    
    location /audio/ {
        satisfy                               any;
        allow                                 192.168.0.37; # ip of DLNA speaker
        allow                                 127.0.0.1;
        deny                                  all;
        proxy_pass                            http://localhost:8070/audio/;
        proxy_set_header Host                 $http_host;
        proxy_set_header X-Real-IP            $remote_addr;
        proxy_set_header X-Forwarded-For      $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto    $scheme;
    }
    
    location / {
        satisfy                               any;
        allow                                 192.168.0.37; # ip of DLNA speaker
        allow                                 192.168.0.62; # ip of alexa
        allow                                 127.0.0.1;
        deny                                  all;
        auth_basic                            "Username and Password Required";
        auth_basic_user_file                  /etc/nginx/.htpasswd;
        
        proxy_pass                            http://localhost:8070/;
        proxy_set_header Host                 $http_host;
        proxy_set_header X-Real-IP            $remote_addr;
        proxy_set_header X-Forwarded-For      $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto    $scheme;
    }
}

@all
Is there any news on [ “TargetTemperature” ], seems still broken as those items do not show up in alexa. Furthermore alexa is still telling ‘Device is not responding’ as the return values seem still to be misconfigured.

Thanks for your reply which I really appreciate, yet I have think the problem must be different.

I have forwarded port 80 of my OH2 server to 8080 ( I’m not using nginx but have created an iptables rule) for the OH2 dashboard this works fine. To be on the safe side i have created the rule for TCP and UDP packages.
Without success.
If I use myopenhab and the alexa skill it works.

@bernd_boehm
Sorry for missing this in the first place…
As you don’t have any echo device, local hue emulator connection/discovery won’t work. The local connection is provided over the echo devices and a hue connection implemented in their firmware.

Cheers, good you pointed this out. I went for the cloud solution now and this works without an echo device.

Hi, I’m totally lost with current sitution of my OH2 incl. hue emulation. I’m not sure, if it is a problem of OH or of Alexa.
Until beginn of May 2019 evething runs fine with to following configuration:

  • hue emulation 2.3.0 to share my OH devices (e.g. rollershutter) with Echo
  • hue binding to integrate the hue lamps, which are connected to hue bridge, in OH
  • in Alexa the hue lamps are shown as connected by “philips lightning”
  • in Alexa the OH device published as “switchable” or “lighning” as connectd by “Hue Hub”

Suddenly, when I try to control OH device (e.g. rollershutter) with Alexa, Alexa switch on a light. It looks like Alexa is mixing the devices of “philips lightning” and “Hue Hub”.

I tried the following:

  • upgrade OH to current snapshot 2.5.
  • delete all Alexa device and connect them new
  • try different parameter of hue emulation, like V1
    but no success.

The control of OH device by OH (paperUI, BasicUI, …) is still working fine.

Has someone an idea or a similar problem?

Amazon is periodically updating their firmware and changing / improving their rather buggy Hue support.

The OH 2.3 Hue Emu Service emulated a Hue bridge V1. Those are EOL afaik, so Amazon has all rights to remove support for that (or not care about backwards compatibility).

That’s why Hue Emu emulates a V2 bridge since 2.4. Unfortunately a bug slipped in that lets the service forget the unique Hue IDs assigned to each item, so saying “Alexa turn on kitchen light” might turn on your bedroom instead.

2.5 therefore changed again and got massively extended to support all Hue APP features (room, rules, scenes, timers). Recently I discovered however that Alexa can find exposed items, but cannot control them (bug on Amazons side). The patch to make this work is not yet merged.

1 Like

Hello David,

thx for update. From my point of view not Hue Emulation is mixing the IDs, but Alexa is mixing the IDs. When I trie to control the rollershutter a light is switched on by the Alexa-Hue Bridget Integration. Not by OH.

Do you have any Idea how the reset / reassign new IDs to the different Hue devices?

Removing things from Alexa and rediscover helps. But it will happen again. That’s why 2.5 does it different.