Hue Emulation on 2.4

Sorry David but https://www.openhab.org/addons/integrations/hueemulation/
does not mention that it can be turned on from script. + it does not tell how.

It clearly does: openHAB Hue Emulation - System Integrations | openHAB

As far as I know files under “/var/lib/openhab2/” should not be changed manually.

no. It that section says

“All options are available in Paper UI.”

It does not mention what script to change

Sigh. That’s what I’m saying. It is not my responsibility to tell you that in this document. We would bloat all binding and service documents if we explain how everything can be done in every possible way.

All the mentioned key=value configs can be put in any file with any name, as long as the file is under services/ and ends with “.cfg”.

I’m mentioning Paper UI, because in all other services they say “create a awesome-name.cfg file with this content” which is absolutely biased towards textual, but personally I like Paper UI much more and my document is biased towards UI, that’s all.

1 Like

I can think of several files under /var/lib/openhab2/ that I modify regularly, the most notable of which is org.ops4j.pax.logging.cfg. There is even official OH documentation of that use case.

Not to belabor the point, but I just conducted a search of the OH general documentation and I failed to find a general statement describing binding configuration under $USER_CONF/service/. Perhaps my googl-fu is not strong enough. If you would, please direct me to that documentation so I can bookmark it.

Yeah that’s the place. I really don’t do textual, so can’t recall the file locations.

maybe it’s different on my system.
The changes I make are always in etc/openhab2/*

Then please mention the exact file here.

As I have been using openhab more then 3 years and I can’t figure out what file I need to use for the hue emulation service.

The file name doesn’t matter. Internally all files are merged and each line is applies to the OSGI config service.

Then something else is wrong and I don’t get any feedback in the logging.

I have a file hueemulation.cfg
In /etc/openhab2/services
(where all the other .cfg are working)

In the file I have

org.openhab.hueemulation:pairingEnabled=true
org.openhab.hueemulation:createNewUserOnEveryEndpoint=true
org.openhab.hueemulation:restrictToTagsWhiteLights=Lighting

Normally when I save such a file in that folder, it’s run/interpreted immediatly by openhab
when it’s configuration turns on a new service, I see changes of values read or something.
In this case there are no new values (logical) so I don’t know if it’s working

yet when I let alexa search for new devices on the network, it does not find any.
(The old ones are gone)

And yes the items file have not changed and do contain Lightning

f ex

Switch Alexa_Kitchen_Light “Kitchen” <light> (gGF_Kitchen ) [ “Lighting” ]

so there must be something else I can’t figure out if it’s not the file name

1 Like

Try removing the prefix string org.openhab.hueemulation: for each setting. Also, put double quotes around true and prefix that value with ‘B’.

pairingEnabled=B"true"
createNewUserOnEveryEndpoint=true
restrictToTagsWhiteLights=Lighting

That was an exact copy from the documentation.
I tried it with and without the prefix

I now also tried it how you wrote it
same results: no information in the log and alexa can’t find anything

You should also be aware that leaving the pairingEnabled=B"true" will enable pairing every time you start your system. If it was me, after I successfully paired my emulated devices to Alexa, I would edit /etc/openhab2/hueemulation.cfg and change the value to B"false".

oh so this only works when starting openhab?
or also every time a file is toughed? (like the other services do)

I’m afraid I can’t help much more as I use the PaperUI to pair my emulated devices to Alexa.

Here are the contents of /var/lib/openhab2/config/org/openhab/hueemulation.config (auto-generated by the Hue Emulation binding) from my system:

createNewUserOnEveryEndpoint=B"false"
discoveryHttpPort="80"
discoveryIp="192.168.1.205"
pairingEnabled=B"false"
pairingTimeout="60"
restrictToTagsColorLights="ColorLighting"
restrictToTagsSwitches="Switchable"
restrictToTagsWhiteLights="Lighting,Switchable"
service.pid="org.openhab.hueemulation"

I have a firewall rule in place to forward connections on port 80 to port 8080.

I would try restarting OH.

yeah I was afraid that a restart might be needed, I sure hope not.
Will try tomorrow, I won’t restart Openhab with everyone sleeping.

y