Page 4 of 8

Re: Philips Hue app?

Posted: 08 Jan 2017 01:39
by klaasjoerg
Okay, double click helped.... ;-)
I selected "PhilipsHue"-App
Worked basically now, but do not really now how to get informations about hue-app shown...most of the times it's interrupting in automation-scripts but nothing really shown for hue at all....
(Unless I completely misunderstood this whole tool)

Re: Philips Hue app?

Posted: 08 Jan 2017 03:53
by PoltoS
Just a console.log should work - place a console.logJS(...) as mentioned above to see the structure of the object.

Re: Philips Hue app?

Posted: 08 Jan 2017 15:30
by klaasjoerg
I've no clue how this nodedebugger really works and how to use it properly. After playing around with it some time, i simply choosed to redirect stuff to console.log to get at least some results.

So finally I simply added console.log(+JSON.stringify(rsp)); to get some further object informations...
Here the results:

1. "deviceLights" is empty

2. "rsp.lights" is also empty

only

3. console.log(+JSON.stringify(rsp)); gave me the following results (shortened...)
So, that looks good to me so far.

Code: Select all

{
	"status": 200,
	"statusText": "OK",
	"url": "http://192.168.1.54/api/XXXXXXXXXXXXX",
	"headers": {
		"Access-Control-Allow-Credentials": "true",
		"Access-Control-Allow-Headers": "Content-Type",
		"Access-Control-Allow-Methods": "POST, GET, OPTIONS, PUT, DELETE, HEAD",
		"Access-Control-Allow-Origin": "*",
		"Access-Control-Max-Age": "3600",
		"Cache-Control": "no-store, no-cache, must-revalidate, post-check=0, pre-check=0",
		"Connection": "close",
		"Content-type": "application/json",
		"Expires": "Mon, 1 Aug 2011 09:00:00 GMT",
		"Pragma": "no-cache"
	},
	"contentType": "application/json",
	"data": {
		"lights": {
			"1": {
				"state": {
					"on": true,
					"bri": 150,
					"hue": 10233,
					"sat": 154,
					"effect": "none",
					"xy": [0.4945, 0.3911],
					"ct": 432,
					"alert": "none",
					"colormode": "hs",
					"reachable": true
				},
				"type": "Extended color light",
				"name": "Stehlampe Kühlschrank",
				"modelid": "LCT007",
				"manufacturername": "Philips",
				"uniqueid": "00:17:88:01:10:25:5a:2a-0b",
				"swversion": "5.50.1.19085"
			},
			"2": {
				"state": {
					"on": true,
					"bri": 150,
					"hue": 10497,
					"sat": 133,
					"effect": "none",
					"xy": [0.4775, 0.3902],
					"ct": 399,
					"alert": "none",
					"colormode": "hs",
					"reachable": true
				},
				"type": "Extended color light",
				"name": "Stehlampe Esszimmer",
				"modelid": "LCT007",
				"manufacturername": "Philips",
				"uniqueid": "00:17:88:01:10:4a:bd:13-0b",
				"swversion": "5.50.1.19085"
			},
			"3": {
				"state": {
					"on": false,
					"bri": 254,
					"hue": 11799,
					"sat": 254,
					"effect": "none",
					"xy": [0.5568, 0.4299],
					"alert": "none",
					"colormode": "xy",
					"reachable": true
				},
				"type": "Color light",
				"name": "Aussenschrank",
				"modelid": "LST001",
				"manufacturername": "Philips",
				"uniqueid": "00:17:88:01:00:ce:38:72-0b",
				"swversion": "5.23.1.13452"
			},
and so on,. and so on....

Re: Philips Hue app?

Posted: 08 Jan 2017 22:33
by bedaone
I've been looking into the app as well, found the following additional issues in the createDevices function:

- The "lights" are located in the "data" structure, so change rsp.lights --> rsp.data.lights (line ~97)
- The deviceLights array is indexed incorrectly, change "deviceLights.lightId.state --> deviceLights[lightId].state"
- The call to createDevice uses an incorrect param, change the last one to "uniqueId"

Overall, my createDevices function now looks like this:

Code: Select all

PhilipsHue.prototype.createDevices = function(rsp){
        console.log("PhilipsHue Create Devices");
        var moduleName = "PhilipsHue",
            self = this,
            deviceLights = rsp.data.lights;

        var lightId = 1;

        while (deviceLights[lightId].state != "undefined" && lightId < 5) {
                var device = deviceLights[lightId],
                    state = device.state.on,
                    brightness = device.state.bri,
                    color = device.state.hue,
                    saturation = device.state.sat,
                    uniqueId = device.uniqueid,
                    name = device.name;

        self.createDevice('light', lightId, name, uniqueId);

        lightId++;
        }

};
...and devices are now created for my Hue lamps. Unfortunately, there seems to be more issues when attempting to use the created devices. For the moment, i'm having more luck with the app by Minux, which is working well.

Re: Philips Hue app?

Posted: 09 Jan 2017 13:57
by PoltoS
Indeed, looking on the logJS output rsp.lights -> rsp.data.lights wil be the correct fix.

Re: Philips Hue app?

Posted: 10 Jan 2017 02:38
by Minux
Hello, can someone explain me where come from the official version ? Just by curiosity. I will add github repo as soon as possible.

Re: Philips Hue app?

Posted: 11 Jan 2017 01:08
by klaasjoerg
Uuhh...have been debugging a bit further, and to be true:
The current version of this app/module is not working well with Hue-Lights at all.
After some further tweaking, at least now it works so far, although there is no status-refresh implemented and also no "real" color selections.
However, before I am going to tune this up for myself only, is there a github-Project page for this app to branch somewhere or should I rewrite it only for myself?

Re: Philips Hue app?

Posted: 11 Jan 2017 01:47
by PoltoS
I don't know who is owning this in git. Will ask colleagues. But if you make that fix, we will with pleasure accept your pull request to share with others

Re: Philips Hue app?

Posted: 12 Jan 2017 11:52
by luispedro
Sorry for a quick of topic.
I'm looking for the "PhilipsHue" app on the AppStore but I can't find it!
I'm coming from Domoticz and very new to Z-WAVE>Me.
Can someone point me out the way to get that app which is the main reason I was on Domoticz?
LP

Re: Philips Hue app?

Posted: 12 Jan 2017 12:11
by PoltoS
It is called Philips Hue. Make sure to look in Online Apps and reset "Featured" filter (check All)