New Binding: Hue Emulator - Amazon Echo integration

Is there a tutorial out there how to connect alexa with Harmony hub, to control ButtonPress?

Hi together,

I just received my Echo Dot 2 last week and played around a bit. For the beginning I installed the hueemulation binding in OH2 and followed the steps to pair a simple device in my items. But I’m not able to find any device with my alexa app, so the question is, what I’m doing wrong?

In the log everything looks fine for me.

Debug log:


2016-12-25 15:10:12.616 [DEBUG] [org.openhab.io.hueemulation         ] - BundleEvent STARTING - org.openhab.io.hueemulation
2016-12-25 15:10:12.636 [DEBUG] [org.openhab.io.hueemulation         ] - ServiceEvent REGISTERED - {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=196, pairingEnabled=true, service.config.description.uri=io:hueemulation, service.id=335, service.bundleid=213, service.scope=bundle} - org.openhab.io.hueemulation
2016-12-25 15:10:12.662 [DEBUG] [ulation.internal.HueEmulationServlet] - Device pairing enabled : true
2016-12-25 15:10:12.702 [DEBUG] [org.openhab.io.hueemulation         ] - ServiceEvent REGISTERED - {javax.servlet.ServletContext}={osgi.web.symbolicname=org.openhab.io.hueemulation, osgi.web.version=2.0.0.201612231552, osgi.web.contextpath=/, service.id=336, service.bundleid=213, service.scope=singleton} - org.openhab.io.hueemulation

2016-12-25 15:10:12.716 [INFO ] [ulation.internal.HueEmulationServlet] - Started Hue Emulation service at /api
2016-12-25 15:10:12.721 [DEBUG] [org.openhab.io.hueemulation         ] - BundleEvent STARTED - org.openhab.io.hueemulation


In my items file I just defined one entry for a virtual switch, one the karaf console I’m able to switch the socket. I also tried a few different devices but without success.
My Item file

Switch Schaltsteckdose_Wohnzimmer_PC_an_aus		"Schaltsteckdose Wohnzimmer PC [MAP(de.map):%s]"	<poweroutlet>	     (GSocket,GEchoDot)	["Switchable"]	

Some further informations:
System: Raspi3 with debian jessy
OH2: 2.0.0. Snapshot, Build: 670

I thank you in advance for any helpfull ideas.

Jens

Did you remember to enable pairing in the Paper UI settings for the hue emulation binding? That would prevent alexa from seeing the devices.

Try the item without [MAP(de.map):%s]
You can name it in the sitemap if it works…

@anthonygillet, yes, pairing is enabled in the Paper UI, message in the log file.

2016-12-25 15:10:12.662 [DEBUG] [ulation.internal.HueEmulationServlet] - Device pairing enabled : true

@sasha_jpr, without [MAP(de.map):%s] the same effect, no items found.

I don’t understand it, everything I try no items will be found.
Is this maybe a network problem, because I have a physically Hue bridge with hue bulbs?

Thanks
Jens

Yes, having actual Hue bridge can be problem. I also faced situation when Echo couldn’t find any item because other service was broadcasting on UPD port 1900.

Try to disconnect Hue bridge, restart openhab and scan for items from Echo. You can bring bridge back after successful pairing with OH.

1 Like

I’m also seeing this. I had upgraded from a manual install, to the latest apt package beta (4?) a while back and had just noticed it tonight. At first I thought the command wasn’t going through at all, even though Alexa responded “OK.”

I upgraded to beta5 and uninstalled/installed the binding with no change.

If I have already defined the Item in PaperUI, how can I add the lable [“Switchable”] or [“Lighting”]?

How can I activate DEBUG logging for the hueEmulator?

I am also not able to see any devices in the Alexa App.

Thank you so much!

Hi Red_Wraith could you send me the rule you use to workaround the temperature offset of -1 please? Thanks!! :slight_smile:

You can use channels:
Item look in PaperUI:

In the text file:

Switch  ZW_Lounge_Motion  "Motion [%s]"  <_motion>  (gPresence, LivingRoom)	 { channel = "zwave:device:b03df6a3:node8:alarm_motion" }

And that’s how I’ve tagged the item for Alexa:

Switch AV_TV "TV" (AV, OHCloud) ["Switchable"]	{http=">[ON:GET:http://ipaddress:1880/av_control?av=tvon] }

Thanks!

I’ve got this working great with LightwaveRF stuff :slight_smile:

Switch Office_Cabinets "Cabinets" (Office) ["Switchable"] { lightwaverf="room=2,device=2,type=SWITCH" }

However, when I “discover devices” with Alexa, she also finds 9 devices named “Color”, which must be my genuine Hue bulbs. They are listed in my home.items file like so:

Switch LR_Ceiling_Toggle <switch> (LivingRoom) channel="hue:0210:001788401199:12:color" }

Why? They aren’t tagged with [“Switchable”) or anything? I can “forget” them in the Alexa app, but how do I prevent it happening in the first place?

I also had this issue for a while, where spurious “Color” items for real Hue bulbs show up in Alexa/Homekit. From what I can gather, this appears to be a “feature” of Paper UI: by default when you add certain Things in Paper UI, it automatically creates a linked item and tags it with [“Lighting”].

You can disable this my turning off “Simple Mode” in the Paper UI settings. Simple Mode seems to be what creates these automatic item links. However, at the time I tested this, simply disabling Simple Mode and recreating the Things would not fix the issue, the auto-created “Color” items still showed up. I got rid of them permanently by issuing the following commands from the OSGI console:

smarthome:items clear
smarthome:links clear

Then restart OH. That command should be pretty safe, everything will be recreated upon startup.

1 Like

That worked thanks Anthony :slight_smile:

I’m running what’s probably a unique config – openhab is on port 8080, but I’m using an apache server to proxy port 80 on an openhab hostname to openhab. The Hue Emulator is the only place I’ve found an issue with this config.
Using a small node.js script, I see that the ssdp response includes the IP address and port of the openhab instance: "LOCATION":"http://10.1.1.6:8080/api/discovery.xml", but port 8080 isn’t open to the network.
If I make a request for http://openhab.<my.home.domain>/api/discovery.xml, I get a response that includes <URLBase>http://10.1.1.6:8080/</URLBase>.

Is there a way to tell the Emulator that another URL should be used in these two instances?
I could see this potentially also being helpful for Docker users that aren’t using the host network stack.

PS, REST requests return the desired hostname format in the "link" item, probably because they have the HTTP Host header available.

I can and will open port 8080 to my local network, so this isn’t urgent.

Hello guys,

quick questions…

Can i also assign the Tags to groups… That i can say “Alexa, turn the Living Room on” and all my lights are going to be on?! Or should i have to add all items and create the groups in the Alexa App?

Another question is, that these “Tags” are also for my “Homekit Addon” ?!

Ty :slight_smile:

Yes you can. You can assign a tag to any item, whether it’s tied to a binding or just virtual. I use tags on groups like this:

Group:Switch:OR(ON,OFF) outside_lights "Outside Lights" ["Switchable"]

Yes, the same tags ([“Lighting”], [“Switchable”]) also define which items are visible in HomeKit.

Is it possible to make synonym tags for the same item? Lets say we have a light in the hallway, but we also would like to call it entrance, tags[“Hallway”,“Entrance”,“Home”] or do we need to make duplicate items?

The Hue Emulator uses three specific tags [“Switchable”] being one, see the link below for more info. The synonym that you would like to speak is in the middle quoted element “Outside Lights”. So I expect that you would need to create multiple items that are all associated with the channel you would like to action on, and each would need the [“Switchable”], [“Lighting”], [TargetTemperature"]

https://github.com/openhab/openhab2-addons/tree/master/addons/io/org.openhab.io.hueemulation

Well so far this is how I have defined my items, which works fine(for the last month or so)

	/*Hallway*/
	Switch Light_Hallway 	"Hallway"  		(Group_Hallway,Lights,Group_LightLogging) [ "Lighting" ] { gpio="pin:20" } //Relay 12

However it would be nice if it somehow was possible to define several synonyms without having to create tons of items,rules,persitance, myopenhab, iftt etc just to make a synonym word…