In an attempt to control my OH2 items via Alexa, I’ve performed the following steps.
- Added the HueEmulation service via Paper UI.
- Added items to my items file.
Switch Light_Toy_Room "Switch [%s]" <switch> [ "he:Toy Room Lights" ] {zwave_device_222e6520_node2_switch_binary} (various groups)
- Added to hueemulation.cfg
paringEnabled=true
- Enabled HE DEBUG logging by adding the following to runtime.cfg
log:set DEBUG org.openhab.io.hueemulation
- Restarted OH2 Debug Version
sudo ./start_dbug.sh
Tailing the log I can see the following.
13:01:52.943 [DEBUG] [org.openhab.io.hueemulation ] - BundleEvent STARTING - org.openhab.io.hueemulation
13:01:53.029 [DEBUG] [ulation.internal.HueEmulationServlet] - Device pairing enabled : false
13:01:53.110 [DEBUG] [org.openhab.io.hueemulation ] - ServiceEvent REGISTERED - {javax.servlet.ServletContext}={osgi.web.symbolicname=org.openhab.io.hueemulation, osgi.web.version=2.0.0.201610042020, osgi.web.contextpath=/, service.id=336, service.bundleid=203, service.scope=singleton} - org.openhab.io.hueemulation
13:01:53.120 [INFO ] [ulation.internal.HueEmulationServlet] - Started Hue Emulation service at /api
13:01:53.123 [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=191, paringEnabled=true, org.openhab.hueemulation.paringEnabled=true, service.config.description.uri=io:hueemulation, service.id=335, service.bundleid=203, service.scope=bundle} - org.openhab.io.hueemulation
13:01:53.126 [DEBUG] [org.openhab.io.hueemulation ] - BundleEvent STARTED - org.openhab.io.hueemulation
I’m concerned that I’m not in Pairing mode, because even with the paringEnabled=true, org.openhab.hueemulation.paringEnabled=true options, I don’t see a DEBUG message that states the Device paring enabled: true.
13:33:03.807 [DEBUG] [ulation.internal.HueEmulationServlet] - 192.168.10.69: GET /api/discovery.xml
13:33:26.362 [DEBUG] [ulation.internal.HueEmulationServlet] - 192.168.10.69: GET /api/devices
13:33:26.366 [DEBUG] [ulation.internal.HueEmulationServlet] - apiServerError 1 Not Authorized
I can see in the log the discovery.xml is served, but when I attempted to GET the devices, I am refused with the following error in the browser.
{"error":{"type":1,"address":"/api/devices","description":"Not Authorized"}}
The last clue is when I attempt to set the Pairing Enabled in Hue Emulation via the Paper Services IO Configuration, I get an ERROR 500 Internal Server Error.
Nothing is written to the Debug Console, and no other errors are returned.
Do have a real server error, or is this an authorized user Hue Bridge issue?
UPDATE: I used the REST interface to query the HE Config.
http://192.168.10.26:8080/rest/services/org.openhab.hueemulation/config
The Response shows that Pairing is Enabled.
{
"org.openhab.hueemulation.paringEnabled": "true",
"paringEnabled": "true"
}
I went into the Config via the REST api, and removed the two configs above. Then I performed a POST to correctly set the ParingEnabled using the following.
{pairingEnabled=true}
Then I confirmed the configuration in the DEBUG output.
14:09:16.325 [DEBUG] [ulation.internal.HueEmulationServlet] - Device pairing enabled : true
14:09:16.350 [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=191, pairingEnabled=true, service.config.description.uri=io:hueemulation, service.id=339, service.bundleid=203, service.scope=bundle} - org.openhab.io.hueemulation
I now get a partial response from the /api/devices page.
{"lights":{}}
Still no Joy when attempting to discover devices via Alexa. And shouldn’t I now see my configured Items?
Suggestions welcomed!
Tony