Philips Hue app?

Discussions about Z-Way software and Z-Wave technology in general
klaasjoerg
Posts: 61
Joined: 30 Sep 2016 23:49

Re: Philips Hue app?

Post by klaasjoerg » 08 Jan 2017 01:39

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)

User avatar
PoltoS
Posts: 3416
Joined: 26 Jan 2011 19:36

Re: Philips Hue app?

Post by PoltoS » 08 Jan 2017 03:53

Just a console.log should work - place a console.logJS(...) as mentioned above to see the structure of the object.

klaasjoerg
Posts: 61
Joined: 30 Sep 2016 23:49

Re: Philips Hue app?

Post by klaasjoerg » 08 Jan 2017 15:30

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....

bedaone
Posts: 1
Joined: 08 Jan 2017 22:22

Re: Philips Hue app?

Post by bedaone » 08 Jan 2017 22:33

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.

User avatar
PoltoS
Posts: 3416
Joined: 26 Jan 2011 19:36

Re: Philips Hue app?

Post by PoltoS » 09 Jan 2017 13:57

Indeed, looking on the logJS output rsp.lights -> rsp.data.lights wil be the correct fix.

Minux
Posts: 19
Joined: 26 Oct 2014 13:06

Re: Philips Hue app?

Post by Minux » 10 Jan 2017 02:38

Hello, can someone explain me where come from the official version ? Just by curiosity. I will add github repo as soon as possible.

klaasjoerg
Posts: 61
Joined: 30 Sep 2016 23:49

Re: Philips Hue app?

Post by klaasjoerg » 11 Jan 2017 01:08

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?

User avatar
PoltoS
Posts: 3416
Joined: 26 Jan 2011 19:36

Re: Philips Hue app?

Post by PoltoS » 11 Jan 2017 01:47

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

luispedro
Posts: 5
Joined: 12 Jan 2017 11:50

Re: Philips Hue app?

Post by luispedro » 12 Jan 2017 11:52

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

User avatar
PoltoS
Posts: 3416
Joined: 26 Jan 2011 19:36

Re: Philips Hue app?

Post by PoltoS » 12 Jan 2017 12:11

It is called Philips Hue. Make sure to look in Online Apps and reset "Featured" filter (check All)

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests