[SOLVED] Hue Bridge and difference UID between Things and .things (files)

OH 2.5.5. and OpenHabian

I have a question about Hue Bridge and the difference UID from Things and .things (files)

a) in REST API is have to use this “UID”: “hue:bridge:ecb5fa2f2064” to fetch the data.

http://192.168.x.xxx:8080/rest/things/hue%3Abridge%3Aecb5fa2f2064

{
  "statusInfo": {
    "status": "ONLINE",
    "statusDetail": "NONE"
  },
  "editable": true,
  "label": "Philips hue (192.168.x.xxx)",
  "configuration": {
    "ipAddress": "192.168.x.xxx",
    "pollingInterval": 10,
    "sensorPollingInterval": 500,
    "userName": "xxxxx",
    "port": 80
  },
  "properties": {
    "protocol": "http",
    "macAddress": "xxxx",
    "serialNumber": "xxxx",
    "modelId": "xxxxx",
    "vendor": "Philips",
    "firmwareVersion": "xxxx"
  },
  "UID": "hue:bridge:ecb5fa2f2064",
  "thingTypeUID": "hue:bridge",
  "channels": []
}

b) My hue.things looks like this and it works. Hier is use only ID 1. Like demo.things from here: https://www.openhab.org/addons/bindings/hue/

Bridge hue:bridge:1 [ ipAddress="192.168.x.xxx", userName="xxxx" ] {
    0100  bulb1  "Lampe I (0100)"   @ "Studio"    [ lightId="1" ]
    0210  bulb2  "Lampe II (0210)"  @ "Studio"    [ lightId="2" ]
    0010  plug1  "Strom PlugIn 1 (0010)"  @ "Studio"    [ lightId="3" ]
}

c) My .rules only work is I use “hue:bridge:1”. What “changed” should I use ?

rule "Hue Bridge Status changed (hue-bridge-changed.rules)"
when 
    // Thing "hue:bridge:ecb5fa2f2064" changed
    Thing "hue:bridge:1" changed
then
    var thingStatusInfo = getThingStatusInfo("hue:bridge:1").getStatus()

    if (thingStatusInfo !== null)  {
        logInfo("Hue Bridge Status:", thingStatusInfo.getStatus().toString())
    } else {
        logError("ThingStatus", "The Hue Bridge is offline or doesn't exist.")
    }
   
end	

Question:
Where is the connection between “hue:bridge:1” (.things) and “hue:bridge:ecb5fa2f2064” (UID API UID).
What is the correct use “hue:bridge:1” or “hue:bridge:ecb5fa2f2064”

Thanks!
Thomas

Looks like you created two Bridges one with Inbox of Paper UI, the other with the things file.
Take a look at Paper UI Configurations Things and take a look to the Bridges and the things which should show you which bridge they are connected to.

1 Like

hi uwe,

no, I’m afraid not.

I loaded all links via REST API and filtered the result.
http://192.168.x.xxx:8080/rest/links

This is all that comes out:

[testjson.js at line 82, column 19]      "channelUID": "hue:0210:1:bulb2:color_temperature",
[testjson.js at line 87, column 19]      "channelUID": "hue:0210:1:bulb2:color",
[testjson.js at line 112, column 19]      "channelUID": "hue:0210:1:bulb2:color",
[testjson.js at line 146, column 17]      "itemName": "HueBridgeOnline"
[testjson.js at line 159, column 19]      "channelUID": "hue:0100:1:bulb1:brightness",
[testjson.js at line 231, column 19]      "channelUID": "hue:0210:1:bulb2:color",
[testjson.js at line 241, column 19]      "channelUID": "hue:0010:1:plug1:switch",

I find no hue bridge

EDIT:

in the meantime, I have all channels

changed from “hue:bridge:1” to "hue:bridge:ecb5fa2f2064

this seems to be the solution for now. However, I still don’t understand the documentation for ID :1.

Thank you and best regards
Thomas

Links are not Things.

Yes, Links are not Things.

After changing the “hue:bridge:1” to “hue:bridge:ecb5fa2f2064”, I can’t find any reference to “hue:bridge:1” in the list of all OH Things (REST API) anymore. Ok, hat’s it, except for the initial question:

Why does the documentation say “hue:bridge:1” (demo.things)? What does the :1 mean in this case? Should I use it or is it better to search for the real hue:bridge:id?

Thanks!
Thomas

hue:bridge:blah is a Unique Identifier for a Thing - UID

The hue part is about the binding it relates to.
The bridge part is about the kind of Thing it is.
The blah part is the “name” that you give to it that makes it unique among hue:bridge Things. People often use something meaningful. Auto discovery processes offer some random ID (which you can choose to accept or not).
It doesn’t matter much to the system what you choose, but it is a vital reference for linking parts together, like Items and devices.

2 Likes