Closed mwittig closed 8 years ago
It works as expected for a real bridge. The problem is with the Hue Emulator.
To make a conversion between rgb into the xy co-ordinates, a conversion has to be made that is specific to the model of the bulb that is the target. This conversion is done using information on the modelid
that is returned from light status for the id of the light.
I took a very quick look at the code the for Hue Emulator and could not find the location of where it is getting the configuration of the lights, so cannot comment if it is hard coded, or something that a user of the emulator provides.
If you turn on the long stack traces for Q, https://github.com/kriskowal/q#long-stack-traces, you should be able to see more information as to where the real problem lies.
Well, I don't think so. Here is the configuration the emulator is using. As you can see the bulbs have a proper modelid "LCT001" used for Hue A19. Also the colormode is set. Is there anything else missing your library is using for conversion?
{
"lights": {
"1": {
"state": {
"on": true,
"bri": 254,
"hue": 4444,
"sat": 254,
"xy": [0.0,
0.0],
"ct": 0,
"alert": "none",
"effect": "none",
"colormode": "hs",
"reachable": true
},
"type": "Extended color light",
"name": "Hue Lamp 1",
"modelid": "LCT001",
"swversion": "65003148",
"uniqueid": "00:17:88:01:00:d4:12:08-0a",
"pointsymbol": {
"1": "none",
"2": "none",
"3": "none",
"4": "none",
"5": "none",
"6": "none",
"7": "none",
"8": "none"
}
},
"2": {
"state": {
"on": true,
"bri": 254,
"hue": 23536,
"sat": 144,
"xy": [0.346,
0.3568],
"ct": 201,
"alert": "none",
"effect": "none",
"colormode": "hs",
"reachable": true
},
"type": "Extended color light",
"name": "Hue Lamp 2",
"modelid": "LCT001",
"swversion": "65003148",
"uniqueid": "00:17:88:01:00:d4:12:08-0b",
"pointsymbol": {
"1": "none",
"2": "none",
"3": "none",
"4": "none",
"5": "none",
"6": "none",
"7": "none",
"8": "none"
}
},
"3": {
"state": {
"on": true,
"bri": 254,
"hue": 65136,
"sat": 254,
"xy": [0.346,
0.3568],
"ct": 201,
"alert": "none",
"effect": "none",
"colormode": "hs",
"reachable": true
},
"type": "Extended color light",
"name": "Hue Lamp 3",
"modelid": "LCT001",
"swversion": "65003148",
"uniqueid": "00:17:88:01:00:d4:12:08-0c",
"pointsymbol": {
"1": "none",
"2": "none",
"3": "none",
"4": "none",
"5": "none",
"6": "none",
"7": "none",
"8": "none"
}
}
},
"schedules": {
"1": {
"time": "2012-10-29T12:00:00",
"description": "",
"name": "schedule",
"command": {
"body": {
"scene": null,
"on": true,
"xy": null,
"bri": null,
"transitiontime": null
},
"address": "/api/newdeveloper/groups/0/action",
"method": "PUT"
}
}
},
"config": {
"portalservices": false,
"gateway": "192.168.178.1",
"mac": "00:00:88:00:bb:ee",
"swversion": "01005215",
"linkbutton": false,
"ipaddress": "192.168.178.70:8000",
"proxyport": 0,
"swupdate": {
"text": "",
"notify": false,
"updatestate": 0,
"url": ""
},
"netmask": "255.255.255.0",
"name": "Philips hue",
"dhcp": true,
"proxyaddress": "",
"whitelist": {
"newdeveloper": {
"name": "test user",
"last use date": "2012-10-29T12:00:00",
"create date": "2012-10-29T12:00:00"
}
},
"UTC": "2012-10-29T12:05:00"
},
"groups": {
"1": {
"name": "Group 1",
"action": {
"on": true,
"bri": 254,
"hue": 33536,
"sat": 144,
"xy": [0.346,
0.3568],
"ct": 201,
"alert": null,
"effect": "none",
"colormode": "xy",
"reachable": null
},
"lights": ["1",
"2"]
}
},
"scenes": {
}
}
I put together a quick test on the latest 2.0.1
version of the API against the 0.7
version of the Hue Emulator using the configuration you provided above. I bound the emulator to localhost port 80.
It worked for me with no errors.
What version of the API and Hue Emulator are you using, 0.6? The config above would not load into the 0.6 version of the Hue Emulator for me. Are you getting any requests showing up in the emulator? If not, try turning on the long stack traces, or use another library like longjohn that will generate a more complete stack trace that could give me something more to go on.
I am testing against the latest version 0.6 of the Hue Emulator.
... gives me the following error:
If I use
.hsl()
instead it works fine. For this reason I guess it is problem withnode-hue-api
.