What can be done with HTTP Binding & Philips Hue API

Hi Everyone im looking to improve my setup and have a few questions about Hue

Summary: My hue setup works fine & is connected to OH using the Official Binding and the Motion sensors Using the HTTP Binding im wondering what else can be done using the http binding

  1. Can I use these that I have found in the Bridge API under http://192.168.0.73/api/========/sensors to provide information to if the sensors are online and working fine iif so how would i get this info into OH?
reachable":true
certified":true
"alert":"none"
  1. does zigbee have a signal strengh that i can pull from he hub ?

  2. What else can be pulled or sent too the hub?

someone gave me this code a while ago i think it was @cweitkamp does anyone have different code what other things can i do ?

rule "Switch Hue Motion Sensor ON / OFF"
when
    Item hueMotionSensorStatus changed
then
    val url = "http//:192.168.0.73/api/m=====================Yi/sensors/15/config"
    var String body = ""
    if( hueMotionSensorStatus.state != ON ) {
        body = '{"on":false}'
    } else {
        body = '{"on":true}'
    }
    logInfo("demo", "Send command '{}' to {}", body, url)
    sendHttpPutRequest(url, "application/json", body)
end

This code allows you to enable/disable a motion sensor without using the app its using the http binding not the official hue binding

  1. I thought all that info was already available as a Channel for the Things discovered by the Hue binding. Or at least that information is rolled up into the Online/Offline status of the Thing. Are you sure you need to access this data separately through the HTTP binding?

  2. Zigbee is a mesh network. The signal strength really isn’t all that meaningful. Just because a device has a poor signal strength to the controller doesn’t tell you much as the network is designed to route the message across the other nodes in that case.

  3. Read up on the Hue APi and that will tell you what you can pull, though I suspect there is not much available that the binding doesn’t already provide. It is one of the more heavily used and developed on bindings.

Hi,
you can use the httpbinding to make request to the bridge via Philips Hue API; I have an example here where I get the event push button of a Hue Tap since is not supported by the hue binding (it can be used for the dimmer kit and also for the motion sensor).
Hope it helps.

Rich the only things supported by the hue binding is the hub and the bulbs themselfs

Motion sensors / Switches / hue tap are not supported by the hue binding you have too use the http binding too add these devices I have already done this.

I was just wondering what else is on the api and what else can be done I’m using the motion sensors for part of my security system and would like too add a sort of heath check too make sure stuff Is still working as expected

My Motion sensors don’t have a thing as they a created by the http binding

@mortommy
Thanks for that I will have a look

@rlkoshak

Is there a way too practice with a virtual machine?

Or should I just dive straight into it

A Virtual Machine is a way to run a whole virtual computer on top of another computer. So if you can do it on a hardware computer, you can do it on a VM.

But that can be pretty challenging to set up in the first place, so you have to decide if the benefits are worth the extra complexity and work necessary to set up a VM in the first place.

VirtualBox is a pretty popular one.

@rlkoshak sorry

I posted this in the wrong thread I was ment too post it in the one where I was asking about running on a rpi

Should I try too learn with a virtual machine or dive straight in with a rpi

I have found Documetation on the hue api

https://www.developers.meethue.com/philips-hue-api

And the Reachable item is perfect too add too my setup for a health check making sure security motion sensors are online and functioning as expected

Im not sure how too do this here is what i have got i would like someone more experienced than me too tell me if i have done this right or not (It seems too function)

Transform file: I havent got a clue how too use these files i just edited one i have for a different job

(function(i) {
    var json = JSON.parse(i);
    return ((json['state']['reachable'])) == true ? "OFF" : "ON";
})(input)

Named: getHueReachable.js

Item:

Switch 	Kitchen_Reachable "Kitchen Reachable"<switch>                  { http="<[http://192.168.0.73/api/{UNIQUE KEY}/sensors/7:3000:JS(getHueReachable.js)]" }

here is a repsonse from my hue bridge api

{"state":{"presence":false,"lastupdated":"2018-06-25T18:30:35"},"swupdate":{"state":"noupdates","lastinstall":null},
"config":{"on":true,"battery":100,"reachable":true,"alert":"none",
"ledindication":false,"usertest":false,"sensitivity":2,"sensitivitymax":2,"pending":[]},"name":"Front Door sensor","type":"ZLLPresence","modelid":"SML001","manufacturername":"Philips","productname":"Hue motion sensor","swversion":"6.1.0.18912","uniqueid":"**:**:88:**:**:**:f0:**-02-0406","capabilities":{"certified":true}}

looking at the answer from the bridge I’d say:

(function(i) {
    var json = JSON.parse(i);
    return ((json['config']['reachable'])) == true ? "ON" : "OFF";
})(input)