Giter Club home page Giter Club logo

Comments (22)

ebaauw avatar ebaauw commented on June 13, 2024 2

It’s a combination of a weird interpretation of the ZigBee standard on the IKEA side, and poor handling by deCONZ. I have good hopes it can be fixed at the deCONZ side, but it will take some time. I’m not too familiar with the code supporting lights and Manuel is traveling and will want to work on the stability issues first.

from deconz-rest-plugin.

tpetri avatar tpetri commented on June 13, 2024 1

I have been able to setup the scenes for me and they are working as intended as far as I can tell.
If you define the color temperature manually through the REST API by setting x,y color (needs some experimenting to get the temperature that you want) and the brightness manually and then store the scene manually by using the REST API, you get the correct expected behaviour when recalling the scenes (e.g. also the transition at the same time of brightness and color).

Edit: I'm referring to the IKEA E27 WS opal 980lm bulbs

from deconz-rest-plugin.

ebaauw avatar ebaauw commented on June 13, 2024

I added the Ikea Trådfri to the group and scene, and the ct value for this bulb is set correctly. However, it reports colormode xy after recalling the scene?! My guess would be that deCONZ translates the ct value to xy values (but why?!), which somehow results in out-of-range values for the OSRAM bulbs.

Here's the scene with the Trådfri added:

$ ph_get /groups/240/scenes/1
{
  "lights": [
    {
      "bri": 254,
      "colormode": "ct",
      "ct": 370,
      "id": "244",
      "on": true,
      "transitiontime": 4
    },
    {
      "bri": 254,
      "id": "241",
      "on": true,
      "transitiontime": 4
    },
    {
      "bri": 254,
      "id": "242",
      "on": true,
      "transitiontime": 4
    },
    {
      "bri": 254,
      "colormode": "ct",
      "ct": 370,
      "id": "243",
      "on": true,
      "transitiontime": 4
    },
    {
      "bri": 254,
      "colormode": "ct",
      "ct": 454,
      "id": "101",
      "on": true,
      "transitiontime": 4
    }
  ],
  "name": "default",
  "state": 0
}

The database now contains:

[
  {
    "bri": 254,
    "cl": false,
    "clTime": 0,
    "cm": "ct",
    "ct": 370,
    "lid": "244",
    "on": true,
    "tt": 4,
    "x": 30091,
    "y": 26912
  },
  {
    "bri": 254,
    "cm": "none",
    "lid": "241",
    "on": true,
    "tt": 4
  },
  {
    "bri": 254,
    "cm": "none",
    "lid": "242",
    "on": true,
    "tt": 4
  },
  {
    "bri": 254,
    "cl": false,
    "clTime": 0,
    "cm": "ct",
    "ct": 370,
    "lid": "243",
    "on": true,
    "tt": 4,
    "x": 30091,
    "y": 26912
  },
  {
    "bri": 254,
    "cl": false,
    "clTime": 25,
    "cm": "ct",
    "ct": 454,
    "lid": "101",
    "on": true,
    "tt": 4,
    "x": 33112,
    "y": 27216
  }
]

Here's the lights (after reading the attributes of the 0x0300 clusters in de deCONZ GUI):

$ ph_get /lights
{
  "101": {
    "etag": "33b16ad8423e361f0a926c5a756fd623",
    "hascolor": true,
    "manufacturer": "IKEA of Sweden",
    "modelid": "TRADFRI bulb E27 WS�opal 980lm",
    "name": "Trådfri",
    "state": {
      "alert": "none",
      "bri": 254,
      "colormode": "xy",
      "ct": 454,
      "on": true,
      "reachable": true
    },
    "swversion": "1.1.1.1-5.7.2.0",
    "type": "Color temperature light",
    "uniqueid": "00:0b:57:ff:fe:39:35:7f-01"
  },
  "241": {
    "etag": "919310d5ebeac0790c7ead7e0f5dd218",
    "hascolor": false,
    "manufacturer": "innr",
    "modelid": "UC 110",
    "name": "Kitchen Sink Left",
    "state": {
      "alert": "none",
      "bri": 254,
      "on": true,
      "reachable": true
    },
    "swversion": "0x10000c46",
    "type": "Dimmable light",
    "uniqueid": "00:15:8d:00:00:cd:d7:f7-01"
  },
  "242": {
    "etag": "919310d5ebeac0790c7ead7e0f5dd218",
    "hascolor": false,
    "manufacturer": "innr",
    "modelid": "UC 110",
    "name": "Kitchen Sink Right",
    "state": {
      "alert": "none",
      "bri": 254,
      "on": true,
      "reachable": true
    },
    "swversion": "0x10000c46",
    "type": "Dimmable light",
    "uniqueid": "00:15:8d:00:00:7e:2f:eb-01"
  },
  "243": {
    "etag": "d593ac7cdeaa0a6e2cb7aa96533b9865",
    "hascolor": true,
    "manufacturer": "OSRAM",
    "modelid": "Classic B40 TW - LIGHTIFY",
    "name": "Kitchen Stove Left",
    "state": {
      "alert": "none",
      "bri": 254,
      "colormode": "ct",
      "ct": 153,
      "on": true,
      "reachable": true
    },
    "swversion": "V1.04.12",
    "type": "Color temperature light",
    "uniqueid": "84:18:26:00:00:07:f8:12-03"
  },
  "244": {
    "etag": "182a1b395624560d46a7aaeca61f5083",
    "hascolor": true,
    "manufacturer": "OSRAM",
    "modelid": "Classic B40 TW - LIGHTIFY",
    "name": "Kitchen Stove Right",
    "state": {
      "alert": "none",
      "bri": 254,
      "colormode": "ct",
      "ct": 153,
      "on": true,
      "reachable": true
    },
    "swversion": "V1.04.12",
    "type": "Color temperature light",
    "uniqueid": "84:18:26:00:00:0a:56:4d-03"
  }
}

from deconz-rest-plugin.

ebaauw avatar ebaauw commented on June 13, 2024

My guess would be that deCONZ translates the ct value to xy values.

Indeed. Here's what happens with the Hue Extended color lights.

$ ph_put /groups/230/action '{"on":true,"bri":254,"ct":463}'
$ ph_put /groups/230/scenes/1/store '{"transitiontime":4}'
$ ph_get /groups/230/scenes/1
{
  "lights": [
    {
      "bri": 254,
      "id": "234",
      "on": true,
      "transitiontime": 4
    },
    {
      "bri": 254,
      "colormode": "ct",
      "ct": 463,
      "id": "232",
      "on": true,
      "transitiontime": 4
    },
    {
      "bri": 254,
      "colormode": "ct",
      "ct": 463,
      "id": "233",
      "on": true,
      "transitiontime": 4
    },
    {
      "bri": 254,
      "colormode": "ct",
      "ct": 463,
      "id": "231",
      "on": true,
      "transitiontime": 4
    }
  ],
  "name": "default",
  "state": 0
}
$ ph_put /groups/230/scenes/1/recall
$ ph_get /lights/231/state
{
  "alert": "none",
  "bri": 254,
  "colormode": "ct",
  "ct": 463,
  "effect": "none",
  "hue": 13158,
  "on": true,
  "reachable": true,
  "sat": 208,
  "xy": [
    0.511007,
    0.416535
  ]
}
# read attributes of the 0x0300 cluster in deCONZ GUI
$ ph_get /lights/231/state
{
  "alert": "none",
  "bri": 254,
  "colormode": "xy",
  "ct": 459,
  "effect": "none",
  "hue": 13158,
  "on": true,
  "reachable": true,
  "sat": 209,
  "xy": [
    0.511589,
    0.41675
  ]
}

from deconz-rest-plugin.

ebaauw avatar ebaauw commented on June 13, 2024

which somehow results in out-of-range values for the OSRAM bulbs

Or the OSRAMs simply don't accept a change to xy. Using other values for ct doesn't work either.

from deconz-rest-plugin.

ebaauw avatar ebaauw commented on June 13, 2024

I saw that the OSRAM lights do support attribute reporting in commit 887e6b1. I'm still on 2.04.57, but I managed to configure attribute reporting manually for the 0x0300 cluster. I now receive multiple websocket notifications when recalling the scene:

Sat Jul 29 2017 19:37:08: {"e":"changed","id":"244","r":"lights","state":{"ct":370},"t":"event"}
Sat Jul 29 2017 19:37:08: {"e":"changed","id":"243","r":"lights","state":{"ct":370},"t":"event"}
Sat Jul 29 2017 19:37:08: {"e":"changed","id":"243","r":"lights","state":{"ct":153},"t":"event"}
Sat Jul 29 2017 19:37:09: {"e":"scene-called","gid":"240","r":"scenes","scid":"1","t":"event"}
Sat Jul 29 2017 19:37:09: {"e":"changed","id":"243","r":"lights","state":{"ct":370},"t":"event"}
Sat Jul 29 2017 19:37:09: {"e":"changed","id":"243","r":"lights","state":{"ct":153},"t":"event"}
Sat Jul 29 2017 19:37:11: {"e":"changed","id":"244","r":"lights","state":{"ct":153},"t":"event"}

The scene actually contains "ct": 370 and deCONZ sets the state to that value upon recalling the scene (so it actually thinks it's sending 370 to the light?). However, the lights turn to ct 153, which deCONZ now sees through the attribute reporting.

from deconz-rest-plugin.

manup avatar manup commented on June 13, 2024

We have seen various problems with OSRAM scenes and ct, also when switching between xy and ct. Maybe the reporting can help here to reduce the issues.

from deconz-rest-plugin.

ebaauw avatar ebaauw commented on June 13, 2024

These are colour temperature lights, which don't support xy. Reporting helps showing the actual value, after recalling the scene, but the lights still have the wrong value after recalling the scene.

The issue isn't with recalling the scene, though; it's with storing it. When I store the scene per light from the deCONZ GUI, the correct ct value is set, even when subsequently recalling the scene from the REST API.

from deconz-rest-plugin.

snozzlebert avatar snozzlebert commented on June 13, 2024

This also happens with the IKEA GU 10 Color Temperature lights.

{
    "ctmax": 454,
    "ctmin": 250,
    "manufacturername": "IKEA of Sweden",
    "modelid": "TRADFRI bulb GU10 WS 400lm",
    "state": {
        "alert": "none",
        "bri": 1,
        "colormode": "ct",
        "ct": 454,
        "on": true,
        "reachable": true
    },
    "swversion": "1.2.217",
    "type": "Color temperature light"
...
}

Recalling a saved scene doesn't restore the color temperature. Probably because the color temperature isn't stored. When I set the light to state:

{
	"on": true,
	"bri": 1,
	"ct": 454,
	"transitiontime": 0
}

only 4 of the leds in the bulb are on. After that I store the light state in a scene. After changing the light color and recalling the stored scene all leds in the bulb are on and the REST API shows the following state:

    "state": {
        "alert": "none",
        "bri": 1,
        "colormode": "xy",
        "ct": 370,
        "on": true,
        "reachable": true
    }

from deconz-rest-plugin.

ebaauw avatar ebaauw commented on June 13, 2024

Odd, I wouldn’t expect different IKEA lights to behave differently, but maybe it’s the newer firmware. I’ll retest my E27 white spectrum.

from deconz-rest-plugin.

tpetri avatar tpetri commented on June 13, 2024

I can verify this exact same behaviour for "TRADFRI bulb E27 WS opal 980lm" (Version 1.2.217) bulbs, meaning that I cannot use scenes with deconz if I ever want to have different color than ct 370.

What is the current state on this? Is it a bug on IKEAs side or can this be fixed in deconz?

from deconz-rest-plugin.

mattiasflodin avatar mattiasflodin commented on June 13, 2024

I'm seeing the opposite behavior with the TRADFRI bulb E27 WS opal 980lm bulbs. If I change color temperature and brightness in the same REST API call, then only the color temperature changes (querying state over the REST API indicates that deCONZ believes the brightness did change though). Changing the parameters separately works. I'm not familiar with the Zigbee protocol but the intuition I get is that one of the two updates is being lost before it is sent across the Zigbee network. I don't see why deCONZ would need to query the bulb state between setting the two parameters.

Edit: It seems the rabbit hole goes a bit deeper than just being a deCONZ issue? https://community.home-assistant.io/t/ikea-light-on-hue-hub-scene-doesnt-change-brightness/32755

from deconz-rest-plugin.

manup avatar manup commented on June 13, 2024

Scenes in the IKEA bulbs have indeed a bug for some reason the color temperature is not restored to the value stored in the scene. I'm not sure if the issue can be fixed on deCONZ side, needs more testing. Scenes can be created and stored in various ways maybe IKEA does support one of them.

from deconz-rest-plugin.

snozzlebert avatar snozzlebert commented on June 13, 2024

I can confirm the observation of @tpetri for the IKEA TRADFRI bulb GU10 WS 400lm lights. See my comment in December: e0513b1#commitcomment-26187674
While it is a color temperature light, only x,y values seems to be stored for scenes.

from deconz-rest-plugin.

manup avatar manup commented on June 13, 2024

Good find, we can build a workaround on top of that.

from deconz-rest-plugin.

mattiasflodin avatar mattiasflodin commented on June 13, 2024

I apologize if I'm simply being ignorant of how the protocol works, but I don't have any issues setting the color temperature of the Tradfri bulb — as long as I don't set the brightness in the same API call. I.e. sending:

{"on": true, "ct": 400}

to the state endpoint works just fine. But if I send

{"on": true, "ct": 400, "bri": 200}

then it misbehaves.

from deconz-rest-plugin.

bootstrapbats avatar bootstrapbats commented on June 13, 2024

If I click on my ikea remote group via the web interface and change temperature not with the temperature slide but with the color slide then I get the temperature stored in the scene with my ikea bulbs

from deconz-rest-plugin.

tpetri avatar tpetri commented on June 13, 2024

@mattiasflodin that is correct, setting the temperature with ct works, but if you want to store it as a scene, this will fail. Maybe the same reason why setting ct and bri at once does not work, I haven't actually tried setting xy together with bri, if that works, this would be the solution for a workaround indeed.

from deconz-rest-plugin.

stale avatar stale commented on June 13, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from deconz-rest-plugin.

ebaauw avatar ebaauw commented on June 13, 2024

This topic actually diverted into two issues, neither of which as been solved:

  • The original issue that scenes for OSRAM lights don't set ct, because deCONZ stores the xy values instead of the ct values. One of my OSRAM bulbs actually broke, and I replaced both by Hue bulbs. I still have the working one, though, if we need some more testing.
  • Not the same issue of a bug in the IKEA firmware, that the light doesn't accept new commands when a transition is still underway. Combined with a default transition time of 0.4 sec added by the deCONZ REST API, this causes the light to ignore the ct in a PUT of both bri and ct. As workaround, specify a transitiontime of 0, or issue two separate request (causing the ct to arrive just late enough at the light. See also #894, #384,

from deconz-rest-plugin.

tpetri avatar tpetri commented on June 13, 2024

In my case the issue with IKEA bulbs was that when storing a scene, the bulbs would store the color if and only if it was set with xy. If the ct value was used the temperature was not (or wrongly) stored. No connection to transition times, at least for me and as far as I understand/see. I haven't been checking if something has changed to this end (never touch a running system ;)).

from deconz-rest-plugin.

stale avatar stale commented on June 13, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from deconz-rest-plugin.

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.