Giter Site home page Giter Site logo

Comments (11)

bramstroker avatar bramstroker commented on August 15, 2024 1

So I guess if any of those modes are available for an entity, avoid loading rgb.csv.gz etc, and instead just use the HS LUT, no problems? 🤔

Yes that also seems the easiest solution to me. I can have a look into this next friday.

from homeassistant-powercalc.

gdreelin avatar gdreelin commented on August 15, 2024 1

@bramstroker oh ok thanks! Love you username...lol

from homeassistant-powercalc.

bramstroker avatar bramstroker commented on August 15, 2024

Yes, at the moment rgb mode is not yet supported, but it should not be much work to add that.
How did you discover that you need both hs and rgb for your YeeLight? This does not sound logical to me, I would expect home assistant to control the light by one or the other when changing colors on the color wheel.
I am not sure if I have any hardware which has rgb as a supported mode, I can check that tonight when I am home. When I don't have a light supporting this I am unable to test.

from homeassistant-powercalc.

bramstroker avatar bramstroker commented on August 15, 2024

Could you also check in developer tools, which color modes are supported for your light?

Screenshot 2021-07-13 at 08 33 45

from homeassistant-powercalc.

aetha avatar aetha commented on August 15, 2024

Sure thing, here's the entity attributes, (I had just taken note of supported_color_modes to find out):

min_mireds: 153
max_mireds: 588
effect_list:
  - Strobe color
  - Police
  - Christmas
  - RGB
  - Random Loop
  - Fast Random Loop
  - LSD
  - Slowdown
  - Night Mode
  - Date Night
  - Movie
  - Sunrise
  - Sunset
  - Romance
  - Happy Birthday
  - Disco
  - Strobe epilepsy!
  - Alarm
  - Police2
  - WhatsApp
  - Facebook
  - Twitter
  - Home
  - Candle Flicker
  - Slow Temp
  - Stop
  - Warm cycle
  - Warm cycle dim
supported_color_modes:
  - color_temp
  - hs
  - rgb
color_mode: rgb
brightness: 255
hs_color:
  - 0
  - 100
rgb_color:
  - 255
  - 0
  - 0
xy_color:
  - 0.701
  - 0.299
flowing: false
music_mode: false
friendly_name: Arcana shelves
icon: mdi:floor-lamp
supported_features: 44

Support for all three modes within Yeelight’s API is documented here:
https://www.yeelight.com/download/Yeelight_Inter-Operation_Spec.pdf

"COLOR_MODE": Current light mode. 1 means color mode, 2 means color temperature mode, 3 means HSV mode.

I think it’s just a convenience for developers, to pick whichever suits them, they’re functionally identical. Using the Lovelace colour wheel, or the Yeelight app spectrum, it switches to color_mode: rgb. It only seems to be in hs with a manual service call to light.turn_on, ie setting hs_color.

Looks like HASS makes this easy to deal with, though.
https://developers.home-assistant.io/docs/core/entity/light/

If the light is in mode COLOR_MODE_HS, COLOR_MODE_RGB or COLOR_MODE_XY, the light's state attribute will contain the light's color expressed in hs, rgb and xy color format.

If the light is in mode COLOR_MODE_RGBW or COLOR_MODE_RGBWW, the light's state attribute will contain the light's color expressed in hs, rgb and xy color format.

So I guess if any of those modes are available for an entity, avoid loading rgb.csv.gz etc, and instead just use the HS LUT, no problems? 🤔

from homeassistant-powercalc.

aetha avatar aetha commented on August 15, 2024

Cool, thanks!

from homeassistant-powercalc.

bramstroker avatar bramstroker commented on August 15, 2024

I have made some changes in branch feature/rgb-mode are you able to test with this branch in your installation?
I don't have any lights with rgb color mode so I am unable to test fully. Did have a look at this code of the light component in Home Assistant, and they also set the HS values when selecting RGB of XY color mode, so I am pretty sure my changes should work.

from homeassistant-powercalc.

bramstroker avatar bramstroker commented on August 15, 2024

Made another commit to the branch. PR #50 contains the changes for supporting the rgb mode.

from homeassistant-powercalc.

bramstroker avatar bramstroker commented on August 15, 2024

just released 0.2.6 which should include necessary changes to make this work.

from homeassistant-powercalc.

gdreelin avatar gdreelin commented on August 15, 2024

Hi, I’m trying to make LUT files for my Yeelight bulbs. The integration supports color_temp, hs, and rgb modes. I tried making the rgb.csv table with a format of bri,r,g,b,watt, but fell flat when powercalc realised it doesn’t know what this rgb business is about. 😅

2021-07-13 14:34:30 DEBUG (MainThread) [custom_components.powercalc.strategy_lut] Loading data file: /home/ha-arcana/.homeassistant/custom_components/powercalc/data/yeelight/YLDP06YL/color_temp.csv.gz
2021-07-13 14:34:30 DEBUG (MainThread) [custom_components.powercalc.strategy_lut] Loading data file: /home/ha-arcana/.homeassistant/custom_components/powercalc/data/yeelight/YLDP06YL/hs.csv.gz
2021-07-13 14:34:30 DEBUG (MainThread) [custom_components.powercalc.strategy_lut] Loading data file: /home/ha-arcana/.homeassistant/custom_components/powercalc/data/yeelight/YLDP06YL/rgb.csv.gz
2021-07-13 14:34:30 ERROR (MainThread) [custom_components.powercalc.sensor] Skipping sensor setup light.arcana_shelves: Unsupported color mode rgb

If you can add RGB, I should be able to get this to work. Perhaps having some logic to convert HS table values into RGB would a useful way to do it? Once LUTs are working for this bulb, I can add mine into the repository.

@aetha

I have some of those YeeLights too were you able to get the LUT files to make them work? Could you post them if you did? Thanks

from homeassistant-powercalc.

bramstroker avatar bramstroker commented on August 15, 2024

@gdreelin you don't have to create a rgb file. Only hs and color_temp are needed.

from homeassistant-powercalc.

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.