Hue Emulation Service Not Authorized

I’m trying to set up the hue emulation for days now.
To be honest the documentation doesn’t give me much of advice. Describing what can be configured but not how left me using Google for days.

For now I don’t care about the reverse proxy, but i’ve installed and configured nginx.
And I don’t care about Alexa finding it, first the api needs to response properly.
I prefer textual configuration, but I’m fine either way, since I want to get it running eventually.

Accessing http://192.168.x.y:8080/api/status:

  • I can enable pairing mode.
  • 0 published lights
  • 66 published sensors
  • Below UPnP discovery test it tells: service not registered
  • Below Users, it shows nothing

Accessing http://192.168.x.y:8080/api/testuser/lights I get
[{“error”:{“address”:“testuser/lights”,“description”:“Not Authorized”,“type”:1}}]

Accessing http://192.168.x.y:8080/api/testuser/sensors I get
[{“error”:{“address”:“testuser/sensors”,“description”:“Not Authorized”,“type”:1}}]

I was trying to find a file named hueEmulationUsers.json on my system, there is none.

Service must be started, since it’s logging:
[INFO ] [io.hueemulation.internal.ConfigStore] - Hue Emulation pairing enabled for 60s
[INFO ] [io.hueemulation.internal.ConfigStore] - Hue Emulation disable pairing…
[INFO ] [io.hueemulation.internal.ConfigStore] - Using discovery ip 192.168.x.y
[INFO ] [io.hueemulation.internal.ConfigStore] - Hue Emulation pairing disabled
[INFO ] [ueemulation.internal.upnp.UpnpServer] - Hue Emulation UPNP server started on 192.168.x.y:8080

I’d love to know where to configure the service. Then I need to figure out why the service is reporting not registered and then I need to fix the not authorized issue.

Help is appreciated.

Was able to add a user in the meanwhile using this json as /var/lib/openhab/jsondb/hueEmulationUsers.json
Wonder why it is not created for me and also not documented.

"testuser": {
	"class": "org.openhab.io.hueemulation.internal.dto.HueUserAuthWithSecrets",
	"value": {
		"apiKey": "testuser",
		"name": "On-the-go-user#openhab",
		"createDate": "2023-12-155T21:18:37.978314",
		"lastUseDate": "2023-12-15T21:30:06.256076",
		"clientKey": "testuser"
	}
}

And now the endpoints are working, not showing “Not Authorized”.
Seems all my issues are gone with a single file that needed manual creation. If there was only a documentation.

1 Like

Hi there,
After that a system restart is necessary? Because for me it is still not working.
Any other hints?
Are you using openhab 4?
Thanks in advance,
Edizius

P.S.: I also do not get where the manual, textual, configuration for the binding should be done, which is refered in the manual. (E.g. ```
org.openhab.hueemulation:restrictToTagsSwitches=NONE
org.openhab.hueemulation:restrictToTagsWhiteLights=Lighting,Switchable
org.openhab.hueemulation:restrictToTagsColorLights=ColorLighting