I've got the free version of PRTG running at home, and I've also got quite a few Hue lights, and I was interested in seeing if I could keep tabs of the reachability of the Hue bulbs - for fun, just to try out the possibilities.

The API call to look up a specific light status is as follows:

http://192.168.0.111/api/77DiCq1MBnwE4W9IbIoVonQ65moMIseEuw6ui-sB/lights/10

And this is the JSON response.

{
"state": {
"on": true,
"bri": 254,
"hue": 14956,
"sat": 140,
"effect": "none",
"xy": [
  0.4571,
  0.4097
],
"ct": 366,
"alert": "none",
"colormode": "ct",
"reachable": true
},
"type": "Extended color light",
"name": "Bonus Room Desk",
"modelid": "LCT007",
"manufacturername": "Philips",
"uniqueid": "00:17:88:01:10:5a:79:90-0b",
"swversion": "5.50.1.19085"
}

I was using the HTTP XML/Rest Value sensor to try and test the result - I'd rather not have to write a custom sensor for this. Unfortunately, while I can point at the value for "reachable" with "state/reachable" in the XML Node, I'm not sure how to determine whether the value is "true" or "false".

Ideas?


Article Comments

Hi there,

The best way to check if the value at "reachable" is set to "true" is to use the "HTTP Advanced Sensor". There you enable/set the following options:

  • URL: the URL to the JSON-API
  • Require Keyword: Set sensor to error if keyword is missing
  • Response must include: (it's regular expressions, you can test it with Rubular)
"reachable":\strue
  • Check Method: Regular Expressions

Best regards.


May, 2017 - Permalink