home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.78k stars 30.88k forks source link

Osramlightify color tempertaure inverted #6498

Closed deisi closed 7 years ago

deisi commented 7 years ago

Make sure you are running the latest version of Home Assistant before reporting an issue.

Home Assistant release (hass --version): 0.39.3

Python release (python3 --version): Python 3.4.2

Component/platform: osramlightify

Description of problem: The scale when setting the color temperature with color_temp is inverted. E.g. 500 mired is bright white, and 154 mired is yellow. But it should be the other way around. See https://en.wikipedia.org/wiki/Mired

Expected: The other way around. 154 mired should be bright white and 500 mired should me more yellowish.

Problem-relevant configuration.yaml entries and steps to reproduce:

- platform: osramlightify
  host: 172.16.1.82

I raelized it when I wanted to use the fluxer. I had to invert it. Now it is:

- platform: flux
  lights:
    - light.beamer
  name: Fluxer
  start_time: '7:00'
  stop_time: '23:00'
  start_colortemp: 1900
  sunset_colortemp: 4000
  stop_colortemp: 6000
  brightness: 200
  disable_brightness_adjust: True
  mode: mired

and it works as expected. White in the morning, and yellowish in the evening.

Additional info: I might find the time to fix it myself, but I wanted to drop it here anyways.

Molodax commented 7 years ago

Thank you, @deisi Now I understand why my fluxer behaved strangely. It would be great if you could fix it!

amelchio commented 7 years ago

This seems like the LIFX issue that was fixed in #6087.

I do not have Osram lights but I ported the fix anyway: https://github.com/amelchio/home-assistant/tree/osramlightify-colortemp

If someone tests that it works, I can submit it for inclusion.

deisi commented 7 years ago

@amelchio It is working. Now 500 mired is yellow and 154 is white. So plz make a pr ready for merge.

billybigbass commented 7 years ago

I have noticed the same inverted color temperature behaviour with the LimitlessLED component. Is it possible to apply the same fix to that as well or should I start another thread?

amelchio commented 7 years ago

@billybigbass Definitely open a new issue.