GithubHelp home page GithubHelp logo

Comments (7)

mattes-bru avatar mattes-bru commented on June 4, 2024 1

@itavero this was a fast bug fixing, thank you. I can confirm that v1.1.1 works with my RGB lights.

from homebridge-z2m.

itavero avatar itavero commented on June 4, 2024

This sounds like a bug. I personally almost never change colors and I'm not even sure if I own lights that support color_hs, so I might have missed it.

Can you maybe fill in the questions from the Bug report issue template?
I've copied the template here:

Related devices
Are you experiencing this behavior with a particular device?
Please list which device(s) you experience this with.

To Reproduce
Steps to reproduce the behavior, for example:

  1. Change '...' via the Home app.
  2. Log shows MQTT message '...' being published to topic '...'
  3. The device does the following: '...'

Expected behavior
A clear and concise description of what you expected to happen, compared to what actually happened.

MQTT messages
If possible (and applicable), please provide the following:

  • The device entry from zigbee2mqtt/bridge/devices (note: this is different from zigbee2mqtt/bridge/config/devices)
  • Status update from zigbee2mqtt/[FRIENDLY_NAME]
  • Messages published by this plugin that might be related to your issue (can also be seen in the homebridge logs)

Versions used
Please provide the version of the following pieces of software:

  • This plugin
  • Homebridge
  • Zigbee2MQTT (can be found in MQTT topic zigbee2mqtt/bridge/info)
  • Homebridge Config UI X (if applicable)

from homebridge-z2m.

itavero avatar itavero commented on June 4, 2024

Just checked and there is indeed a bug in the code, in both handleSetHue and handleSetSaturation.
Also need to make sure that the queueDataForSetAction merges the nested objects correctly, which I doubt will be the case right now.

@mattes-bru If you could provide me with at least the device entry from zigbee2mqtt/bridge/devices (note: this is different from zigbee2mqtt/bridge/config/devices), that would save me some time when writing the automated test to verify this bug.

from homebridge-z2m.

mattes-bru avatar mattes-bru commented on June 4, 2024

@itavero thank you for looking into this. I did a small test and it seems that the values for hue and saturation are correct. Both values change to a promising number when I change the color in the HomeKit app. So the objects seem to be merged correctly.

   {
        "date_code": "20140331CNWT****",
        "definition": {
            "description": "LIGHTIFY LED CLA60 E27 RGBW",
            "exposes": [
                {
                    "features": [
                        {
                            "access": 7,
                            "description": "On/off state of this light",
                            "name": "state",
                            "property": "state",
                            "type": "binary",
                            "value_off": "OFF",
                            "value_on": "ON",
                            "value_toggle": "TOGGLE"
                        },
                        {
                            "access": 7,
                            "description": "Brightness of this light",
                            "name": "brightness",
                            "property": "brightness",
                            "type": "numeric",
                            "value_max": 254,
                            "value_min": 0
                        },
                        {
                            "access": 7,
                            "description": "Color temperature of this light",
                            "name": "color_temp",
                            "presets": [
                                {
                                    "description": "Coolest temperature supported",
                                    "name": "coolest",
                                    "value": 150
                                },
                                {
                                    "description": "Cool temperature (250 mireds / 4000 Kelvin)",
                                    "name": "cool",
                                    "value": 250
                                },
                                {
                                    "description": "Neutral temperature (370 mireds / 2700 Kelvin)",
                                    "name": "neutral",
                                    "value": 370
                                },
                                {
                                    "description": "Warm temperature (454 mireds / 2200 Kelvin)",
                                    "name": "warm",
                                    "value": 454
                                },
                                {
                                    "description": "Warmest temperature supported",
                                    "name": "warmest",
                                    "value": 500
                                }
                            ],
                            "property": "color_temp",
                            "type": "numeric",
                            "unit": "mired",
                            "value_max": 500,
                            "value_min": 150
                        },
                        {
                            "access": 7,
                            "description": "Color temperature after cold power on of this light",
                            "name": "color_temp_startup",
                            "presets": [
                                {
                                    "description": "Coolest temperature supported",
                                    "name": "coolest",
                                    "value": 150
                                },
                                {
                                    "description": "Cool temperature (250 mireds / 4000 Kelvin)",
                                    "name": "cool",
                                    "value": 250
                                },
                                {
                                    "description": "Neutral temperature (370 mireds / 2700 Kelvin)",
                                    "name": "neutral",
                                    "value": 370
                                },
                                {
                                    "description": "Warm temperature (454 mireds / 2200 Kelvin)",
                                    "name": "warm",
                                    "value": 454
                                },
                                {
                                    "description": "Warmest temperature supported",
                                    "name": "warmest",
                                    "value": 500
                                },
                                {
                                    "description": "Restore previous color_temp on cold power on",
                                    "name": "previous",
                                    "value": 65535
                                }
                            ],
                            "property": "color_temp_startup",
                            "type": "numeric",
                            "unit": "mired",
                            "value_max": 500,
                            "value_min": 150
                        },
                        {
                            "description": "Color of this light in the CIE 1931 color space (x/y)",
                            "features": [
                                {
                                    "access": 7,
                                    "name": "x",
                                    "property": "x",
                                    "type": "numeric"
                                },
                                {
                                    "access": 7,
                                    "name": "y",
                                    "property": "y",
                                    "type": "numeric"
                                }
                            ],
                            "name": "color_xy",
                            "property": "color",
                            "type": "composite"
                        },
                        {
                            "description": "Color of this light expressed as hue/saturation",
                            "features": [
                                {
                                    "access": 7,
                                    "name": "hue",
                                    "property": "hue",
                                    "type": "numeric"
                                },
                                {
                                    "access": 7,
                                    "name": "saturation",
                                    "property": "saturation",
                                    "type": "numeric"
                                }
                            ],
                            "name": "color_hs",
                            "property": "color",
                            "type": "composite"
                        }
                    ],
                    "type": "light"
                },
                {
                    "access": 2,
                    "description": "Triggers an effect on the light (e.g. make light blink for a few seconds)",
                    "name": "effect",
                    "property": "effect",
                    "type": "enum",
                    "values": [
                        "blink",
                        "breathe",
                        "okay",
                        "channel_change",
                        "finish_effect",
                        "stop_effect"
                    ]
                },
                {
                    "access": 1,
                    "description": "Link quality (signal strength)",
                    "name": "linkquality",
                    "property": "linkquality",
                    "type": "numeric",
                    "unit": "lqi",
                    "value_max": 255,
                    "value_min": 0
                }
            ],
            "model": "AC03645",
            "supports_ota": true,
            "vendor": "OSRAM"
        },
        "endpoints": {
            "3": {
                "bindings": [
                    {
                        "cluster": "genOnOff",
                        "target": {
                            "endpoint": 1,
                            "ieee_address": "0x00124b0021cc4c9b",
                            "type": "endpoint"
                        }
                    },
                    {
                        "cluster": "genLevelCtrl",
                        "target": {
                            "endpoint": 1,
                            "ieee_address": "0x00124b0021cc4c9b",
                            "type": "endpoint"
                        }
                    }
                ],
                "clusters": {
                    "input": [
                        "touchlink",
                        "genBasic",
                        "genIdentify",
                        "genGroups",
                        "genScenes",
                        "genOnOff",
                        "genLevelCtrl",
                        "lightingColorCtrl",
                        "manuSpecificOsram"
                    ],
                    "output": [
                        "genOta"
                    ]
                },
                "configured_reportings": [
                    {
                        "attribute": "onOff",
                        "cluster": "genOnOff",
                        "maximum_report_interval": 3600,
                        "minimum_report_interval": 0,
                        "reportable_change": 0
                    },
                    {
                        "attribute": "currentLevel",
                        "cluster": "genLevelCtrl",
                        "maximum_report_interval": 3600,
                        "minimum_report_interval": 5,
                        "reportable_change": 1
                    }
                ]
            }
        },
        "friendly_name": "0x7cb03eaa00ac82f3",
        "ieee_address": "0x7cb03eaa00ac82f3",
        "interview_completed": true,
        "interviewing": false,
        "model_id": "CLA60 RGBW OSRAM",
        "network_address": 35569,
        "power_source": "Mains (single phase)",
        "software_build_id": "V1.05.10",
        "supported": true,
        "type": "Router"
    }

from homebridge-z2m.

itavero avatar itavero commented on June 4, 2024

Thanks for the device model. I think I'll have some time to fix this in the coming few days. I'll make a release afterwards ;)

With regards to merging the objects: right now it goes OK, but it basically merges these objects:

  • {
      "saturation": 100
    }
  • {
      "hue": 0
    }

However, the two objects should actually be:

  • {
      "color": {
        "saturation": 100
      }
    }
  • {
      "color": {
        "hue": 0
      }
    }

I'm not sure yet if the nested objects will be merged correctly with my current code, but that can be tested easily. Just a note for myself that I do explicitly test this 😉

from homebridge-z2m.

itavero avatar itavero commented on June 4, 2024

Checks haven't completed yet and my lunch break is over, but I think I've fixed the issue (as you can see in the PR mentioned above).
I'll probably make a release later today.

from homebridge-z2m.

itavero avatar itavero commented on June 4, 2024

@mattes-bru This should be fixed in v1.1.1 which has just been released.

from homebridge-z2m.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.