New Binding: Amazon Echo

Just interested what made you switch from Home Assistant to OpenHAB, and how has that worked out.

Mostly just waiting on OpenHab 2 to come out. The API makes it a lot more flexible to develop something custom, and the community is far bigger. There’s still problems with both, mostly supporting all the different products, for example I have a Lockwood Zwave lock that isn’t compatible with either. OpenHab 2 just looks and feels great.

I too am going to take the plunge to OpenHab2. I just saw the Home Assistant site in regards to Echo. I already have the big echo and ordered a Dot V2. I am running OpenHab 1.something on a BeagleBoard-XM and it works fine, although I also put emonCMS on it as well, which has slowed it a bit. Time for a new server. I do like that Home Assistant is basically Python, but I am muddling through Java well enough with OpenHab. The Hue emulation is a fabulous addition, but I am curious: With OpenHab 2, can you have the Hue Emulation binding working alongside of a ‘customizable’ Echo API (if there will be one), or will it just mess with Alexa’s head? Essentially, can you have the Echo turn on and off things like Hue, and also “Alexa, tell OpenHab blah, blah…” after customization applied?

Yes, you can use a combination of the HA-Bridge and/or other options at the same time. The key is that you say “Alexa, tell OpeHAB” first which initiates the intended handler/skill where as, for example, ‘Alexa, turn off bedroom lights’ would use the Smart Home API or available bridge instead.

Hello, I have been using this binding with Openhab2 and some of the new Echo Dots. Everything works great, very impressive work so far! Thanks for getting this functionality into Openhab.

However, I am seeing an issue with discovering devices through Alexa. I have about 40 devices in Openhab. I find as soon as I add the [“Lighting”] or [“Switchable”] tag to more than 32 devices, the Alexa app will report all devices as Offline and will not discover any new ones. 32 devices work fine, but if I expose 33 then they all go offline.

I turned on debug logging and I was able to see Alexa hitting the discovery API, so it’s reading it. I checked the API pages that Alexa is hitting and they all seem valid, although I didn’t run it through a JSON parser I suppose.

I found these posts:

I see you have tested with 30 devices, could you do a bit more testing with 32+? If you need any logs or information from me, let me know.

By the way, I would be able to work around this for my setup if I could make different devices available through Homekit than are available through the Hue Emulator. I use the iOS 10 Home app as my primary touch input control, but since the Hue Emulator and Homekit both share the same [tagging] in Openhab2, I am essentially limited to 32 devices in Homekit as well if I also want Alexa support. Is there currently any way (even a hack) to allow specification of different lists of devices through the Homekit emulator and Hue emulator?

In case it helps, my devices are Insteon switches and dimmers, defined like this (just a sample, like I said I have ~40):

Dimmer kitchen_pendant_lights "Kitchen Pendant Lights" <dimmablelight> ["Lighting"] {insteonplm="xx.xx.xx:F00.00.01#dimmer"}
Switch kitchen_sink "Kitchen Sink" <light> ["Lighting"] {insteonplm="xx.xx.xx:F00.00.02#switch"}

Is this the same emulator thats included in the paper ui?

Anybody been having issues with the hue emulator and Amazon echo?.. just got two echo dots and a regular echo and when I issue commands to turn lights on or off they are very delayed. It’s almost like the echos can’t find openhab or its not responding quick enough. As far as everything else goes if I’m using habpanel to turn a light on or off its instant.

I finally got my echo dot to work with the hue emulator. I had to download the latest snapshot to get the new changes for the hue emulator plugin. My issue for me was that I have several networks on my container that runs openhab. Once I got the latest snapshot and configured the hue emulator to use the correct network, all is working well. The Alexa app discovered all of my lights that are configured with the appropriate flag. There is a slight delay, but that is mostly probably due to Alexa converting my voice to an action.

This delay seems to be related to having multiple echos on the same network. I have 3 and experience the same, but if i remove two, I have no problems. It’s an issue brought up in github with similar habridge project.

Quick Question…

I have enabled the HUE Emulation/Amazon Echo Binding in OH2, I have turned on pairing and Alexa can’t find my items.

I am using A TCP based switch which is based on a OH1 binding I believe…is that an issue or will the emulation see any items as long as they are tagged correctly?

I have tried tagging using the recommended tags included in this post and using the Lighting tag from the Docs - none work

Switch Hallway { tcp="<[10.5.1.6:3040:'MAP(m90.map)'], >[ON:10.5.1.6:3040:'MAP(90.map)'],>[OFF:10.5.1.6:3040:'MAP(90.map)'] ", autoupdate="false" } [ "homekit:Hallway Lights" ]

and

Switch Hallway { tcp="<[10.5.1.6:3040:'MAP(m90.map)'], >[ON:10.5.1.6:3040:'MAP(90.map)'],>[OFF:10.5.1.6:3040:'MAP(90.map)'] ", autoupdate="false" } [ "he:Hallway Lights" ]

and

Switch Hallway { tcp="<[10.5.1.6:3040:'MAP(m90.map)'], >[ON:10.5.1.6:3040:'MAP(90.map)'],>[OFF:10.5.1.6:3040:'MAP(90.map)'] ", autoupdate="false" } "Hallway Lights" [ "Lighting" ]

All with no luck… the switches can not be found.

Any suggestions?

Thanks,

Squid

The Tag has to be defined befire your binding configuration.

@hmerk

Thank you for your assistance…I have tried three different iterations of the tag, 2 which are mentioned in this thread, the other in the DOCS…none of the 3 tags were discoverable by Alexa. I tried:

Switch Hallway "Hallway" [ "Lighting" ]
Switch Hallway [ "homekit:Hallway Lights" ]
Switch Hallway [ "he:Hallway Lights" ]

Any suggestions?

Is your config working without the tags ?

Yes. The switches/items control their specified devices without any issues.

According to the docs, the following Item config should work in your case :

Switch Hallway "Hallway Lights" [ "Switchable" ] { tcp="<[10.5.1.6:3040:'MAP(m90.map)'], >[ON:10.5.1.6:3040:'MAP(90.map)'],>[OFF:10.5.1.6:3040:'MAP(90.map)'] ", autoupdate="false" }

@hmerk

Thank You!!! That switch worked…

I wonder why the “Lighting” tag did not…

Switch Hallway "Hallway" [ "Lighting" ]

Is it device specific…

From the docs…

Device Tagging

To expose an item on the service, apply a supported tag (which are “Lighting”, “Switchable”, “TargetTemperature”) to it. The item label will be used as the Hue device name.

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

The [“Lighting”] tag definitely works for me. Here is an insteon item that works:

Dimmer dining_room "Dining Room" <dimmablelight> ["Lighting"] {insteonplm="xx.xx.xx:F00.00.01#dimmer"}

I don’t see any reason why the TCP binding item should not also work, at least in theory. I am also using the TCP binding in my setup, but only for “Switchable” items.

Note though, if you’re just using the Hue Emulation for Alexa, and not HomeKit, it doesn’t seem to matter if you specify Lighting or Switchable, they both identify as “Dimmable Light” to Alexa. HomeKit does differentiate.

As regards this problem with OH2:

I was finally able to solve this issue. I installed openhab on a second Raspberry Pi system because I thought I was going to have to just run multiple instances to cover all my devices. However, on the new installation, I could not reproduce this bug. I was able to get Alexa to see 90+ devices with no problem.

I tried a bunch of other things to repair the first installation, but in the end it was the nuclear approach that worked. From the osgi console, I typed:

smarthome:items clear
smarthome:links clear

I also deleted the contents of the following directories:

/var/lib/openhab2/cache
/var/lib/openhab2/hueemulation
/var/lib/openhab2/mapdb

Note: be careful with these commands! This will delete all of your extensions, your hue emulator pairing data, and your mapdb database! Of course, you can just reinstall your extensions through Paper UI or they will be automatically reinstalled if you have them defined in addons.cfg, but your item state DB will be lost.

I can’t even really recommend this approach since I’m not sure exactly which part solved my problem, but if anyone else has a similar issue at some point, these are just some things you can try.

Oh, one other thing I should mention, I also updated to an OH2 nightly build from beta4. I’m running build 576. I tried updating first though, and that did not solve the problem - only the steps above did, but it’s worth mentioning since perhaps updating does factor in to this process somehow.

(I posted this in the other thread as well, just in case it helps someone)

I wonder if the issue boils down to the item type?

Maybe “Lighting” only works on DIMMERS and not SWITCHES ?