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.56k stars 30.74k forks source link

Wrong Color Temp Range for TP KL135 #126300

Closed jhemak closed 1 month ago

jhemak commented 1 month ago

The problem

The color temp range of the Kasa KL135 bulb is 2500-9000K. This is what is printed on the bulb and displayed in the Kasa app. However, in HA the available range is only 2500-6500K. This should be corrected, please.

Incidentally, the KL130 has the same range and in HA is correctly displayed as 2500-9000.

Thanks!

What version of Home Assistant Core has the issue?

2024.9.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

TP-Link Smart Home

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 month ago

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

Code owner commands Code owners of `tplink` 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 tplink` 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)


tplink documentation tplink source (message by IssueLinks)

rytilahti commented 1 month ago

The temperature ranges are hardcoded by model based on user reports so this needs to be fixed upstream in python-kasa.

The current range for KL135 was documented in https://github.com/python-kasa/python-kasa/issues/252#issuecomment-974187853 so we need to find out what we can use to detect this (probably new) hardware version with a wider temperature range. Could you provide us a fixture file as instructed at https://python-kasa.readthedocs.io/en/stable/contribute.html#contributing-fixture-files ?

jhemak commented 1 month ago

OK - I wish I could help, but I cannot figure out how to run that python script on windows, which is all I have.

Traceback (most recent call last):
  File "C:\python-kasa\devtools\dump_devinfo.py", line 24, in <module>
    import asyncclick as click
ModuleNotFoundError: No module named 'asyncclick'
rytilahti commented 1 month ago

Did the uv sync command as shown in the docs finish without errors? If so, you just need to activate the created virtual environment. I think running .venv\Scripts\activate should accomplish that on Windows.

If you don't have uv yet installed, you can install it by following the instructions at https://docs.astral.sh/uv/getting-started/installation/ .

sdb9696 commented 1 month ago

Or to simplify:

pipx install uv
uv run python -m devtools.dump_devinfo --username <username> --password <password> --host <ipaddress>

I've tested this just now on windows and all works ok.

jhemak commented 1 month ago

Is this what you need? KL135(US)_1.0_1.0.15.json

rytilahti commented 1 month ago

Indeed, thanks! Alas, I'm not directly seeing any clear differences (like different hw version) to the already existing fixture file, which only supports up to 6500K like reported in the link I provided above.

jhemak commented 1 month ago

That's unfortunate. Could it be that the earlier report of 6500K was in error?

rytilahti commented 1 month ago

It could be but if you checked the issue I linked above, I explicitly asked for that info and was responded that it says 6500K on the box, so... :shrug:

Maybe there are some old pdf manuals available that could confirm this, or maybe there are indeed some changes I didn't spot as I just briefly glanced on it with the assumption that it'd be a new hardware revision?

As this piece of code has been there for years already w/o any reports saying otherwise, I'm rather reluctant on changing the behavior until we figure out how and if we can detect these different versions of the bulb.

jhemak commented 1 month ago

I completely understand! I did a quick Google and came across this page which says K135 V1 (https://www.tp-link.com/us/support/download/kl135/)

The linked datasheet says Color Temperature: 2500 K ~ 9000 K

...but, who knows!

rytilahti commented 1 month ago

Looks like tplink-smarthome-api also uses 2500-9000K, so extending the range would be fine by me. I created https://github.com/python-kasa/python-kasa/pull/1123 to do just that and I'll see what other maintainers think about it.

sdb9696 commented 1 month ago

This should be fixed in 2024.10 and will probably in the next beta for testing.