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.94k stars 30.99k forks source link

Color Extractor does not work with RGBW Lights #111248

Closed sspaul1976 closed 5 months ago

sspaul1976 commented 9 months ago

The problem

This integration does not appear to work with RGBW Lights. There is no error, it simply does not do anything. I assume this is because the supported color mode for my lights lists RGBW and not RGB, but not sure. These are WiZ recessed can retrofit bulbs.

What version of Home Assistant Core has the issue?

2024.2.3

What was the last working version of Home Assistant Core?

2024.2.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Color Extractor

Link to integration documentation on our website

https://www.home-assistant.io/integrations/color_extractor/

Diagnostics information

No response

Example YAML snippet

alias: Album Lights
description: ""
trigger:
  - platform: state
    entity_id:
      - media_player.bar
condition: []
action:
  - service: color_extractor.turn_on
    data_template:
      color_extract_url: "{{ states.media_player.bar.attributes.entity_picture }}"
      entity_id: light.pool_table

Anything in the logs that might be useful for us?

State attributes of the light/group:

min_color_temp_kelvin: 2202
max_color_temp_kelvin: 6535
min_mireds: 153
max_mireds: 454
effect_list:
  - Bedtime
  - Candlelight
  - Christmas
  - Club
  - Cool white
  - Cozy
  - Daylight
  - Deepdive
  - Fall
  - Fireplace
  - Focus
  - Forest
  - Golden white
  - Halloween
  - Jungle
  - Mojito
  - Night light
  - Ocean
  - Party
  - Pastel Colors
  - Plantgrowth
  - Pulse
  - Relax
  - Rhythm
  - Romance
  - Spring
  - Steampunk
  - Summer
  - Sunset
  - TV time
  - True colors
  - Wake up
  - Warm White
supported_color_modes:
  - color_temp
  - rgbw
effect: null
color_mode: rgbw
brightness: 148
color_temp_kelvin: null
color_temp: null
hs_color:
  - 248.235
  - 100
rgb_color:
  - 35
  - 0
  - 255
xy_color:
  - 0.143
  - 0.043
rgbw_color:
  - 35
  - 0
  - 255
  - 0
entity_id:
  - light.wiz_rgbw_tunable_b8bc34
  - light.wiz_rgbw_tunable_bb2271
  - light.wiz_rgbw_tunable_b93c5e
  - light.wiz_rgbw_tunable_b8b70c
  - light.wiz_rgbw_tunable_b90664
icon: mdi:lightbulb-group
friendly_name: Pool Table
supported_features: 4

Additional information

Screenshot_20240223-184437

home-assistant[bot] commented 9 months ago

Hey there @genericstudent, mind taking a look at this issue as it has been labeled with an integration (color_extractor) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `color_extractor` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign color_extractor` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


color_extractor documentation color_extractor source (message by IssueLinks)

GenericStudent commented 9 months ago

Hi @sspaul1976, couple things spring to mind.

One, could you enable debug logging on the color_extractor integration and see what it produces?

Second, I can see your debug of the entity has rgb_color which is all this integration invokes so rgbw shouldn't matter, could you try loading a debug image of all green and seeing if that works, or aiming it against only a single bulb instead of a group (if its a group)

Let me know if the extra logging gives you anything, cheers

sspaul1976 commented 9 months ago

Thanks, Adam.

I was able to get it to work with a bit of a hack. I think the external URL was being blocked and path doesn't seem to work for local. Below does work:

service: color_extractor.turn_on data_template: color_extract_url: >-

http://192.168.86.249:8123{{states.media_player.bar.attributes.entity_picture_local }} entity_id: light.music_room

I also added my local IP to the allow external URL in config.

On Sat, Feb 24, 2024, 03:09 Adam Cooper @.***> wrote:

Hi @sspaul1976 https://github.com/sspaul1976, couple things spring to mind.

One, could you enable debug logging https://www.home-assistant.io/integrations/logger/ on the color_extractor integration and see what it produces?

Second, I can see your debug of the entity has rgb_color which is all this integration invokes so rgbw shouldn't matter, could you try loading a debug image of all green and seeing if that works, or aiming it against only a single bulb instead of a group (if its a group)

Let me know if the extra logging gives you anything, cheers

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/111248#issuecomment-1962293700, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPFFBRORPV5LIZ7Q5AX6Z3YVGN3BAVCNFSM6AAAAABDXQEMIKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRSGI4TGNZQGA . You are receiving this because you were mentioned.Message ID: @.***>

GenericStudent commented 9 months ago

Thanks, Adam.

I was able to get it to work with a bit of a hack. I think the external URL was being blocked and path doesn't seem to work for local. Below does work:

service: color_extractor.turn_on data_template: color_extract_url: >-

http://192.168.86.249:8123{{states.media_player.bar.attributes.entity_picture_local }} entity_id: light.music_room

I also added my local IP to the allow external URL in config.

On Sat, Feb 24, 2024, 03:09 Adam Cooper @.***> wrote:

Hi @sspaul1976 https://github.com/sspaul1976, couple things spring to mind.

One, could you enable debug logging https://www.home-assistant.io/integrations/logger/ on the color_extractor integration and see what it produces?

Second, I can see your debug of the entity has rgb_color which is all this integration invokes so rgbw shouldn't matter, could you try loading a debug image of all green and seeing if that works, or aiming it against only a single bulb instead of a group (if its a group)

Let me know if the extra logging gives you anything, cheers

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/111248#issuecomment-1962293700, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPFFBRORPV5LIZ7Q5AX6Z3YVGN3BAVCNFSM6AAAAABDXQEMIKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRSGI4TGNZQGA . You are receiving this because you were mentioned.Message ID: @.***>

Sounds right to me, it should produce a warning/error if the external url isn't authorised.

Glad you got it working.

yanirel commented 9 months ago

not working for me (its just not changing the led status)

service: color_extractor.turn_on data_template: color_extract_url: "http://192.168.1.131:8123/{{states.media_player.yanir_room_speaker.attributes.entity_picture_local }}" entity_id: light.led_s

yanirel commented 9 months ago

get an error on the log :

External URL 'https://lh3.googleusercontent.com/wdNi-5uwhaxeKZzH-FuWl5V4t3VIDYarOxUmgbhdmXYAFHRTFG9GOnBoFDHDGBfZyHVHOP8c4TreX=w120-h120-l90-rj' is not allowed, please add to 'allowlist_external_urls'

sspaul1976 commented 9 months ago

I had to add my local IP in the config yaml to get it to work.

homeassistant: allowlist_external_urls:

On Sat, Feb 24, 2024, 13:11 yanirel @.***> wrote:

get an error on the log :

External URL ' https://lh3.googleusercontent.com/wdNi-5uwhaxeKZzH-FuWl5V4t3VIDYarOxUmgbhdmXYAFHRTFG9GOnBoFDHDGBfZyHVHOP8c4TreX=w120-h120-l90-rj ' is not allowed, please add to 'allowlist_external_urls'

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/core/issues/111248#issuecomment-1962442840, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABPFFBRULJXBU7QAAGXIWMDYVIULLAVCNFSM6AAAAABDXQEMIKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRSGQ2DEOBUGA . You are receiving this because you were mentioned.Message ID: @.***>

yanirel commented 9 months ago

can i extract 2 colors for 2 led strip? - or even 3?

GenericStudent commented 9 months ago

can i extract 2 colors for 2 led strip? - or even 3?

The underlying color thief library can pull X amount of colours (from most dominant to least), but that functionality isn't pulled into this integration.

You can have the most dominant colour extracted and applied to multiple lights as it is though.

issue-triage-workflows[bot] commented 6 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.