Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

set xy instead of hue for not Philips Hue Bulbs is not working #11

Closed
dercaptainbc opened this issue Oct 31, 2019 · 28 comments
Closed

set xy instead of hue for not Philips Hue Bulbs is not working #11

dercaptainbc opened this issue Oct 31, 2019 · 28 comments
Labels
bug Something isn't working verify-fix Verify if the implemented fix has solved the issue

Comments

@dercaptainbc
Copy link

Again me .. I found out that Verwenden von XY anstelle von hue (nur für nicht-Philips-Geräte) is not working correct. Please take a look on the attached log

first value will be converted to null.

p.s.: Sorry for the hugh amount of reported issues, but thats my job (I'm working as quality assurance engineer 😄

Quelle Zeit debug Meldung
hue-extended.0 2019-10-31 15:46:14.721 debug (15988) Successfully set /lights/13/state/sat on Deckenlampe (to 196).
hue-extended.0 2019-10-31 15:46:14.720 debug (15988) Successfully set /lights/13/state/hue on Deckenlampe (to 40595).
hue-extended.0 2019-10-31 15:46:14.718 debug (15988) Successfully set /lights/13/state/transitiontime on Deckenlampe (to 50).
hue-extended.0 2019-10-31 15:46:14.716 warn (15988) Attempt 1x - Error setting /lights/13/state/xy: invalid value, [null,, for parameter, xy
hue-extended.0 2019-10-31 15:46:14.670 debug (15988) Attempt 1x - Send commands to Deckenlampe (lights/13/state): {"hue":40595,"sat":196,"transitiontime":50,"xy":[null,0]}.
hue-extended.0 2019-10-31 15:46:14.668 debug (15988) State of hue-extended.0.lights.013-deckenlampe.action._commands has changed {"val":"{"hue":223,"sat":196,"transitiontime":50}","ack":false,"ts":1572533174659,"q":0,"from":"system.adapter
hue-extended.0 2019-10-31 15:46:09.720 debug (15988) Successfully set /lights/13/state/hue on Deckenlampe (to 49333).
hue-extended.0 2019-10-31 15:46:09.717 warn (15988) Attempt 1x - Error setting /lights/13/state/xy: invalid value, [null,, for parameter, xy
hue-extended.0 2019-10-31 15:46:09.643 debug (15988) Attempt 1x - Send commands to Deckenlampe (lights/13/state): {"hue":49333,"xy":[null,0.33085697021029925]}.
hue-extended.0 2019-10-31 15:46:09.627 debug (15988) State of hue-extended.0.lights.013-deckenlampe.action._commands has changed {"val":"{"hue":271,"sat":209,"bri":254,"on":true}","ack":false,"ts":1572533169614,"q":0,"from":"system.adapt
@Zefau Zefau added the bug Something isn't working label Oct 31, 2019
@Zefau
Copy link
Collaborator

Zefau commented Oct 31, 2019

Could you try and install v1.1.5 from Github and verify whether this is fixed?

@Zefau Zefau added the verify-fix Verify if the implemented fix has solved the issue label Oct 31, 2019
@dercaptainbc
Copy link
Author

not really. Now both values are 0

@dercaptainbc
Copy link
Author

dercaptainbc commented Oct 31, 2019

Quelle Zeit debug Meldung
hue-extended.0 2019-10-31 17:39:32.020 info (20027) Attempt 1x - Successfully set Deckenlampe.
hue-extended.0 2019-10-31 17:39:32.019 debug (20027) Successfully set /lights/13/state/xy on Deckenlampe (to 0,0).
hue-extended.0 2019-10-31 17:39:32.017 debug (20027) Successfully set /lights/13/state/sat on Deckenlampe (to 209).
hue-extended.0 2019-10-31 17:39:32.014 debug (20027) Successfully set /lights/13/state/transitiontime on Deckenlampe (to 50).
hue-extended.0 2019-10-31 17:39:31.978 debug (20027) Attempt 1x - Send commands to Deckenlampe (lights/13/state): {"sat":209,"transitiontime":50,"xy":[0,0]}.
hue-extended.0 2019-10-31 17:39:31.976 debug (20027) State of hue-extended.0.lights.013-deckenlampe.action._commands has changed {"val":"{"hue":271,"sat":209,"transitiontime":50}","ack":false,"ts":1572539971968,"q":0,"from":"system.adapter

@Zefau
Copy link
Collaborator

Zefau commented Oct 31, 2019

Could you try and install the latest version from Github (version number stays unchanged) ?
Hope that fixes it. Hard for me to test, because I only have Hue lights connected.

@dercaptainbc
Copy link
Author

ok .. my mistake now it looks good. but the colors are not matching. I send the following command to a hue and to a tradfri bulb : {"hue":271,"sat":209,"on":true,"bri":254}

and the hue is purple but the tradfri is red/orange.

In case that I've send the command to a mixed group (hue and tradfri) the color is alos red/orange not purple (I mean not the really color (this also btw), I mean the color which I can see in the hue app)

I think the converting is not 100% correct at the moment.

@Zefau
Copy link
Collaborator

Zefau commented Oct 31, 2019

Could you provide the log of the commands send to the bridge?

@dercaptainbc
Copy link
Author

Quelle Zeit debug Meldung
hue-extended.0 2019-10-31 20:23:32.671 info (5910) Attempt 1x - Successfully set test.
hue-extended.0 2019-10-31 20:23:32.669 debug (5910) Successfully set /groups/4/action/xy on test (to 0.6484,0.3309).
hue-extended.0 2019-10-31 20:23:32.667 debug (5910) Successfully set /groups/4/action/bri on test (to 254).
hue-extended.0 2019-10-31 20:23:32.665 debug (5910) Successfully set /groups/4/action/on on test (to true).
hue-extended.0 2019-10-31 20:23:32.571 debug (5910) Attempt 1x - Send commands to test (groups/4/action): {"on":true,"bri":254,"xy":[0.6484,0.3309]}.
hue-extended.0 2019-10-31 20:23:32.568 debug (5910) State of hue-extended.0.groups.004-test.action._commands has changed {"val":"{"hue":271,"sat":209,"on":true,"bri":254}","ack":false,"ts":1572549812558,"q":0,"from":"system.adapter.admin

@dercaptainbc
Copy link
Author

dercaptainbc commented Oct 31, 2019

I've checked the values in following calculator : http://colorizer.org/

X = 64.84 (0.6484)
Y = 33.09 (0.3309)

and I guess the issue is on z value side. when z is 0 I get red light but if its 1 its purple.

@Zefau
Copy link
Collaborator

Zefau commented Oct 31, 2019

Could you try and use _commands with the input {"on":true,"xy":[0.6484,0.3309]} (no bri because it should be included in xy).

@dercaptainbc
Copy link
Author

Its still red.

Is it possible to set the Z value? From my point of view I guess a fix value of 50 (0.5) would be good.

@dercaptainbc
Copy link
Author

Quelle Zeit debug Meldung
hue-extended.0 2019-10-31 20:38:47.844 info (5910) Attempt 1x - Successfully set Badezimmer.
hue-extended.0 2019-10-31 20:38:47.843 debug (5910) Successfully set /groups/2/action/xy on Badezimmer (to 0.6484,0.3309).
hue-extended.0 2019-10-31 20:38:47.797 debug (5910) Attempt 1x - Send commands to Badezimmer (groups/2/action): {"xy":[0.6484,0.3309]}.
hue-extended.0 2019-10-31 20:38:47.793 debug (5910) State of hue-extended.0.groups.002-badezimmer.action._commands has changed {"val":"{"on":true,"xy":[0.6484,0.3309]}","ack":false,"ts":1572550727785,"q":0,"from":"system.adapter.admin.0","us

@Zefau
Copy link
Collaborator

Zefau commented Oct 31, 2019

Where on the page you've linked do you see the xy values?
If I type in the HSB hsb(271, 82, 100) values I get RGB rgb(154, 46, 255). Where do you see xy values?

@dercaptainbc
Copy link
Author

At the end you can open a closed view with xyz values

@Zefau
Copy link
Collaborator

Zefau commented Oct 31, 2019

That shows 32.34, 16.03, 96 for me?

@Zefau
Copy link
Collaborator

Zefau commented Oct 31, 2019

I think the correct colors for purple is {"on":true,"xy":[0.2496, 0.1029]}.

@dercaptainbc
Copy link
Author

dercaptainbc commented Oct 31, 2019

in my script i used the following hue and sat values

var huePurple = 271;
var satPurple = 209;

and this values I send per _commands

and when I add this in the converter hue = 271 , sat = 82,28 (instead of 209) V = 100
I get x 32.24 (0.3224) y 15,94 (0.1594) and z 95.99 and yes RGB is rgb(154, 45, 255)

@Zefau
Copy link
Collaborator

Zefau commented Oct 31, 2019

I think the Hue xy is different from the standard color space xyz.

Could you try {"on":true,"xy":[0.2496, 0.1029]} (in _commands) just to see the result?

@dercaptainbc
Copy link
Author

yes. its purple not exatly that kind of purple which I used in my script but yes purple.

@Zefau
Copy link
Collaborator

Zefau commented Oct 31, 2019

Updated again just now. Could please try and install current version from Github and test if the color works?

@dercaptainbc
Copy link
Author

at the moment also for hue lamps (in my case hue play and hue e14) the XY value will used not hue and sat anymore.

and its still not the same color.

@Zefau
Copy link
Collaborator

Zefau commented Nov 1, 2019

You have reinstalled the current version from Github, right?

What is your exact configuration? Are you setting a group with those two lights being part of it?
What does the state manufacturername of these lamps hold?

Could you additionally please provide the log from the time you trigger until the command is applied by the adapter?

Thanks for your support.

@dercaptainbc
Copy link
Author

Yes, exactly!

My group setup (Zone) is 2 x Hue Plays ( manufacturername : Philips ) and 1 x Hue color candle ( manufacturername : Philips )

Quelle Zeit debug Meldung
hue-extended.0 2019-11-01 12:33:21.640 info (23853) Attempt 1x - Successfully set Balkon.
hue-extended.0 2019-11-01 12:33:21.639 debug (23853) Successfully set /lights/23/state/xy on Balkon (to 0.7126,0.2874).
hue-extended.0 2019-11-01 12:33:21.596 info (23853) Attempt 1x - Successfully set Hue play Rechts.
hue-extended.0 2019-11-01 12:33:21.594 debug (23853) Successfully set /lights/24/state/xy on Hue play Rechts (to 0.1444,0.0327).
hue-extended.0 2019-11-01 12:33:21.497 info (23853) Attempt 1x - Successfully set Hue play Links.
hue-extended.0 2019-11-01 12:33:21.495 debug (23853) Successfully set /lights/25/state/xy on Hue play Links (to 0.1444,0.0327).
hue-extended.0 2019-11-01 12:33:21.460 debug (23853) Attempt 1x - Send commands to Balkon (lights/23/state): {"xy":[0.7126,0.2874]}.
hue-extended.0 2019-11-01 12:33:21.458 debug (23853) State of hue-extended.0.lights.023-balkon.action._commands has changed {"val":"{"hue":271,"sat":209,"bri":254,"on":true}","ack":false,"ts":1572608001429,"q":0,"from":"system.adapter.ja
hue-extended.0 2019-11-01 12:33:21.451 debug (23853) Attempt 1x - Send commands to Hue play Rechts (lights/24/state): {"xy":[0.1444,0.0327]}.
hue-extended.0 2019-11-01 12:33:21.449 debug (23853) State of hue-extended.0.lights.024-hue_play_rechts.action._commands has changed {"val":"{"hue":223,"sat":196,"bri":254,"on":true}","ack":false,"ts":1572608001429,"q":0,"from":"system.a
hue-extended.0 2019-11-01 12:33:21.436 debug (23853) Attempt 1x - Send commands to Hue play Links (lights/25/state): {"xy":[0.1444,0.0327]}.
hue-extended.0 2019-11-01 12:33:21.434 debug (23853) State of hue-extended.0.lights.025-hue_play_links.action._commands has changed {"val":"{"hue":223,"sat":196,"bri":254,"on":true}","ack":false,"ts":1572608001428,"q":0,"from":"system.ad
hue-extended.0 2019-11-01 12:33:15.071 info (23853) Attempt 1x - Successfully set Balkon.
hue-extended.0 2019-11-01 12:33:15.068 debug (23853) Successfully set /lights/23/state/xy on Balkon (to 0.7126,0.2874).
hue-extended.0 2019-11-01 12:33:15.060 debug (23853) Successfully set /lights/23/state/sat on Balkon (to 209).
hue-extended.0 2019-11-01 12:33:15.025 info (23853) Attempt 1x - Successfully set Hue play Rechts.
hue-extended.0 2019-11-01 12:33:15.024 debug (23853) Successfully set /lights/24/state/xy on Hue play Rechts (to 0.1444,0.0327).
hue-extended.0 2019-11-01 12:33:15.022 debug (23853) Successfully set /lights/24/state/sat on Hue play Rechts (to 196).
hue-extended.0 2019-11-01 12:33:14.952 info (23853) Attempt 1x - Successfully set Hue play Links.
hue-extended.0 2019-11-01 12:33:14.951 debug (23853) Successfully set /lights/25/state/xy on Hue play Links (to 0.1444,0.0327).
hue-extended.0 2019-11-01 12:33:14.884 debug (23853) Attempt 1x - Send commands to Balkon (lights/23/state): {"sat":209,"xy":[0.7126,0.2874]}.
hue-extended.0 2019-11-01 12:33:14.881 debug (23853) State of hue-extended.0.lights.023-balkon.action._commands has changed {"val":"{"hue":271,"sat":209,"bri":254,"on":true}","ack":false,"ts":1572607994796,"q":0,"from":"system.adapter.ja
hue-extended.0 2019-11-01 12:33:14.876 debug (23853) Attempt 1x - Send commands to Hue play Rechts (lights/24/state): {"sat":196,"xy":[0.1444,0.0327]}.
hue-extended.0 2019-11-01 12:33:14.873 debug (23853) State of hue-extended.0.lights.024-hue_play_rechts.action._commands has changed {"val":"{"hue":223,"sat":196,"bri":254,"on":true}","ack":false,"ts":1572607994796,"q":0,"from":"system.a
hue-extended.0 2019-11-01 12:33:14.842 debug (23853) Attempt 1x - Send commands to Hue play Links (lights/25/state): {"xy":[0.1444,0.0327]}.
hue-extended.0 2019-11-01 12:33:14.815 debug (23853) State of hue-extended.0.lights.025-hue_play_links.action._commands has changed {"val":"{"hue":223,"sat":196,"bri":254,"on":true}","ack":false,"ts":1572607994795,"q":0,"from":"system.ad

@dercaptainbc
Copy link
Author

In the Meantime I've checked the behavior when I use the long version hue values (from hue api)

Quelle Zeit debug Meldung
hue-extended.0 2019-11-03 10:13:46.087 info (7060) Attempt 1x - Successfully set Badezimmer.
hue-extended.0 2019-11-03 10:13:46.086 debug (7060) Successfully set /groups/2/action/xy on Badezimmer (to 0.7126,0.2874).
hue-extended.0 2019-11-03 10:13:46.085 debug (7060) Successfully set /groups/2/action/sat on Badezimmer (to 209).
hue-extended.0 2019-11-03 10:13:46.023 debug (7060) Attempt 1x - Send commands to Badezimmer (groups/2/action): {"sat":209,"xy":[0.7126,0.2874]}.
hue-extended.0 2019-11-03 10:13:46.021 debug (7060) State of hue-extended.0.groups.002-badezimmer.action._commands has changed {"val":"{"hue":49333,"sat":209,"bri":254,"on":true}","ack":false,"ts":1572772426016,"q":0,"from":"system.adapt

When I send {"on": true,"bri": 254,"hue": 49333,"sat": 209} directly to the bridge via POST and check XY Values with GET I can see the following values :

{
		"on": true,
		"bri": 254,
		"hue": 49333,
		"sat": 209,
		"effect": "none",
		"xy": [
			0.247,
			0.1318
		],


because of that I think the conversion from hue to xy is not correct at the moment.

@Zefau
Copy link
Collaborator

Zefau commented Nov 3, 2019

This is actually challenging, because the available algorithms to convert to xy are apparently pretty bad.
I don't find anything online converting {"hue": 49333, "sat": 209, "bri": 254} correctly to

"xy": [
	0.247,
	0.1318
]

@Zefau
Copy link
Collaborator

Zefau commented Nov 7, 2019

Could you try again with v1.1.6 (from Github) and check the results? It won't match exactly what you expect I guess but it will most likely be the closest to get.

@Zefau
Copy link
Collaborator

Zefau commented Nov 7, 2019

Is there actually any other state we could convert to alternatively?

@Zefau
Copy link
Collaborator

Zefau commented Nov 12, 2019

@dercaptainbc Any idea on how to proceed with this?

@dercaptainbc
Copy link
Author

Hi @Zefau sorry for my delay. Its much better now. I can live with it for now. From my point of view we can close it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working verify-fix Verify if the implemented fix has solved the issue
Projects
None yet
Development

No branches or pull requests

2 participants