Use the OH console command to identify the things in your bridge…
> openhab:hue hue:bridge-api2:001788fffeac5c8f things
Use the OH console command to identify the things in your bridge…
> openhab:hue hue:bridge-api2:001788fffeac5c8f things
That’s how I created my new things file. But they are not online but unknown. I think I have about 90 lights. I will try tomorrow again, the name of the thing and the name of that item linked to the thing is the same, maybe that’s the issue. Will check that tomorrow.
Ok. Then try the following (with your Hue Bridge IP address and application key…
curl --insecure -H "hue-application-key: ABCDEFGHIJKLMNOPQRSTUVWXYZ" -X GET "https://192.168.1.123/clip/v2/resource/device"
I got 2 lights working. I removed all of my things, stopped the binding, stopped openhab, cleaned cache en restarted. The two tings where working, connected to an item and controlable. So i added my other Things and none of the Things where online and neither of them where working.
I am still testing but the binding / Openhab has a strange behaviour. When I remove all of my Things from my things file, they do not disappear in the UI. Even when I stop and start the binding, they still exist with the status Unknown (I wait until cpu usage is normal / around 5% for a while). When I stop openhab and clean-cache, then they disappear, could be intentional for caching purposes but it is a bit strange I think.
I got it working like this:
Not sure if the adding by bundle of 10 things was mandatory but i noticed when i added a couple of things, it worked, so I added the rest also in parts.
This is, I think, expected behaviour. When the file still exists but is empty it’s invalid and will not reload, the cached version will be kept. If you remove(or rename) the file-extension, the things will be removed.
I read somewhere else that defining things in files is like removing and adding when openHAB is restarted, ie with restart of openHAB all those things will be re-added in one go.
Probably you have this issue…
Did not see that topic but it looks like it is that problem. Thnx!
You could try with 4.0.3.
Hi
I just upgraded to 4.0.3 and now I am seeing the following in the logs:
13:39:25.232 [WARN ] [g.hue.internal.connection.Clip2Bridge] - Resource '23974c17-b549-4566-926c-5ec6bb5cb683' type 'Error (taurus_7455)' unknown => GET aborted
13:39:25.311 [WARN ] [g.hue.internal.connection.Clip2Bridge] - Resource '76bc1346-61cc-495d-afe9-2605b9108f0a' type 'Error (taurus_7455)' unknown => GET aborted
13:39:25.353 [WARN ] [g.hue.internal.connection.Clip2Bridge] - Resource 'a4a2b6f5-feb3-42dd-a83a-5834299e2a5d' type 'Error (taurus_7455)' unknown => GET aborted
13:39:26.144 [WARN ] [g.hue.internal.connection.Clip2Bridge] - Resource 'abb6023e-d253-4f0c-b05b-a5c126f63472' type 'Error (taurus_7455)' unknown => GET aborted
13:39:26.243 [WARN ] [g.hue.internal.connection.Clip2Bridge] - Resource '185615c3-9fc2-4206-a5bf-bb0b5cc505c2' type 'Error (taurus_7455)' unknown => GET aborted
13:39:26.291 [WARN ] [g.hue.internal.connection.Clip2Bridge] - Resource '3409ce98-65be-442a-86bc-03758da23fc9' type 'Error (taurus_7455)' unknown => GET aborted
13:39:26.343 [WARN ] [g.hue.internal.connection.Clip2Bridge] - Resource 'f7c2f0ce-61b1-4f4c-b811-6c016d5aeead' type 'Error (taurus_7455)' unknown => GET aborted
13:39:26.438 [WARN ] [g.hue.internal.connection.Clip2Bridge] - Resource 'acc348ea-a859-4dfa-8c6b-1e46f712e88f' type 'Error (taurus_7455)' unknown => GET aborted
I do not see these when I try: openhab:hue hue:bridge-api2:513878a587 things
Any suggestions on what else to looks at?
This is known, but won’t cause any harm. See:
Upgraded to 4.0.3, so far it’s good.
This evening the complete binding stopped working for some reason. Updates from sensors and commands to lights weren’t working all of a sudden. I stopped openhab service, cleaned cache, upgraded to 4.0.3 and now it’s running again.
With the upgrade to OH4 I also upgraded to Hue API v2. With the API v1 I never had problems but with the API v2 the hue bridge went OFFLINE from time to time. Therefore I created a small script
which send a message when the status of the hue bridge changes … but I couldn’t find an OH function to DISABLE and ENABLE the hue bridge, which will solve the problem.
Attached find the hue messages from the LOG:
On 2023-09-09 04:40:58.213 the hue bridge went offline and I had to ENABLE and DISABLE the hue bridge.
2023-09-06 04:47:56.560 [WARN ] [.hue.internal.connection.Clip2Bridge] - Fatal error SessionListenerAdapter GO_AWAY => closing session.
2023-09-07 16:39:15.218 [WARN ] [.hue.internal.connection.Clip2Bridge] - Fatal error SessionListenerAdapter GO_AWAY => closing session.
> 2023-09-09 03:40:31.232 [WARN ] [.hue.internal.connection.Clip2Bridge] - Fatal error SessionListenerAdapter GO_AWAY => closing session.
> 2023-09-09 04:40:58.213 [WARN ] [mation.script.ui.HueBridgeStatusTest] - Hue Bridge Status: OFFLINE
2023-09-10 19:46:30.633 [WARN ] [mation.script.ui.HueBridgeStatusTest] - Hue Bridge Status: UNINITIALIZED
2023-09-10 19:46:30.666 [WARN ] [mation.script.ui.HueBridgeStatusTest] - Hue Bridge Status: UNINITIALIZED
2023-09-10 19:46:32.494 [WARN ] [mation.script.ui.HueBridgeStatusTest] - Hue Bridge Status: INITIALIZING
2023-09-10 19:46:32.512 [WARN ] [mation.script.ui.HueBridgeStatusTest] - Hue Bridge Status: UNKNOWN
2023-09-10 19:46:33.033 [WARN ] [mation.script.ui.HueBridgeStatusTest] - Hue Bridge Status: ONLINE
2023-09-12 03:07:42.049 [WARN ] [.hue.internal.connection.Clip2Bridge] - Fatal error SessionListenerAdapter GO_AWAY => closing session.
Do you know how to DISABLE and ENABLE the hue bridge with a script?
What version of OH are you using? The v4.0.3 latest patch release (and also latest snapshot builds) include some fixes to eliminate the GO_AWAY issue.
Umm. No…
I upgraded Openhabian to OH 4.0.3 and will check if HUE binding will work more stable.
Thanks for your support!
Hi @BG56,
I am checking in a rule (that runs every 15 minutes) if one HUE device is still online.
If not, I do a restart of the HUE binding:
when Time cron "0 0/15 * 1/1 * ? *"
then
if (getThingStatusInfo("hue:device:HUEUID").toString != "ONLINE") {
...
logInfo("Hue", "Hue-Bundle-Restart")
executeCommandLine(Duration.ofSeconds(6), "sshpass", "-p", "habopen", "ssh", "-oStrictHostKeyChecking=no", "-oUserKnownHostsFile=/dev/null", "-p8101", "openhab@localhost", "bundle:restart", "org.openhab.binding.hue")
...
}
Prerequisite is that ssh and sshpass is installed:
apt-get update
apt-get upgrade
apt-get install openssh-client
apt-get install sshpass
Works for me perfect.
Thank you @April_Wexler for your rule example. I tried to adjust your script but it fails at the executeCommandLine.
I’m not a Linux expert and don’t exactly understand the parameters in the executeCommandLine. By the way I have deinstalled Nashorn (old JavaScript) and build my Scripts with DSL, ECMAScript 262 Edition 11 and Blockly.
Hi @BG56
the executeCommandLine just looks weird, but to add space to the command, the “”, are needed.
The command (for testing on command line (bash) is:
sshpass -p habopen ssh -oStrictHostKeyChecking=no -oUserKnownHostsFile=/dev/null -p8101 openhab@localhost bundle:restart org.openhab.binding.hue
You need to install the exec-Binding (“binding-exec”).
Updated JARs are here…