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

Possible to get the Bulb Type? #12

Closed
Joey-1970 opened this issue Mar 1, 2020 · 2 comments
Closed

Possible to get the Bulb Type? #12

Joey-1970 opened this issue Mar 1, 2020 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@Joey-1970
Copy link

Hello Glenn,

I'm still working on my module.
In the category there are Bulb with different white, Bulb with Colors or transformers.

Is it possible to find out, which device is connected without analyze the parameter from device Info:
[3] => stdClass Object
(
[0] => IKEA of Sweden
[1] => TRADFRI bulb E14 CWS opal 600lm
Maybe I can read the "CWS" to know this bulb can colors and the "WS" when it is only different white but that look not very professional.
I want to change the controls dependent of the exact device...
Here a big list: http://sprunge.us/CCQF
But I don't find what I'm searching for, do you know whats the best way?

Joachim

@glenndehaan glenndehaan self-assigned this Mar 1, 2020
@glenndehaan glenndehaan added the question Further information is requested label Mar 1, 2020
@glenndehaan
Copy link
Owner

Yeah so I did some testing with my lights and the output of my bulbs is as follows:

{
  "9001": "Ceiling 1",
  "9002": 1518962113,
  "9020": 1583058020,
  "9003": 65537,
  "9054": 0,
  "9019": 1,
  "3": {
    "0": "IKEA of Sweden",
    "1": "TRADFRI bulb E27 CWS opal 600lm",
    "2": "",
    "3": "1.3.009",
    "6": 1
  },
  "5750": 2,
  "3311": [
    {
      "5850": 1,
      "5851": 203,
      "5708": 42596,
      "5707": 5427,
      "5709": 30015,
      "5710": 26870,
      "5706": "f1e0b5",
      "9003": 0
    }
  ]
}
{
  "9001": "TV Light",
  "9002": 1519564265,
  "9020": 1583058045,
  "9003": 65544,
  "9054": 0,
  "9019": 1,
  "3": {
    "0": "IKEA of Sweden",
    "1": "TRADFRI bulb E27 WS opal 980lm",
    "2": "",
    "3": "2.3.007",
    "6": 1
  },
  "5750": 2,
  "3311": [
    {
      "5850": 1,
      "5851": 25,
      "5717": 0,
      "5711": 454,
      "5709": 33008,
      "5710": 27213,
      "5706": "efd275",
      "9003": 0
    }
  ]
}
{
  "9001": "Bed Front",
  "9002": 1534071987,
  "9020": 1582999678,
  "9003": 65546,
  "9054": 0,
  "9019": 1,
  "3": {
    "0": "IKEA of Sweden",
    "1": "TRADFRI bulb GU10 W 400lm",
    "2": "",
    "3": "1.2.214",
    "6": 1
  },
  "5750": 2,
  "3311": [
    {
      "5850": 1,
      "5851": 203,
      "9003": 0
    }
  ]
}

From this I could take the following:

  1. You are able to check if a light is just only dimmable by checking the 3311 output. Since this is missing the RGB values.
  2. If you want to check if a light is RGB capable or just Cold / Warm capable. Well.... I can't find it. The only thing that I discovered is that when using the 'default' colors in the app the RGB bulbs will never use the colors described here: https://github.com/glenndehaan/ikea-tradfri-coap-docs#cold--warm-bulbs

So you could check if a bulb is using those colors by reading out the 5706 hex value. In the example output above all lights where set to the 'Glow' color provided by IKEA. But as you can see the RGB bulb won't choose that hex value.

Now I know that this method also feels hacky. And if I was making an implementation I would just go for a regex of the item name.

@Joey-1970
Copy link
Author

Thank you very much!
Your data help me, to configure devices I don't have.

Joachim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants