plasticrake / homebridge-tplink-smarthome

TP-Link Smarthome Plugin for Homebridge
MIT License
468 stars 70 forks source link

Color Temperature warning for KL125, KL130, KL135 #220

Open KrakenThunder opened 2 years ago

KrakenThunder commented 2 years ago

Expected Behavior

These bulbs work for the most part with homebridge.

KL125: 2500K - 6500K KL130 & KL135: 2500K - 9000K

Homebridge should recognize a wider range for color temperature as the new KL series bulbs has a range from 2500K to 9000K.

Characteristic 'Color Temperature' should have a maximum range of 400 and a minimum range of 111

KL series bulbs also seem to have more color/hues available than what is accessible on the home app. No other information on this at this time.

Current Behavior

When using the TP-Link Kasa app to adjust the color temperature of KL series bulbs Homebridge presents a warning.

image

[homebridge-tplink-smarthome] This plugin generated a warning from the characteristic 'Color Temperature': characteristic was supplied illegal value: number 400 exceeded maximum of 370. See https://git.io/JtMGR for more info.

[homebridge-tplink-smarthome] This plugin generated a warning from the characteristic 'Color Temperature': characteristic was supplied illegal value: number 111 exceeded minimum of 154. See https://git.io/JtMGR for more inf

The home app does not go to the coolest temperature of 9000K. It gets pretty close to the warmest temperature.

color wheel on home app does not show nearly the range of hues as in the TP-Link Kasa app.

Steps to Reproduce (for bugs)

Versions

Configuration

"platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "name": "TplinkSmarthome",
            "addCustomCharacteristics": true,
            "deviceTypes": [
                "plug",
                "bulb"
            ],
            "platform": "TplinkSmarthome"
        },

Homebridge Log / Command Output

[HB Supervisor] Starting Homebridge with extra flags: -I
 [HB Supervisor] Started Homebridge v1.3.5 with PID: 22449
Initializing HAP-NodeJS v0.9.6...
 Loaded config.json with 0 accessories and 3 platforms.
 Loaded 10 cached accessories from cachedAccessories.
 ---
 [Homebridge UI] Starting terminal session
 Loaded plugin: homebridge-config-ui-x@4.41.2
 Registering platform 'homebridge-config-ui-x.config'
 ---
Loaded plugin: homebridge-tplink-smarthome@6.4.0
Registering platform 'homebridge-tplink-smarthome.TplinkSmarthome'
 ---
Loading 3 platforms...
[Config] Initializing config platform...
 [Config] Running in Service Mode
 [TplinkSmarthome] Initializing TplinkSmarthome platform...
[TplinkSmarthome] homebridge-tplink-smarthome v6.4.0, node v14.17.4, homebridge v1.3.5, api v2.7

 [homebridge-tplink-smarthome] This plugin generated a warning from the characteristic 'Color Temperature': characteristic was supplied illegal value: number 400 exceeded maximum of 370. See https://git.io/JtMGR for more info.

[homebridge-tplink-smarthome] This plugin generated a warning from the characteristic 'Color Temperature': characteristic was supplied illegal value: number 111 exceeded minimum of 154. See https://git.io/JtMGR for more inf
KrisTC commented 2 years ago

I am also getting this warning in the logs

BruceHowells commented 2 years ago

+1. I'd been getting a nuisance number of these previously, but since adding some new bulbs (apparently, with a wider gamut) these have gotten much worse. Aggravating factor is that the color temperature is being set by a Home Assistant plugin, so while the values may be difficult to achieve through the applications, they are definitely available through the network protocol and are supported by the bulbs.

plasticrake commented 2 years ago

I have a fix incoming for this. You cannot query the device to find the range, we need to hard code them and the existing list is very short. I've taken a look at some similar projects for lists of models and their ranges, however I am also finding conflicting data. I think some devices that share a model # may have differences by hardware revision and/or country. But I cannot find good data on this. I see Amazon reviews for KL130 that mention a HW 1.0 vs HW 2.0 that have different specs for example.

Shortly I will have this lookup table. When I found conflicting information I erred on the side of wider ranges:

  [/^LB120/, 2700, 6500],
  [/^LB130/, 2500, 9000],
  [/^LB230/, 2500, 9000],
  [/^KB130/, 2500, 9000],
  [/^KL120\(EU\)/, 2700, 6500],
  [/^KL120\(US\)/, 2700, 5000],
  [/^KL125/, 2500, 6500],
  [/^KL130/, 2500, 9000],
  [/^KL135/, 2500, 9000],
  [/^KL430/, 2500, 9000],
  [/./, 2700, 6500], // default

If something is wrong or missing, It would be helpful if people could provide their full model and version info from get_sysinfo, along with the color temperature ranges for example:

      "sw_ver": "1.5.5 Build 170623 Rel.090105",
      "hw_ver": "1.0",
      "model": "LB130(EU)",

Then I can improve the lookup table.

JBruster1119 commented 2 years ago

I am getting this issue still. Has there been any updates? the model I have are the KL430