Alexa discovers zero devices (with openHAB 2.4 M8 and hue-emulation)

Tags: #<Tag:0x00007f7454f7f308> #<Tag:0x00007f7454f7f240>
  • Platform information:
    • Hardware: laptop, on 192.168.1.27
    • OS: windows 10
    • Java Runtime Environment: 1.8.0_191
    • openHAB version: 2.4 M8
    • one Echo and one Echo Dot, latest revisions (bought in December 2018)

I’m new to openHab, and trying to setup an integration with Alexa trough hue-emulation for the last 2 weeks.
I read several topics related to hue-emulation and Alexa, and got this far:

  • openHAB is correctly configured with my KNX/IP gateway, here’s the .things file:
Bridge knx:ip:bridge [ 
    ipAddress="192.168.1.217", 
    portNumber=3671, 
    localIp="192.168.1.27", 
    type="TUNNEL", 
    readingPause=50, 
    responseTimeout=10, 
    readRetriesLimit=3, 
    autoReconnectPeriod=10,
    localSourceAddr="0.0.0"
] {
    Thing device generic {
        Type switch        : P7_ingresso_switch  "P7 Ingresso"     [ ga="1/0/0+<1/0/100" ]
    }
}
  • I have one item configured, here’s the .item file:
Switch   P7_ingresso_switch   "P7 Ingresso"  <light> ["Lighting"]

I can turn on and off the light from the “control” page in openHAB: so far, so good.

I then installed and configured hue emulation (including redirect to port 80), here’s what I get from my openHAB:

<root xmlns="urn:schemas-upnp-org:device-1-0">
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<URLBase>http://192.168.1.27:80/</URLBase>
<device>
<deviceType>urn:schemas-upnp-org:device:Basic:1</deviceType>
<friendlyName>openHAB Hue Emulation (192.168.1.27)</friendlyName>
<manufacturer>Royal Philips Electronics</manufacturer>
<manufacturerURL>http://www.openhab.org</manufacturerURL>
<modelDescription>Philips hue compatible Personal Wireless Lighting</modelDescription>
<modelName>Philips hue bridge 2015</modelName>
<modelNumber>BSB002</modelNumber>
<modelURL>http://www.meethue.com</modelURL>
<serialNumber>493781123655</serialNumber>
<UDN>uuid:49378112-3655-40e4-9bcc-bb2cdea51546</UDN>
<presentationURL>index.html</presentationURL>
<iconList>
<icon>
<mimetype>image/png</mimetype>
<height>48</height>
<width>48</width>
<depth>24</depth>
<url>hue_logo_0.png</url>
</icon>
<icon>
<mimetype>image/png</mimetype>
<height>120</height>
<width>120</width>
<depth>24</depth>
<url>hue_logo_3.png</url>
</icon>
</iconList>
</device>
</root>
// 20181216160441
// http://192.168.1.27/api/discovery.xml

{
  "config": {
    "uuid": "49378112-3655-40e4-9bcc-bb2cdea51546",
    "timeformat": "24h",
    "timezone": "+01:00",
    "UTC": "2018-12-16T15:04:40.027",
    "localtime": "2018-12-16T16:04:40.027",
    "devicename": "Philips Hue",
    "fwversion": "0x262e0500",
    "rfconnected": true,
    "zigbeechannel": 15,
    "linkbutton": false,
    "panid": 19367,
    "dhcp": true,
    "gateway": "192.168.0.1",
    "ipaddress": "192.168.1.27",
    "netmask": "255.255.255.0",
    "networkopenduration": 60,
    "proxyaddress": "none",
    "proxyport": 0,
    "whitelist": {
      "discovery.xml": {
        "name": "Formerly authorized device",
        "createDate": "2018-12-16T12:41:09.955",
        "lastUseDate": "2018-12-16T16:04:40.027"
      },
      "testuser": {
        "name": "Formerly authorized device",
        "createDate": "2018-12-16T13:38:31.933",
        "lastUseDate": "2018-12-16T14:53:33.497"
      }
    },
    "apiversion": "1.16.0",
    "bridgeid": "493781123655",
    "datastoreversion": "60",
    "starterkitid": "",
    "modelid": "BSB002",
    "name": "openHAB Devices",
    "swversion": "2.5.46",
    "mac": "AC:7B:A1:4E:BD:DA",
    "factorynew": false
  },
  "lights": {
    "1": {
      "state": {
        "bri": 0,
        "ct": 500,
        "on": false,
        "reachable": true,
        "mode": "homeautomation",
        "alert": "none"
      },
      "type": "Color Temperature Light",
      "modelid": "LTW001",
      "uniqueid": "49378112-3655-40e4-9bcc-bb2cdea51546-1",
      "manufacturername": "Philips",
      "swversion": "66012040",
      "friendsOfHue": true,
      "colorGamut": "2200K-6500K",
      "hascolor": false,
      "name": "P7 Ingresso",
      "config": {
        "archetype": "classicbulb",
        "function": "functional",
        "direction": "omnidirectional"
      },
      "capabilities": {
        "certified": true,
        "streaming": {
          "renderer": false,
          "proxy": false
        },
        "control": {
          
        }
      }
    }
  },
  "groups": {
    "0": {
      "name": "All lights",
      "type": "LightGroup",
      "action": {
        "hue": 0,
        "sat": 0,
        "xy": [
          0.0,
          0.0
        ],
        "effect": "none",
        "transitiontime": 0,
        "colormode": "ct",
        "bri": 0,
        "ct": 500,
        "on": false,
        "reachable": true,
        "mode": "homeautomation",
        "alert": "none"
      },
      "lights": [
        "1"
      ]
    }
  },
  "scenes": {
    
  },
  "rules": {
    
  },
  "sensors": {
    
  },
  "schedules": {
    
  },
  "resourcelinks": {
    
  }
}
  • And from 192.168.1.27/api/testuser/lights :
// 20181216231458
// http://localhost:8080/api/testuser/lights

{
  "1": {
    "state": {
      "bri": 0,
      "ct": 500,
      "on": false,
      "reachable": true,
      "mode": "homeautomation",
      "alert": "none"
    },
    "type": "Color Temperature Light",
    "modelid": "LTW001",
    "uniqueid": "49378112-3655-40e4-9bcc-bb2cdea51546-1",
    "manufacturername": "Philips",
    "swversion": "66012040",
    "friendsOfHue": true,
    "colorGamut": "2200K-6500K",
    "hascolor": false,
    "name": "P7 Ingresso",
    "config": {
      "archetype": "classicbulb",
      "function": "functional",
      "direction": "omnidirectional"
    },
    "capabilities": {
      "certified": true,
      "streaming": {
        "renderer": false,
        "proxy": false
      },
      "control": {
        
      }
    }
  }
}

Still, after I enable Device Pairing and Amazon Echo Device Discovery Fix, in hue-emulation, Alexa is not finding any device.
Already tried scanning from alexa.amazon.it, from the mobile app and from the Echo devices.

Here are the logs that are generated (set to DEBUG):

2018-12-16 15:59:00.869 [DEBUG] [.io.hueemulation.internal.LightItems] - Added items: P7 Ingresso
2018-12-16 15:59:01.572 [INFO ] [eemulation.internal.ConfigManagement] - Hue Emulation pairing enabled for 60s at /api
2018-12-16 15:59:01.574 [DEBUG] [org.openhab.io.hueemulation         ] - ServiceEvent MODIFIED - {org.openhab.io.hueemulation.internal.HueEmulationService}={service.id=354, service.bundleid=207, service.scope=bundle, restrictToTagsWhiteLights=Lighting,Switchable, component.name=org.openhab.io.hueemulation.internal.HueEmulationService, service.config.label=Hue Emulation, component.id=214, createNewUserOnEveryEndpoint=true, restrictToTagsSwitches=Switchable, restrictToTagsColorLights=ColorLighting, discoveryHttpPort=80, pairingTimeout=60, pairingEnabled=true, service.config.category=io, discoveryIp=192.168.1.27, service.config.description.uri=io:hueemulation, service.pid=org.openhab.hueemulation} - org.openhab.io.hueemulation
2018-12-16 16:00:01.593 [DEBUG] [.io.hueemulation.internal.LightItems] - Added items: P7 Ingresso
2018-12-16 16:00:02.233 [INFO ] [eemulation.internal.ConfigManagement] - Hue Emulation pairing disabled. Service available under /api
2018-12-16 16:00:02.234 [DEBUG] [org.openhab.io.hueemulation         ] - ServiceEvent MODIFIED - {org.openhab.io.hueemulation.internal.HueEmulationService}={service.id=354, service.bundleid=207, service.scope=bundle, restrictToTagsWhiteLights=Lighting,Switchable, component.name=org.openhab.io.hueemulation.internal.HueEmulationService, service.config.label=Hue Emulation, component.id=214, createNewUserOnEveryEndpoint=false, restrictToTagsSwitches=Switchable, restrictToTagsColorLights=ColorLighting, discoveryHttpPort=80, pairingTimeout=60, pairingEnabled=false, service.config.category=io, discoveryIp=192.168.1.27, service.config.description.uri=io:hueemulation, service.pid=org.openhab.hueemulation} - org.openhab.io.hueemulation

Really don’t know what to try now, any suggestion would really be much appreciated!
Martin

I can’t help you with above problem. However, last week I set up my Sonos Beam with Alexa integration to openHAB via openHAB cloud. Setup was fairly easy and worked immediately.

https://www.openhab.org/docs/ecosystem/alexa/

And so far it works extremely well. Great addition to home automation I must admit.

Thanks, that would be my second choice, but as of today I can not go that way as the openHAB Alexa skill is not available in Italian yet.

In any case, I’d really like to understand what I’m doing wrong, as after investing 10+ hours into this now it’s a challenge! :slight_smile:

Your hue emulation is behaving correctly (as long as the second code came from /api/[user-key]/lights and not from api/discovery.xml at least).

Are you sure that your Alexa variant (still) supports local Hue bridges? Because Amazon wants people to move to skills, and different Echo variants have various support levels (or no support at all, depending on the country) for local Hue bridges.

Have you tried to find the hue emulation with a Hue mobile app? (Not the official one, which does not work with the emulation)

Thanks David, this was really helpful.
I edited my post and added the data was from a /api/[user-key]/lights (everything seems correct there).

I installed the Hue Essentials app on my mobile, and I noticed it was not finding the (emulated) Hue Bridge on 192.16.1.27:80

Please note that I do connect locally to the (local) openHab on 192.16.1.27:80 (or simply http://localhost), so I was assuming the port forwarding was successful.

It might not be the case, as if I manually configure the Hue Essentials app to connect to 192.168.1.27:8080 it connects!

I’m trying to understand what is not working in the port forwarding, or maybe if there are conflicting services or firewall issues.

I’m using the following command to forward port 80 to 8080 on Windows 10:
netsh interface portproxy add v4tov4 listenport=80 listenaddress=192.168.1.27 connectport=8080 connectaddress=192.168.1.27

Nice explanation about port forwarding on Windows here:
http://woshub.com/port-forwarding-in-windows/

As always, any feedback would be much appreciated!

It was a 80 -> 8080 forwarding issue on Windows.
I installed openHAB on a Raspberry and got it working

Thanks.