New Binding: Hue Emulator - Amazon Echo integration

There is a security mechanism, where you have to go into the binding config in PaperUI and enable discovery, then have Alexa perform discovery “Alexa, discover devices”. They should be found at that point, then you can turn it off again.

Yes - that’s the “Enable Pairing” feature of the hue emulation binding. I’ve enabled that, so that should not be the issue.

Update - I’ve done that one trick which mostly works in IT - reinstalled everything. It was a fresh install of OH2 anyway, so nothing valuable was lost.

It works now, anyway. Thx

Hi Digitaldan,
Greetings from OpenHab newbie. I was trying to combine Amazon Dot, Harmony Hub and OH2. By enabling the pairing mode and trying to create things in the item file like
Switch TestSwitch1 “Test Switch” [ “Switchable” ]
My Alexa could find the Test switch as Smarthome device.
Could you kindly teach me how to add Harmony Activity as a thing so that I can ask Alexa to switch activity?
Thanks a lot

Hi Tam, alexa+harmony-emulator only knows how to turn things on and off or set a level. To turn on a “Activity” create a new item like
`Switch Office_Music “Office Music” [“Switchable”] {autoupdate=“false”}

Then create a rule like:
rule "Office_Music" when Item Office_Music received command ON then sendCommand(HarmonyHubActivity, "Music") end
Replace HarmonyHubActivity and “Music” with the right item and activity name for your system.
Now say “Alexa, turn Office Music On”. If you wanted to also turn the activity off, you could modify the rule to catch the OFF command and send “PowerOff” to the harmony activity.

1 Like

Hi Digitaldan,
Really appreciate your support and advice. I followed your instructions and can now switch between activities and PowerOff.
Btw, Could you advice if I can make things and rules to control the volume or Mute my Denon AVR via Alexa?
Thanks again
Tam

You could create a switch called “Music Mute” and do the same type of thing with a rule and send the mute button press for your device when the rule receives an on command, then say “Alexa, turn Music Mute ON”.

Thanks, does it mean we can use this way to do other tasks to the device level (not Activity level)?
I saw a demo video you posted on YouTube in which you can control a lot of things in openhab and harmony. If you don’t mind, could you share some example of thing and sitemap for harmony? Sorry as I am still very new to this world.
Thanks so much.

New Hue Emulator user here, looking for help getting it to work. The set up consists of openHAB2 beta 3 running on a Debian system and an Amazon Tap on the same subnet.

– from the items file
Switch testswitch0 “test switch” [“homekit:Test Switch”]
Switch TestSwitch1 “Kitchen Switch” [“Switchable”]
Number garage_temp “Garage Temperature” [“homekit:CurrentTemperature”]

I used “log:set DEBUG org.openhab.io.hueemulation” to enable logging.
When I change the setting that enables pairing (in Paper UI), I see this in the log file:
[DEBUG] [ulation.internal.HueEmulationServlet] - Device pairing enabled : true 2016-07-20 01:06:24.202 [DEBUG] [org.openhab.io.hueemulation ] - ServiceEvent MODIFIED - {javax.servlet.http.HttpServlet}={service.pid=org.openhab.hueemulation, debug=true, service.config.category=io, service.config.label=Hue Emulation, component.name=org.openhab.hueemulation, component.id=167, pairingEnabled=true, service.config.description.uri=io:hueemulation, service.id=285, service.bundleid=204, service.scope=bundle} - org.openhab.io.hueemulation

After that I do device discovery from the Tap. From what others have posted, I was expecting to see something that includes “Got SSDP Discovery” when the Tap is trying to discover devices, but I don’t. It looks like the emulator is ignoring UPNP requests from the Tap. I have verified with tcpdump that the packets are reaching the host running openHAB.

Any suggestions on what to do next? Thanks.

Try changing your tags to just [“Lighting”] or [“Switchable”]. No need to declare it as homekit with the current version I don’t think. I had some problems getting mine discovered at first because I didn’t include the name of the switch in the items file. Curiously, Homekit had no trouble finding them.

Here is one of my items that is working.

Switch outlet2 “Cody’s Lamp” (lights,lamp,bedroom) [“Lighting”] {mqtt=“>[broker:/ol2/gpio/15:command:ON:1],>[broker:/ol2/gpio/15:command:OFF:0],<[broker:/ol2/state:state:default”}

I have a problem. After the new installation my OH2 and HomeKit works like charm however i can’t get echo to discover my items even with pairing enabled in services. here is my item which works with OH2 GUI as well from HomeKit (IOS10).

Switch Bed_CandleWarmer “Candle Warmer” (GF_Bedroom) [“Switchable”] {mqtt=“>[mqttbroker:Bed_Plug1/gpio/13:command:ON:1],>[mqttbroker:Bed_Plug1/gpio/13:command:OFF:0]”}

Hi All. Been struggling to get this working for awhile now with no luck.
I’ve tried a fresh install with no other bindings installed and a very basic items file with lighting tags.
Alas, no matter what I do, Alexa does not discover any items.

Hopefully someone has some idea of what is happening. I might crack out Wireshark next.

For the moment. Here are some debug logs.

2016-08-10 20:44:39.708 [DEBUG] [ulation.internal.HueEmulationServlet] - Device pairing enabled : true
2016-08-10 20:44:39.720 [DEBUG] [org.openhab.io.hueemulation ] - ServiceEvent MODIFIED - {javax.servlet.http.HttpServlet}={service.pid=org.openhab.hueemulation, service.config.category=io, service.config.label=Hue Emulation, component.name=org.openhab.hueemulation, component.id=154, pairingEnabled=true, service.config.description.uri=io:hueemulation, service.id=283, service.bundleid=188, service.scope=bundle} - org.openhab.io.hueemulation
2016-08-10 20:44:52.164 [DEBUG] [ulation.internal.HueEmulationServlet] - 192.168.1.103: GET /api/discovery.xml
2016-08-10 20:44:56.820 [DEBUG] [ulation.internal.HueEmulationServlet] - 192.168.1.237: GET /api/discovery.xml
2016-08-10 20:44:56.820 [DEBUG] [ulation.internal.HueEmulationServlet] - 192.168.1.237: GET /api/discovery.xml
2016-08-10 20:44:56.820 [DEBUG] [ulation.internal.HueEmulationServlet] - 192.168.1.237: GET /api/discovery.xml
2016-08-10 20:44:57.628 [DEBUG] [ulation.internal.HueEmulationServlet] - 192.168.1.237: GET /api/BXKwfGkvyRaMij1JvY72TiaWuCxNkGFakhXXXXX/lights
2016-08-10 20:44:57.642 [DEBUG] [ulation.internal.HueEmulationServlet] - 192.168.1.237: GET /api/BXKwfGkvyRaMij1JvY72TiaWuCxNkGFakhXXXXX/lights
2016-08-10 20:44:57.695 [DEBUG] [ulation.internal.HueEmulationServlet] - 192.168.1.237: GET /api/BXKwfGkvyRaMij1JvY72TiaWuCxNkGFakhXXXXX/lights

Couple of items
Switch Max_Bedroom_Lamp “Max Bedroom Lamp” (gBedroom,gAll,gLights) [“Lighting”] { channel=“zwave:device:fa8e14fd:node4:switch_dimmer” }
Switch Jen_Bedroom_Lamp “Jen Bedroom Lamp” (gBedroom,gAll,gLights) [“Lighting”] { channel=“zwave:device:fa8e14fd:node5:switch_dimmer” }

I had also tried some basic items from the list of working examples people have provided above that don’t link to anything.

No matter what I do, it doesn’t discover anything. I’ve also turned off my media server in case Plex or something was causing a conflict.

The IP address 237 in the debug is my Echo. 103 is my laptop. I also tried disabling the wifi interface in the laptop in case it was causing a conflict.

Any ideas anyone? Would love to get this working.

Cheers.

Edit. Btw. Rpi 3 with Latest online snapshot 444

I don’t know why its not working, does the tag show up if you hit “/rest/items” or “/rest/items/Max_Bedroom_Lamp” ?

Hi. I get the following response when I /rest/items/Max_Bedroom_Lamp

{
“link”: “http://192.168.1.6:8080/rest/items/Max_Bedroom_Lamp”,
“state”: “NULL”,
“type”: “SwitchItem”,
“name”: “Max_Bedroom_Lamp”,
“label”: “Max Bedroom Lamp”,
“category”: “switch”,
“tags”: [
“Lighting”
],
“groupNames”: [
“gBedroom”,
“gAll”,
“gLights”
]
}

Made some progress. Seems the problem was that I was still using the jar file in addons. By removing it and using the built in paperui binding. I was able to have Alexa discover devices. :slight_smile:

@digitaldan Where do I put the hueemulation binding in conf/services/addons.cfg so that it installs automatically when I upgrade to a new OH2 version? There’s no io = line like there is for binding, ui, persistence, action, etc. Would it go on the misc = line?

BTW, nice work on this binding. It’s working well for me after only a couple minutes of setup.

Not @digitaldan :slight_smile: but it goes in the misc line like so:

# A comma-separated list of miscellaneous services to install (e.g. "myopenhab")
misc = hueemulation

Perfect. Thank you!

I kind of hijack this topic - but it’s about the hue emulation, so I give it a try.

Maybe I’m doing something wrong, but I get the “OFF” command right (from Harmony Hub), but I cannot succeed in getting any switchable items to be switched ON. Dimmable items seems OK - but when I try to switch on a switchable item, nothing happens. In the log file with debug enabled it says:

22:25:37.969 [DEBUG] [ulation.internal.HueEmulationServlet] - 192.168.0.197: PUT /api/b82d8794-9def-430a-93c3-286d7d08a21a/lights/Light_LivingHallWindowPoints/state
22:25:37.971 [DEBUG] [ulation.internal.HueEmulationServlet] - State [on: true bri: 254 hue: 0 sat: 0 xy: {0.0 0.0 } ct: 500 alert: none effect: none colormode: ct reachable: true
2

The item name is Light_LivingHallWindowPoints.

Items configuration in items file is:
Switch Light_LivingHallWindowPoints “Hall LED-punkter” (G_Lights_LEDLivingfloor) [ “Switchable” ]

What am I doing wrong :)?

Best regards,
Patrik

Is there any option to run the hue emulation in OH 1.8.3??
I would like to integrate the hue buttons on my harmony companion remote (with hub) into OH.