Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color_temp value in scenes not correct #4926

Closed
Anjerlaan opened this issue Nov 10, 2020 · 51 comments
Closed

Color_temp value in scenes not correct #4926

Anjerlaan opened this issue Nov 10, 2020 · 51 comments
Labels
problem Something isn't working stale Stale issues

Comments

@Anjerlaan
Copy link

What happened

I have been testing with Scenes, this is a nice option.
But there is a huge difference in color_temp if I sent to a GROUP:

{ "state": "ON", "brightness": 120, "color_temp": 350 }

Or add a Scene with the same values and recall it:

{
    "scene_add": {
        "ID": 1,
        "state": "ON",
        "brightness": 120,
        "color_temp": 350
    }
}

When I use the "color": {"x":0.447991567541816,"y":0.407559831563923} attribute instead, this value represents the correct color_temp

Debug info

Zigbee2MQTT version: v.1.15.0
Adapter hardware: CC26X2R1
Adapter firmware version: (zStack3x0 20200925)

@Anjerlaan Anjerlaan added the problem Something isn't working label Nov 10, 2020
@Koenkk
Copy link
Owner

Koenkk commented Nov 12, 2020

I don't understand the issue, can you provide a list of steps to reproduce this and clear indicate what the problem is?

@Anjerlaan
Copy link
Author

Anjerlaan commented Nov 12, 2020

I don't understand the issue, can you provide a list of steps to reproduce this and clear indicate what the problem is?

@Koenkk, this happens if I send a normal GROUP command as payload:

{ "state": "ON", "brightness": 120, "color_temp": 350 }

The info shows a color value of {"x":0.447991567541816,"y":0.407559831563923}

See Log:

18:48:50: Received MQTT message on 'zigbee2mqtt/Keuken_Spots_ct/set' with data '{ "state": "ON", "brightness": 120, "color_temp": 350 }'
debug 2020-11-12 18:48:50: Publishing 'set' 'brightness' to 'Keuken_Spots_ct'
debug 2020-11-12 18:48:50: Received Zigbee message from 'Keuken_Spot2', type 'attributeReport', cluster 'genOnOff', data '{"onOff":1}' from endpoint 1 with groupID 0
info  2020-11-12 18:48:50: MQTT publish: topic 'zigbee2mqtt/Keuken_Spots_ct', payload '{"brightness":120,"color":{"x":0.447991567541816,"y":0.407559831563923},"color_temp":350,"state":"ON"}'
info  2020-11-12 18:48:50: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot2', payload '{"brightness":120,"color":{"x":0.447991567541816,"y":0.407559831563923},"color_temp":350,"linkquality":63,"state":"ON","update_available":false}'
debug 2020-11-12 18:48:50: Received Zigbee message from 'Keuken_Spot1', type 'attributeReport', cluster 'genOnOff', data '{"onOff":1}' from endpoint 1 with groupID 0
info  2020-11-12 18:48:50: MQTT publish: topic 'zigbee2mqtt/Keuken_Spots_ct', payload '{"brightness":120,"color":{"x":0.447991567541816,"y":0.407559831563923},"color_temp":350,"state":"ON"}'
info  2020-11-12 18:48:50: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot1', payload '{"brightness":120,"color":{"x":0.447991567541816,"y":0.407559831563923},"color_temp":350,"linkquality":69,"state":"ON","update_available":false}'
debug 2020-11-12 18:48:50: Received Zigbee message from 'Keuken_Spot3', type 'attributeReport', cluster 'genOnOff', data '{"onOff":1}' from endpoint 1 with groupID 0
info  2020-11-12 18:48:50: MQTT publish: topic 'zigbee2mqtt/Keuken_Spots_ct', payload '{"brightness":120,"color":{"x":0.447991567541816,"y":0.407559831563923},"color_temp":350,"state":"ON"}'
info  2020-11-12 18:48:50: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot3', payload '{"brightness":120,"color":{"x":0.447991567541816,"y":0.407559831563923},"color_temp":350,"linkquality":66,"state":"ON","update_available":false}'
info  2020-11-12 18:48:50: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot1', payload '{"brightness":120,"color":{"x":0.447991567541816,"y":0.407559831563923},"color_temp":350,"linkquality":69,"state":"ON","update_available":false}'
info  2020-11-12 18:48:50: MQTT publish: topic 'zigbee2mqtt/Keuken_Spots_ct', payload '{"brightness":120,"color":{"x":0.447991567541816,"y":0.407559831563923},"color_temp":350,"state":"ON"}'
debug 2020-11-12 18:48:50: Publishing 'set' 'color_temp' to 'Keuken_Spots_ct'
info  2020-11-12 18:48:50: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot2', payload '{"brightness":120,"color":{"x":0.447991567541816,"y":0.407559831563923},"color_temp":350,"linkquality":63,"state":"ON","update_available":false}'
info  2020-11-12 18:48:50: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot3', payload '{"brightness":120,"color":{"x":0.447991567541816,"y":0.407559831563923},"color_temp":350,"linkquality":66,"state":"ON","update_available":false}'
info  2020-11-12 18:48:50: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot1', payload '{"brightness":120,"color":{"x":0.447991567541816,"y":0.407559831563923},"color_temp":350,"linkquality":69,"state":"ON","update_available":false}'
info  2020-11-12 18:48:50: MQTT publish: topic 'zigbee2mqtt/Keuken_Spots_ct', payload '{"brightness":120,"color":{"x":0.447991567541816,"y":0.407559831563923},"color_temp":350,"state":"ON"}'
info  2020-11-12 18:48:50: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot2', payload '{"brightness":120,"color":{"x":0.447991567541816,"y":0.407559831563923},"color_temp":350,"linkquality":63,"state":"ON","update_available":false}'
info  2020-11-12 18:48:50: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot3', payload '{"brightness":120,"color":{"x":0.447991567541816,"y":0.407559831563923},"color_temp":350,"linkquality":66,"state":"ON","update_available":false}'

This happens when I add a Scene with the same values and recall it:

{
    "scene_add": {
        "ID": 1,
        "state": "ON",
        "brightness": 120,
        "color_temp": 350
    }
}

Log:

debug 2020-11-12 18:58:25: Received MQTT message on 'zigbee2mqtt/Keuken_Spots_ct/set' with data '{
    "scene_add": {
        "ID": 1,
        "state": "ON",
        "brightness": 120,
        "color_temp":350
    }
}'
debug 2020-11-12 18:58:25: Publishing 'set' 'scene_add' to 'Keuken_Spots_ct'
info  2020-11-12 18:58:26: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot1', payload '{"brightness":120,"color":{"x":0.447991567541816,"y":0.407559831563923},"color_temp":350,"linkquality":72,"state":"ON","update_available":false}'
info  2020-11-12 18:58:26: MQTT publish: topic 'zigbee2mqtt/Keuken_Spots_ct', payload '{"brightness":120,"color":{"x":0.447991567541816,"y":0.407559831563923},"color_temp":350,"state":"ON"}'
info  2020-11-12 18:58:26: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot2', payload '{"brightness":120,"color":{"x":0.447991567541816,"y":0.407559831563923},"color_temp":350,"linkquality":63,"state":"ON","update_available":false}'
info  2020-11-12 18:58:26: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot3', payload '{"brightness":120,"color":{"x":0.447991567541816,"y":0.407559831563923},"color_temp":350,"linkquality":72,"state":"ON","update_available":false}'
debug 2020-11-12 18:58:46: Received MQTT message on 'zigbee2mqtt/Keuken_Spots_ct/set' with data '{"scene_recall": 1}'
debug 2020-11-12 18:58:46: Publishing 'set' 'scene_recall' to 'Keuken_Spots_ct'
debug 2020-11-12 18:58:47: Received Zigbee message from 'Keuken_Spot2', type 'attributeReport', cluster 'lightingColorCtrl', data '{"currentX":0,"currentY":0}' from endpoint 1 with groupID 0
info  2020-11-12 18:58:47: MQTT publish: topic 'zigbee2mqtt/Keuken_Spots_ct', payload '{"brightness":120,"color":{"x":0,"y":0},"color_temp":350,"state":"ON"}'
info  2020-11-12 18:58:47: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot2', payload '{"brightness":120,"color":{"x":0,"y":0},"color_temp":350,"linkquality":72,"state":"ON","update_available":false}'
debug 2020-11-12 18:58:47: Received Zigbee message from 'Keuken_Spot3', type 'attributeReport', cluster 'lightingColorCtrl', data '{"currentX":0,"currentY":0}' from endpoint 1 with groupID 0
info  2020-11-12 18:58:47: MQTT publish: topic 'zigbee2mqtt/Keuken_Spots_ct', payload '{"brightness":120,"color":{"x":0,"y":0},"color_temp":350,"state":"ON"}'
info  2020-11-12 18:58:47: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot3', payload '{"brightness":120,"color":{"x":0,"y":0},"color_temp":350,"linkquality":72,"state":"ON","update_available":false}'
debug 2020-11-12 18:58:47: Received Zigbee message from 'Keuken_Spot1', type 'attributeReport', cluster 'lightingColorCtrl', data '{"currentX":0,"currentY":0}' from endpoint 1 with groupID 0
info  2020-11-12 18:58:47: MQTT publish: topic 'zigbee2mqtt/Keuken_Spots_ct', payload '{"brightness":120,"color":{"x":0,"y":0},"color_temp":350,"state":"ON"}'
info  2020-11-12 18:58:47: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot1', payload '{"brightness":120,"color":{"x":0,"y":0},"color_temp":350,"linkquality":72,"state":"ON","update_available":false}'
info  2020-11-12 18:58:47: MQTT publish: topic 'zigbee2mqtt/Keuken_Spots_ct', payload '{"brightness":120,"color":{"x":0,"y":0},"color_temp":350,"state":"ON"}'
info  2020-11-12 18:58:47: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot1', payload '{"brightness":120,"color":{"x":0,"y":0},"color_temp":350,"linkquality":72,"state":"ON","update_available":false}'
info  2020-11-12 18:58:47: MQTT publish: topic 'zigbee2mqtt/Keuken_Spots_ct', payload '{"brightness":120,"color":{"x":0,"y":0},"color_temp":350,"state":"ON"}'
info  2020-11-12 18:58:47: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot2', payload '{"brightness":120,"color":{"x":0,"y":0},"color_temp":350,"linkquality":72,"state":"ON","update_available":false}'
info  2020-11-12 18:58:47: MQTT publish: topic 'zigbee2mqtt/Keuken_Spots_ct', payload '{"brightness":120,"color":{"x":0,"y":0},"color_temp":350,"state":"ON"}'
info  2020-11-12 18:58:47: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot3', payload '{"brightness":120,"color":{"x":0,"y":0},"color_temp":350,"linkquality":72,"state":"ON","update_available":false}'
debug 2020-11-12 18:58:50: Received Zigbee message from 'Keuken_Spot3', type 'attributeReport', cluster 'genOnOff', data '{"onOff":1}' from endpoint 1 with groupID 0
info  2020-11-12 18:58:50: MQTT publish: topic 'zigbee2mqtt/Keuken_Spots_ct', payload '{"brightness":120,"color":{"x":0,"y":0},"color_temp":350,"state":"ON"}'
info  2020-11-12 18:58:50: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot3', payload '{"brightness":120,"color":{"x":0,"y":0},"color_temp":350,"linkquality":72,"state":"ON","update_available":false}'
debug 2020-11-12 18:58:50: Received Zigbee message from 'Keuken_Spot1', type 'attributeReport', cluster 'genOnOff', data '{"onOff":1}' from endpoint 1 with groupID 0
info  2020-11-12 18:58:50: MQTT publish: topic 'zigbee2mqtt/Keuken_Spots_ct', payload '{"brightness":120,"color":{"x":0,"y":0},"color_temp":350,"state":"ON"}'
info  2020-11-12 18:58:50: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot1', payload '{"brightness":120,"color":{"x":0,"y":0},"color_temp":350,"linkquality":72,"state":"ON","update_available":false}'
debug 2020-11-12 18:58:50: Received Zigbee message from 'Keuken_Spot2', type 'attributeReport', cluster 'genOnOff', data '{"onOff":1}' from endpoint 1 with groupID 0
info  2020-11-12 18:58:50: MQTT publish: topic 'zigbee2mqtt/Keuken_Spots_ct', payload '{"brightness":120,"color":{"x":0,"y":0},"color_temp":350,"state":"ON"}'
info  2020-11-12 18:58:50: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot2', payload '{"brightness":120,"color":{"x":0,"y":0},"color_temp":350,"linkquality":75,"state":"ON","update_available":false}'

As you can see in the log when the scene is recalled, the X and Y colors are suddenly {"x":0,"y":0}, which causes a totally different color, although the color_temp is set to 350

As a work around I use the color attribute instead of the color_temp when adding a Scene.
And use the values {"x":0.447991567541816,"y":0.407559831563923} of the info message after I send the command
{ "state": "ON", "brightness": 120, "color_temp": 350 }

Why is the value of color attribute, when recallling a Scene, set to {"x":0,"y":0} ?

@Koenkk
Copy link
Owner

Koenkk commented Nov 14, 2020

Can you check if it works via scene_store instead of scene_add? https://www.zigbee2mqtt.io/information/scenes.html#scene_store

@Anjerlaan
Copy link
Author

Anjerlaan commented Nov 16, 2020

Can you check if it works via scene_store instead of scene_add? https://www.zigbee2mqtt.io/information/scenes.html#scene_store

Hi @Koenkk,

With scene_store the recall is working correct, color values are equal to the normal set state command:
{ "state": "ON", "brightness": 120, "color_temp": 350 }
Only note is that the X color value is rounded to 3 digits

debug 2020-11-16 21:19:49: Received MQTT message on 'zigbee2mqtt/Keuken_Spots_ct/set' with data '{"scene_recall": 1}'
debug 2020-11-16 21:19:49: Publishing 'set' 'scene_recall' to 'Keuken_Spots_ct'
debug 2020-11-16 21:19:49: Received Zigbee message from 'Keuken_Spot3', type 'attributeReport', cluster 'lightingColorCtrl', data '{"currentX":29359}' from endpoint 1 with groupID 0
info  2020-11-16 21:19:49: MQTT publish: topic 'zigbee2mqtt/Keuken_Spots_ct', payload '{"brightness":120,"color":{"x":0.448,"y":0.407559831563923},"color_temp":350,"state":"OFF"}'
info  2020-11-16 21:19:49: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot3', payload '{"brightness":120,"color":{"x":0.448,"y":0.407559831563923},"color_temp":350,"linkquality":63,"state":"OFF","update":{"state":"idle"},"update_available":false}'
debug 2020-11-16 21:19:49: Received Zigbee message from 'Keuken_Spot2', type 'attributeReport', cluster 'genOnOff', data '{"onOff":1}' from endpoint 1 with groupID 0
info  2020-11-16 21:19:49: MQTT publish: topic 'zigbee2mqtt/Keuken_Spots_ct', payload '{"brightness":120,"color":{"x":0.447991567541816,"y":0.407559831563923},"color_temp":350,"state":"ON"}'
info  2020-11-16 21:19:49: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot2', payload '{"brightness":120,"color":{"x":0.447991567541816,"y":0.407559831563923},"color_temp":350,"linkquality":66,"state":"ON","update":{"state":"idle"},"update_available":false}'
debug 2020-11-16 21:19:49: Received Zigbee message from 'Keuken_Spot2', type 'attributeReport', cluster 'lightingColorCtrl', data '{"currentX":29359}' from endpoint 1 with groupID 0
info  2020-11-16 21:19:49: MQTT publish: topic 'zigbee2mqtt/Keuken_Spots_ct', payload '{"brightness":120,"color":{"x":0.448,"y":0.407559831563923},"color_temp":350,"state":"ON"}'
info  2020-11-16 21:19:49: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot2', payload '{"brightness":120,"color":{"x":0.448,"y":0.407559831563923},"color_temp":350,"linkquality":66,"state":"ON","update":{"state":"idle"},"update_available":false}'
debug 2020-11-16 21:19:49: Received Zigbee message from 'Keuken_Spot1', type 'attributeReport', cluster 'genOnOff', data '{"onOff":1}' from endpoint 1 with groupID 0
info  2020-11-16 21:19:49: MQTT publish: topic 'zigbee2mqtt/Keuken_Spots_ct', payload '{"brightness":120,"color":{"x":0.447991567541816,"y":0.407559831563923},"color_temp":350,"state":"ON"}'
info  2020-11-16 21:19:49: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot1', payload '{"brightness":120,"color":{"x":0.447991567541816,"y":0.407559831563923},"color_temp":350,"linkquality":63,"state":"ON","update":{"state":"idle"},"update_available":false}'
debug 2020-11-16 21:19:49: Received Zigbee message from 'Keuken_Spot1', type 'attributeReport', cluster 'lightingColorCtrl', data '{"currentX":29359}' from endpoint 1 with groupID 0
info  2020-11-16 21:19:49: MQTT publish: topic 'zigbee2mqtt/Keuken_Spots_ct', payload '{"brightness":120,"color":{"x":0.448,"y":0.407559831563923},"color_temp":350,"state":"ON"}'
info  2020-11-16 21:19:49: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot1', payload '{"brightness":120,"color":{"x":0.448,"y":0.407559831563923},"color_temp":350,"linkquality":60,"state":"ON","update":{"state":"idle"},"update_available":false}'
debug 2020-11-16 21:19:49: Received Zigbee message from 'Keuken_Spot3', type 'attributeReport', cluster 'genOnOff', data '{"onOff":1}' from endpoint 1 with groupID 0
info  2020-11-16 21:19:49: MQTT publish: topic 'zigbee2mqtt/Keuken_Spots_ct', payload '{"brightness":120,"color":{"x":0.448,"y":0.407559831563923},"color_temp":350,"state":"ON"}'
info  2020-11-16 21:19:49: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot3', payload '{"brightness":120,"color":{"x":0.448,"y":0.407559831563923},"color_temp":350,"linkquality":63,"state":"ON","update":{"state":"idle"},"update_available":false}'
debug 2020-11-16 21:19:49: Received Zigbee message from 'Keuken_Spot3', type 'attributeReport', cluster 'genLevelCtrl', data '{"currentLevel":9}' from endpoint 1 with groupID 0
info  2020-11-16 21:19:49: MQTT publish: topic 'zigbee2mqtt/Keuken_Spots_ct', payload '{"brightness":9,"color":{"x":0.448,"y":0.407559831563923},"color_temp":350,"state":"ON"}'
info  2020-11-16 21:19:49: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot3', payload '{"brightness":9,"color":{"x":0.448,"y":0.407559831563923},"color_temp":350,"linkquality":63,"state":"ON","update":{"state":"idle"},"update_available":false}'
debug 2020-11-16 21:19:49: Received Zigbee message from 'Keuken_Spot1', type 'attributeReport', cluster 'genLevelCtrl', data '{"currentLevel":8}' from endpoint 1 with groupID 0
info  2020-11-16 21:19:49: MQTT publish: topic 'zigbee2mqtt/Keuken_Spots_ct', payload '{"brightness":8,"color":{"x":0.448,"y":0.407559831563923},"color_temp":350,"state":"ON"}'
info  2020-11-16 21:19:49: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot1', payload '{"brightness":8,"color":{"x":0.448,"y":0.407559831563923},"color_temp":350,"linkquality":63,"state":"ON","update":{"state":"idle"},"update_available":false}'
debug 2020-11-16 21:19:49: Received Zigbee message from 'Keuken_Spot2', type 'attributeReport', cluster 'genLevelCtrl', data '{"currentLevel":9}' from endpoint 1 with groupID 0
info  2020-11-16 21:19:49: MQTT publish: topic 'zigbee2mqtt/Keuken_Spots_ct', payload '{"brightness":9,"color":{"x":0.448,"y":0.407559831563923},"color_temp":350,"state":"ON"}'
info  2020-11-16 21:19:49: MQTT publish: topic 'zigbee2mqtt/Keuken_Spot2', payload '{"brightness":9,"color":{"x":0.448,"y":0.407559831563923},"color_temp":350,"linkquality":66,"state":"ON","update":{"state":"idle"},"update_available":false}'

Other thing I notice in the log is that:

  • Brightness value is 120 (as it should), but suddenly it is changed to "Brightness" value of 8 or 9 at the last 6 rows of the log?
    What is the difference?

  • And the value of the data '{"currentLevel":X}' of the 3 bulbs in the group are not equal for all bulbs.
    data '{"currentLevel":8}' or data '{"currentLevel":9}', I thought that if a group state is send, all members are set to the same state?

@Koenkk
Copy link
Owner

Koenkk commented Nov 18, 2020

The incorrect brightness occurs because the spots report this brightness themselves: debug 2020-11-16 21:19:49: Received Zigbee message from 'Keuken_Spot1', type 'attributeReport', cluster 'genLevelCtrl', data '{"currentLevel":8}' from endpoint 1 with groupID 0

If the actual brightness is not 8 at this moment, this seems to be a bug inside the firmwares of the bulbs.

@Anjerlaan
Copy link
Author

Anjerlaan commented Nov 21, 2020

I started to notice this brightness bug until I was testing the scene functionality, never before. I can’t test it with other bulbs, because these are the only 3 with color temp I have.

I will continue to use the color attribute then instead of color_temp.

@sjorge
Copy link
Sponsor Contributor

sjorge commented Nov 26, 2020

I can confirm that scene_add with color_temp is not working with Ikea trådfri GU10 WS and FLOAT panels.
Using color does work, which is odd as they don't seem to accept any RGB color values.
edit: loops like neither is working for me on the Trådfri WS bulbs/panels I have.

I retested 'color' on a Trådfri CWS bulb and that does seem to work fine though.

Doing a read for color_temp afterwards also returns the wrong value, I wonder if tradfri specific as they also return a color_mode indicating xy for the WS bulbs...

@Anjerlaan what bulbs are you using?

@sjorge
Copy link
Sponsor Contributor

sjorge commented Nov 26, 2020

Some more testing... (with a Tradfri LED1537R6/LED1739R5 I had to spare)

mosquitto_pub -t zigbee2mqtt/0xec1bbdfffeb5154f/set/scene_add -m '{"ID": 22, "state": "OFF", "color_temp": "250"}'
mosquitto_pub -t zigbee2mqtt/0xec1bbdfffeb5154f/set/scene_recall -m 22
sleep 2
mosquitto_pub -t zigbee2mqtt/0xec1bbdfffeb5154f/set/state -m ON
sleep 2
mosquitto_pub -t zigbee2mqtt/0xec1bbdfffeb5154f/set/state -m OFF
sleep 2
mosquitto_pub -t zigbee2mqtt/0xec1bbdfffeb5154f/set/scene_add -m '{"ID": 23, "state": "OFF", "color_temp": "455"}'
mosquitto_pub -t zigbee2mqtt/0xec1bbdfffeb5154f/set/scene_recall -m 23
sleep 2
mosquitto_pub -t zigbee2mqtt/0xec1bbdfffeb5154f/set/state -m ON

This doesn't seem to work at all, while doing this using 'color' and a RGB value for a tradfri CWS bulb works fine...
De results in from the database.db

{
        "scenes": {
          "22_0": {
            "state": {
              "state": "OFF",
              "color_temp": "250"
            }
          },
          "23_0": {
            "state": {
              "state": "OFF",
              "color_temp": "455"
            }
          }
        }
}

This looks fine to be, I also tried with state ON, but that makes no difference.
The recall doesn't recall the color_temp (but it does recall the state!)

Lets try with scene_store!

mosquitto_pub -t zigbee2mqtt/0xec1bbdfffeb5154f/set -m '{"state": "ON", "color_temp": "250"}'
sleep 2
mosquitto_pub -t zigbee2mqtt/0xec1bbdfffeb5154f/set/state -m OFF
sleep 1
mosquitto_pub -t zigbee2mqtt/0xec1bbdfffeb5154f/set/scene_store -m 30
sleep 5
mosquitto_pub -t zigbee2mqtt/0xec1bbdfffeb5154f/set -m '{"state": "ON", "color_temp": "455"}'
sleep 2
mosquitto_pub -t zigbee2mqtt/0xec1bbdfffeb5154f/set/state -m OFF
sleep 1
mosquitto_pub -t zigbee2mqtt/0xec1bbdfffeb5154f/set/scene_store -m 31
{
        "scenes": {
          "22_0": {
            "state": {
              "state": "ON",
              "color_temp": "250"
            }
          },
          "23_0": {
            "state": {
              "state": "ON",
              "color_temp": "455"
            }
          },
          "30_0": {
            "state": {
              "state": "OFF",
              "brightness": 254,
              "color_temp": 250,
              "color": {
                "x": 0,
                "y": 0
              }
            }
          },
          "31_0": {
            "state": {
              "state": "OFF",
              "brightness": 254,
              "color_temp": 455,
              "color": {
                "x": 0,
                "y": 0
              }
            }
          }
        }
      }
}

Same results with as above when recalling (same done with state left to ON).
Having the color in there as 0,0 is odd, not sure if this an artifact of how z2m stores the scenes metadata or an actual state saved to the bulb. But https://github.com/Koenkk/zigbee-herdsman-converters/blob/1ffac3a151e8147beed6228940c62aab6db360b6/converters/toZigbee.js#L3647 seems to indicate something is going wrong for scene_store as we can't have both values. But this looks like it might be an implementation issues with saveSceneState which seems to save both... but not sure where it grabs the xy = 0,0 from though?

@sjorge
Copy link
Sponsor Contributor

sjorge commented Nov 26, 2020

Wanted to try a Hue CWS bulb to see if it supported color_temp (not sure) but I couldn't reset it :( #4968 (comment)

I manually tested setting color_temp first to verify the bulbs is supporting it, then I repeated the test above... with the exact same results :(

Recall does not work at all for color_temp, I tried with both state=ON and state=OFF in the scene_add payload, this allowed me to verify the bulb does respond to the scene_recall as it goes on or off depending on what was in the scene_add payload.

Repeated the tests with the following brands/bulbs...

  • Trådfri LED1537R6/LED1739R5
  • Hue 9290012573A
  • Osram AC03647
  • Müller Licht 404000/404005/404012

So it doesn't work for any of the bulbs I currently have available for testing, not a super wide selection, but I think we can probably say it's a generic issue.

@Anjerlaan
Copy link
Author

Anjerlaan commented Nov 26, 2020

@Anjerlaan what bulbs are you using?

@sjorge
3 x IKEA LED1537R6/LED1739R5

Same as yours, i have the exact same findings

@MattWestb
Copy link

IKEA is adding scenes with X and Y for their WS bulbs as shown from sniffing the GW:

    Frame Control Field: Cluster-specific (0x11)
    Sequence Number: 37
    Command: Add Scene (0x00)
    Payload, String: 
        Group ID: 0x002a
        Scene ID: 0x00
        Transition Time: 1 seconds
        Length: 0
        String: 
        Extension field set 1
            Cluster: On/Off (0x0006)
            On/Off: 1
        Extension field set 2
            Cluster: Color Control (0x0300)
            Color X: 0,4580
            Color Y: 0,4100
        Extension field set 3
            Cluster: Level Control (0x0008)
            Level: 203
        Extension field set 4
            Cluster: Unknown (0x0102)
            Current Position Lift Percentage: 0
            Current Position Tilt Percentage: 0

And after it reading it for verifying the setting is made:

ZigBee Cluster Library Frame
    Frame Control Field: Cluster-specific (0x19)
    Sequence Number: 41
    Command: View Scene Response (0x01)
    Payload, String: 
        Scenes Status: Success (0x00)
        Group ID: 0x002a
        Scene ID: 0x00
        Transition Time: 1 seconds
        Length: 0
        String: 
        Extension field set 1
            Cluster: On/Off (0x0006)
            On/Off: 1
        Extension field set 2
            Cluster: Level Control (0x0008)
            Level: 203
        Extension field set 3
            Cluster: Color Control (0x0300)
            Color X: 0,4580
            Color Y: 0,4100

PS: The scenes is special initiated with manufacturer commands so only the color is changed then getting command from the 5 button remote and skipping the on/off, light level and blinds positions.
The example is for the first of the 3 "default" scene that is added in all IKEA bulbs for working with the 5 button remote and is identical with those that is created after firmware update of the bulbs.

@sjorge
Copy link
Sponsor Contributor

sjorge commented Nov 27, 2020

Sending color seems to work for Trådfri and my CWS bulbs, I sadly don't have WS only bulbs from Hue or other brands to try with.

I still think something is broken, because the ZCL says we can set color_temp via scenes... i can take say Trådfri botching there firmware so there remotes can just send xy... but it would seem odd all brands would do this.

I'll try to setup my sniffer tomorrow and see what z2m is sending out for the scene_add, perhaps we're encoding something wrong.

@MattWestb
Copy link

I think the IKEA WS scenes must being setted up / added with xy and not CT that its little of standard.
The remote is sending "manufacture patched" commands next and previous scene, therefore the scenes is transferring / setting up from controlling device to the lights then pairing (Lighting link networks dont have any coordinator) or added more of them later from the GW if having one.

The IKEA Zigbee 3 lights scenes is pretty good and standard then not using their GW and is certified, some things is added that is out of standard (true manufacture cluster) but that is OK in zigbee but the setting of colour is odd.

PS: Dont forgetting go to Lidl then there "Home Smart Home" is coming for getting little more zigbee toys like zigbee christmas tree lights and short RGBWW LED stripes ;-)

@sjorge
Copy link
Sponsor Contributor

sjorge commented Nov 27, 2020

Some annoying side effects, the IKEA WS bulbs don't seem to update color_temp when they change color via a scene with color_xy...

Also looks like they only take a very specific set of colors, I figured them out by using the remote... then recording both color_temp and color_xy

The remotes are definitely doing odd stuff when they set the scene as the bulb seems to report color_temp afterwards.

@MattWestb
Copy link

MattWestb commented Nov 27, 2020

If you is adding groupe 0xff09 to the bulb and then adding new scenes to it you can using the remote for your scenes. If the remote dont get any groupe thru touchlink the pairing its sending the scene next and previous to groupe 0xff09.

IKEA WS dont have so wide range as is possible in the zigbee standard was seeing that then testing scenes in deCONZ.

@sjorge
Copy link
Sponsor Contributor

sjorge commented Nov 28, 2020

I got a pcap here for the scene_add/recall with color_temp included: https://pkg.blackdot.be/cores/zigbee/scene_add_recall.pcapng

@Koenkk same netkey as usual.

@sjorge
Copy link
Sponsor Contributor

sjorge commented Nov 28, 2020

image

I think we're not correctly adding the color_temp, as it is not present in the scene add payload, it does however list a blank x, y, hue, and saturation

@sjorge
Copy link
Sponsor Contributor

sjorge commented Nov 28, 2020

I wonder if scenes have slightly modified clusters spec? As Color Loop * is not listed for cluster 0x0300 (color control) in the ZCL doc I have?

Given the reference to color loop... could we be writing a ZLL variant instead? If so, I don't think that has a color_temp field and we're probably writing junk.

@MattWestb
Copy link

Tyre save one scene and then veuve the scene and you can see how is stored.

@MattWestb
Copy link

MattWestb commented Nov 28, 2020

Is the scene stored / added with power off state off ??
That can being one logical problem I think.
Its looks that the scene is added but without any parameters being setted.

@sjorge
Copy link
Sponsor Contributor

sjorge commented Nov 28, 2020

There is no scene view support though (in z2m), I also tried with scene_store and it doesn't recall color_temperature either.
I'm starting to suspect it might be impossible to do so via scenes (which would also explain why trådfri is using color_x/y in there scenes too)

This one was indeed with state off, but as mentioned above, on or off makes no difference. It works fine (state off) with color for CWS bulbs though (so you can change the color while they are off!, tested on trådfri, hue, innr, muller, and osram!)

@MattWestb
Copy link

The extension for lights in zigbee 3:

docs-15-0014-05-0plo-Lighting-OccupancyDevice-Specification-V1.0.pdf

Missing command 0x01 View scene is mandatory so it cant being moddes in the light.
Is the Z2M that not have implementing it ?

@sjorge
Copy link
Sponsor Contributor

sjorge commented Nov 28, 2020

Yeah, It's z2m currently that does not implete the view/delete/delete_all

@MattWestb
Copy link

Then you must doing some nice calculatings and sending the command raw and hoping its being right ;-))
ZHA dont have implementing the high level deCONZ have but not for the individual parameters that you can see from the wireshark sniffs.
Do you have some other commercial GW for testing ?
I using my IKEA GW after sniffing its network key.

@sjorge
Copy link
Sponsor Contributor

sjorge commented Nov 28, 2020

Nope, no gateways for testing.

z2m is handling the scene_add here, https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/converters/toZigbee.js#L3699, but... currently i'm working under the assumption that:

  • z2m is sending the wrong payload somehow
  • scenes don't support color_temp

Still not sure which.

@MattWestb
Copy link

MattWestb commented Nov 28, 2020

IKEA GW / remote adding one scene to one WS bulb:

    Frame Control Field: Cluster-specific (0x11)
    Sequence Number: 37
    Command: Add Scene (0x00)
    Payload, String: 
        Group ID: 0x002a
        Scene ID: 0x00
        Transition Time: 1 seconds
        Length: 0
        String: 
        Extension field set 1
            Cluster: On/Off (0x0006)
            On/Off: 1
        Extension field set 2
            Cluster: Color Control (0x0300)
            Color X: 0,4580
            Color Y: 0,4100
        Extension field set 3
            Cluster: Level Control (0x0008)
            Level: 203
        Extension field set 4
            Cluster: Unknown (0x0102)
            Current Position Lift Percentage: 0
            Current Position Tilt Percentage: 0

Then setting it with XY instead.

@sjorge
Copy link
Sponsor Contributor

sjorge commented Nov 28, 2020

Yeah, setting XY works fine via scene_add.
I also figured out which XY values the IKEA WS supports:

    var color_payloads = {
        "cool": {
            "color": {"x":0.3818,"y":0.3797},
        },
        "neutral":{
            "color": {"x":0.458,"y":0.41},
        },
        "warm":{
            "color": {"x":0.5018,"y":0.4153},
        },
    };

I sadly have no non IKEA WS bulbs, all the others I own are RGB.

But if scenes with color_temp are not supported, we need to update scene_add to complain when passing color_temp. If they are supported, we need to look into fixing the payload.

Edit: I wonder if writing 0 to the fields insteads of just not providing them is tripping up the bulbs, looks like Ikea is not writing 0 to other fields...

@sjorge
Copy link
Sponsor Contributor

sjorge commented Nov 28, 2020

@Koenkk how is the order of the extFields set determined? the listed order doesn't seem to match whats in "
Zigbee Cluster Library Specification v7.pdf" page 357 ?

@MattWestb
Copy link

Its gets one thread with much dumps of setting up scenes on ikes CWS its like somthing "2 tyre getting the 5 button remote to work with scenes"

@Koenkk
Copy link
Owner

Koenkk commented Nov 29, 2020

@sjorge the order should match the one in the ZCL spec (so probably that is why it's not working)

@sjorge
Copy link
Sponsor Contributor

sjorge commented Nov 29, 2020

@sjorge the order should match the one in the ZCL spec (so probably that is why it's not working)

Right, so the color_temp payload we pack is probably wrong...

I tried poking around with it but the slot where 'val' is doesn't even show up in the wireshark capture. If I shift it a slot forward it comes in the other listed attributes, but some give a malformed payload, probably because the value is out of range. Also not sure we should set the other fields to 0 ?

@Koenkk
Copy link
Owner

Koenkk commented Nov 30, 2020

So I found out what is happening here.

Started with wireshark and it looks that we include the color temperature values correctly as they can be seen in the payload , its a 2 byte number, see red circles, however they indeed do not show up in the "friendly name" list.

image

Then I found out that the colorTemperatureMireds extension field is something new in ZCL V7: (left V6, right V7):

image

This is (very likely) the reason why wireshark does not show it, it simply has not been updated with V7. Therefore many bulbs probably also don't support this. So in case your bulb doesn't you can do the following:

  • For bulbs that support color, just set the color to the desired color temperature
  • For bulbs that do not support color (e.g. TRADFRI GU10 spot), I've figured out you can set the color temperature via the color.
    • Fully yellow: {"scene_add": {"ID": 1, "color": "#000000"}}
    • Fully white: {"scene_add": {"ID": 1, "color": "#FFFFFF"}}

@MattWestb
Copy link

8657 Since there is a direct relation between ColorTemperatureMireds and XY, color temperature, if supported, is stored as XY in the scenes table.

Way not setting the CT with XY and not the Mireds is stored in the scene table and dont need to knowing if the light is ZCL v7 compatible or not ?

@sjorge
Copy link
Sponsor Contributor

sjorge commented Nov 30, 2020 via email

@MattWestb
Copy link

IKEA GW can adding more then scene 0 to 2 with X Y.

ZigBee Cluster Library Frame
    Frame Control Field: Cluster-specific (0x11)
    Sequence Number: 66
    Command: Add Scene (0x00)
    Payload, String: 
        Group ID: 0x002a
        Scene ID: 0x03
        Transition Time: 1 seconds
        Length: 0
        String: 
        Extension field set 1
            Cluster: On/Off (0x0006)
            On/Off: 1
        Extension field set 2
            Cluster: Color Control (0x0300)
            Color X: 0,3790
            Color Y: 0,3753
        Extension field set 3
            Cluster: Level Control (0x0008)
            Level: 132
        Extension field set 4
            Cluster: Unknown (0x0102)
            Current Position Lift Percentage: 0
            Current Position Tilt Percentage: 0

It was called moods then i was doing the sniff but for some days its changed to scenes.

In deCONZ i have saved (not added) 6 scenes but its not the same.
IKEA_CT20

@MattWestb
Copy link

With the IKEA WS have smaller range then the maximum in ZCL but the range you is having in the warm and cold scenes. If I remember right its possible reading the attribute wat capacity one device is having. If trying going outside its range its not saving the scene.

@sjorge
Copy link
Sponsor Contributor

sjorge commented Nov 30, 2020

@Koenkk we have code somewhere that maps Mirad to XY in z2m right?

I'm not sure how there is an easy way to do the fallback, but I guess we could always do it until we find bulbs that actually support it?

@Koenkk
Copy link
Owner

Koenkk commented Dec 1, 2020

@sjorge I also wondered about that, but I don't know if that is the correct way as this might not work when the user has reporting being setup (bulb will report x/y color and not color temperature). If you want to experiment, do the inverse of https://github.com/Koenkk/zigbee-herdsman-converters/blob/e2662cb2d677fea2cb13f2ee6770ab9c0129c14e/converters/utils.js#L118 and use https://github.com/Koenkk/zigbee-herdsman-converters/blob/e2662cb2d677fea2cb13f2ee6770ab9c0129c14e/converters/utils.js#L122

@sjorge
Copy link
Sponsor Contributor

sjorge commented Dec 1, 2020

A quick dirty test shows,... that the lights (IKEA Trådfri) do seem to report colorTemperature correctly.

Zigbee2MQTT:debug 2020-12-01 14:46:52: Received MQTT message on 'zigbee2mqtt/office/lights/set' with data '{"scene_add": {"ID": 22, "state": "ON", "color": {"x":0.3818,"y":0.3797}}, "scene_recall": 22}'
Zigbee2MQTT:debug 2020-12-01 14:46:52: Publishing 'set' 'scene_add' to 'office/lights'
Zigbee2MQTT:info  2020-12-01 14:46:52: MQTT publish: topic 'zigbee2mqtt/office/lights/panel1', payload '{"brightness":64,"color_temp":454,"linkquality":42,"state":"ON","update":{"state":"idle"}}'
Zigbee2MQTT:info  2020-12-01 14:46:52: MQTT publish: topic 'zigbee2mqtt/office/lights', payload '{"brightness":64,"color":{"x":0.5018,"y":0.4153},"color_temp":454,"state":"ON"}'
Zigbee2MQTT:debug 2020-12-01 14:46:52: Publishing 'set' 'scene_recall' to 'office/lights'
Zigbee2MQTT:info  2020-12-01 14:46:52: MQTT publish: topic 'zigbee2mqtt/office/lights/panel2', payload '{"brightness":64,"color_temp":454,"linkquality":86,"state":"ON","update":{"state":"idle"}}'
Zigbee2MQTT:info  2020-12-01 14:46:52: MQTT publish: topic 'zigbee2mqtt/office/lights/panel3', payload '{"brightness":64,"color_temp":454,"linkquality":76,"state":"ON","update":{"state":"idle"}}'
Zigbee2MQTT:info  2020-12-01 14:46:52: MQTT publish: topic 'zigbee2mqtt/office/lights/panel4', payload '{"brightness":64,"color_temp":454,"linkquality":78,"state":"ON","update":{"state":"idle"}}'
Zigbee2MQTT:debug 2020-12-01 14:46:52: Received Zigbee message from 'office/lights/panel4', type 'attributeReport', cluster 'lightingColorCtrl', data '{"colorTemperature":250}' from endpoint 1 with groupID 0
Zigbee2MQTT:debug 2020-12-01 14:46:52: Received Zigbee message from 'office/lights/panel2', type 'attributeReport', cluster 'lightingColorCtrl', data '{"colorTemperature":250}' from endpoint 1 with groupID 0
Zigbee2MQTT:debug 2020-12-01 14:46:52: Received Zigbee message from 'office/lights/panel3', type 'attributeReport', cluster 'lightingColorCtrl', data '{"colorTemperature":250}' from endpoint 1 with groupID 0
Zigbee2MQTT:debug 2020-12-01 14:46:52: Received Zigbee message from 'office/lights/panel1', type 'attributeReport', cluster 'lightingColorCtrl', data '{"colorTemperature":250}' from endpoint 1 with groupID 0
Zigbee2MQTT:info  2020-12-01 14:46:52: MQTT publish: topic 'zigbee2mqtt/office/lights', payload '{"brightness":64,"color":{"x":0.3818,"y":0.3797},"color_temp":454,"state":"ON"}'
Zigbee2MQTT:info  2020-12-01 14:46:52: MQTT publish: topic 'zigbee2mqtt/office/lights/panel1', payload '{"brightness":64,"color_temp":454,"linkquality":42,"state":"ON","update":{"state":"idle"}}'
Zigbee2MQTT:info  2020-12-01 14:46:52: MQTT publish: topic 'zigbee2mqtt/office/lights/panel2', payload '{"brightness":64,"color_temp":454,"linkquality":86,"state":"ON","update":{"state":"idle"}}'
Zigbee2MQTT:info  2020-12-01 14:46:52: MQTT publish: topic 'zigbee2mqtt/office/lights/panel3', payload '{"brightness":64,"color_temp":454,"linkquality":76,"state":"ON","update":{"state":"idle"}}'
Zigbee2MQTT:info  2020-12-01 14:46:52: MQTT publish: topic 'zigbee2mqtt/office/lights/panel4', payload '{"brightness":64,"color_temp":454,"linkquality":78,"state":"ON","update":{"state":"idle"}}'
Zigbee2MQTT:info  2020-12-01 14:46:53: MQTT publish: topic 'zigbee2mqtt/livingroom/sensor', payload '{"battery":80,"humidity":47.38,"linkquality":55,"temperature":18.8,"voltage":2900}'
Zigbee2MQTT:debug 2020-12-01 14:46:53: Received Zigbee message from 'bathroom/lights/switch', type 'attributeReport', cluster 'genOnOff', data '{"onOff":1}' from endpoint 1 with groupID 0
Zigbee2MQTT:debug 2020-12-01 14:46:54: Received MQTT message on 'zigbee2mqtt/office/lights/set' with data '{"transition":10,"color":{"x":0.458,"y":0.41}}'
Zigbee2MQTT:debug 2020-12-01 14:46:54: Publishing 'set' 'transition' to 'office/lights'
Zigbee2MQTT:debug 2020-12-01 14:46:54: Publishing 'set' 'color' to 'office/lights'
Zigbee2MQTT:info  2020-12-01 14:46:54: MQTT publish: topic 'zigbee2mqtt/office/lights/panel4', payload '{"brightness":64,"color_temp":454,"linkquality":78,"state":"ON","update":{"state":"idle"}}'
Zigbee2MQTT:info  2020-12-01 14:46:54: MQTT publish: topic 'zigbee2mqtt/office/lights/panel2', payload '{"brightness":64,"color_temp":454,"linkquality":86,"state":"ON","update":{"state":"idle"}}'
Zigbee2MQTT:info  2020-12-01 14:46:54: MQTT publish: topic 'zigbee2mqtt/office/lights/panel3', payload '{"brightness":64,"color_temp":454,"linkquality":76,"state":"ON","update":{"state":"idle"}}'
Zigbee2MQTT:info  2020-12-01 14:46:54: MQTT publish: topic 'zigbee2mqtt/office/lights/panel1', payload '{"brightness":64,"color_temp":454,"linkquality":42,"state":"ON","update":{"state":"idle"}}'
Zigbee2MQTT:info  2020-12-01 14:46:54: MQTT publish: topic 'zigbee2mqtt/office/lights/panel1', payload '{"brightness":64,"color_temp":2778,"linkquality":42,"state":"ON","update":{"state":"idle"}}'
Zigbee2MQTT:info  2020-12-01 14:46:54: MQTT publish: topic 'zigbee2mqtt/office/lights', payload '{"brightness":64,"color":{"x":0.458,"y":0.41},"color_temp":2778,"state":"ON"}'
Zigbee2MQTT:info  2020-12-01 14:46:54: MQTT publish: topic 'zigbee2mqtt/office/lights/panel2', payload '{"brightness":64,"color_temp":2778,"linkquality":86,"state":"ON","update":{"state":"idle"}}'
Zigbee2MQTT:info  2020-12-01 14:46:54: MQTT publish: topic 'zigbee2mqtt/office/lights/panel3', payload '{"brightness":64,"color_temp":2778,"linkquality":76,"state":"ON","update":{"state":"idle"}}'
Zigbee2MQTT:info  2020-12-01 14:46:54: MQTT publish: topic 'zigbee2mqtt/office/lights/panel4', payload '{"brightness":64,"color_temp":2778,"linkquality":78,"state":"ON","update":{"state":"idle"}}'
Zigbee2MQTT:info  2020-12-01 14:46:55: MQTT publish: topic 'zigbee2mqtt/bathroom/lights/switch', payload '{"linkquality":44,"power":0,"state":"ON","update":{"state":"idle"}}'
Zigbee2MQTT:debug 2020-12-01 14:46:55: Received Zigbee message from 'office/lights/panel3', type 'attributeReport', cluster 'lightingColorCtrl', data '{"colorTemperature":370}' from endpoint 1 with groupID 0
Zigbee2MQTT:debug 2020-12-01 14:46:55: Received Zigbee message from 'office/lights/panel4', type 'attributeReport', cluster 'lightingColorCtrl', data '{"colorTemperature":370}' from endpoint 1 with groupID 0
Zigbee2MQTT:debug 2020-12-01 14:46:55: Received Zigbee message from 'office/lights/panel2', type 'attributeReport', cluster 'lightingColorCtrl', data '{"colorTemperature":370}' from endpoint 1 with groupID 0
Zigbee2MQTT:debug 2020-12-01 14:46:55: Received Zigbee message from 'office/lights/panel1', type 'attributeReport', cluster 'lightingColorCtrl', data '{"colorTemperature":370}' from endpoint 1 with groupID 0
Zigbee2MQTT:info  2020-12-01 14:46:57: MQTT publish: topic 'zigbee2mqtt/office/lights', payload '{"brightness":64,"color":{"x":0.458,"y":0.41},"color_temp":370,"state":"ON"}'
Zigbee2MQTT:info  2020-12-01 14:46:57: MQTT publish: topic 'zigbee2mqtt/office/lights/panel3', payload '{"brightness":64,"color_temp":370,"linkquality":78,"state":"ON","update":{"state":"idle"}}'
Zigbee2MQTT:info  2020-12-01 14:46:57: MQTT publish: topic 'zigbee2mqtt/office/lights/panel4', payload '{"brightness":64,"color_temp":370,"linkquality":78,"state":"ON","update":{"state":"idle"}}'
Zigbee2MQTT:info  2020-12-01 14:46:57: MQTT publish: topic 'zigbee2mqtt/office/lights/panel2', payload '{"brightness":64,"color_temp":370,"linkquality":86,"state":"ON","update":{"state":"idle"}}'
Zigbee2MQTT:info  2020-12-01 14:46:57: MQTT publish: topic 'zigbee2mqtt/office/lights/panel1', payload '{"brightness":64,"color_temp":370,"linkquality":44,"state":"ON","update":{"state":"idle"}}'

@Koenkk
Copy link
Owner

Koenkk commented Dec 1, 2020

Looks good, can you make a PR? We can work further from there.

@sjorge
Copy link
Sponsor Contributor

sjorge commented Dec 1, 2020 via email

@Koenkk
Copy link
Owner

Koenkk commented Dec 3, 2020

Should be fixed.

Changes will be available in the latest dev branch in a few hours (https://www.zigbee2mqtt.io/how_tos/how-to-switch-to-dev-branch.html)

@sjorge
Copy link
Sponsor Contributor

sjorge commented Dec 7, 2020

Some interesting side effects after using this for a few days.

  • trådfri WS bulbs immediately report currentX and currentY when off or on.
  • trådfri WS bulbs only report colorTempersture when ON
  • trådfri WS report wrong colorTempersture at a later point when OFF
  • trådfri WS with 1.x firmware report correct colorTemperature once turned on
  • trådfri WS with 2.x firmware keeps reporting wrong colorTemperature after turning on

In all cases the bulb did change to the right color temp

  • innr CWS doesn’t report currentX, currentY, and colorTempersture when ON but usually after a minute or 3
  • innr CWS returns out of range colorTempersture values when OFF, but usually OK the next report, so it takes 2 att reports to be correct

It I have a bit more time I’ll see what these return with a get. I’d assume the same as the report but you never know.

(Only my FLOALT planets are still on a 1.x firmware as they lack updates)

@MattWestb
Copy link

The GU10 WS 2.0 have those min and max attributes for color temperature:

Cluster Attributes
View and edit cluster attributes.
 
Attributes of the selected cluster
color_temp_physical_max (id: 0x400c)
 
Value
454
 

Cluster Attributes
View and edit cluster attributes.
 
Attributes of the selected cluster
color_temp_physical_min (id: 0x400b)
 
Value
250

Its reporting Color_temperature (0x0007), Current_X (0x0003) and Current_Y (0x0004).
Both then on and off but i dont knowing if the readings it in range or not.

My old E27 CWS (ZLL) is reporting the same for colour temperature min and max.
Current_X (0x0003) and Current_Y (0x0004) is reporting numbers then reading attributes then is on and off but i dont knowing if they is in range or not. Its not reporting Color_temperature (0x0007) but i think its in color mode (no TC in HA).

Cluster attributes is red thru ZHA.

@sjorge
Copy link
Sponsor Contributor

sjorge commented Dec 8, 2020

I don't think currently the min/max range are even used without scene either, maybe they should though... that might prevent out of range values being set.

cc @Koenkk ?

I've not had time to do more testing with /get

@MattWestb
Copy link

MattWestb commented Dec 8, 2020

I think its better taking it in the calculating then its possible getting it from the device.
Saving in device properties for global use can being good !!
The CWS is RGB + W inside with simulated TC ?
From FCC-ID

@Koenkk
Copy link
Owner

Koenkk commented Dec 8, 2020

The min/max color temperature is not used yet indeed.

@sjorge
Copy link
Sponsor Contributor

sjorge commented Dec 8, 2020

The min/max color temperature is not used yet indeed.

Should I file a feature request for that against zhc?

@sjorge
Copy link
Sponsor Contributor

sjorge commented Jan 1, 2021

Been playing around with colorMode and xy vs hs a bit today, looks like for scenes we only write xy for now?

https://github.com/Koenkk/zigbee-herdsman-converters/blob/master/converters/toZigbee.js#L3542

image
Looks like field 3 and 4 can be set in that case, I'll add that to the todo list... which is rather long at this point haha.

All my bulbs are Innr and a Tint bulb, so I believe I should be able to test the effect on both kind of bulbs.

Edit: Off to bed I go now, but oddly enough both the Innr and Tint report 31 for the ColorCapabilities property!
So perhaps we are wrong and Innr does support enhancedHue! More digging needed, also would be while I eventually get to the colorTempMin/Max reading and storing... I'll also read ColoRCapabilities and store that. We should be able to automatically do the right thing without any odd meta.options!

Edit2: Ok the RB 185 C does support enhancedHue, the RB 250 C does not... why innr, why?!?!?

@MattWestb
Copy link

MattWestb commented Jan 2, 2021

Its looks that all manufactures is doing little home "cooking" in there devices and need little attention for working well. The latest is the new LIDL WS / CT that is reporting that they is doing TC + color but is only color (perhaps the zigbee module is doing both but dont have the RGB LEDs implanted for saving time and money in development and production).

Goooood digging done !!

Edit: IKEA GW / devices is setting up scenes with xy is verified by sniffing but "our deCONZ friends" have disabling storing scenes with XY for IKEA lights then its not working OK.
I finding it little strange but IKEA is reading all scenes back for verifying them after have storing them in the device. Its making more communication but perhaps its one track to going then coming to the final implantation of storing scenes.

I think it can being good storing the abnormal config in the system together with the base config for the devices (device.jar i think its named in Z2M) so all lights is getting it then joining the system if its possible implantation.
Example the LIDL CT bulbs having one override by default so its being exposed as CT in HA and not CT+RGB and the scenes can using the same parameters or extended ones for making storing scenes working OK.

Edit 2: Some TC lights (IKEA and more) dont have the maximal color range (that is possible in Zigbee standard) in there devices but can being red from the attribute if i have understanding it right. That is also good to pulling from the device and being passed to HA so its TC slide is working OK and also for saving scenes so not sending out of range parameters to the device that can making things working bad.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2021

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the stale Stale issues label Feb 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Something isn't working stale Stale issues
Projects
None yet
Development

No branches or pull requests

4 participants