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