tplink-smarthome-api icon indicating copy to clipboard operation
tplink-smarthome-api copied to clipboard

color_temp invalidates subsequent light states

Open jottinger opened this issue 2 years ago • 2 comments

We're seeing an issue where we can set color_temp (kelvin) and then subsequent calls to the same device to set brightness or hue or saturation are being accepted but not changing the light state. This is on KL130.

jottinger avatar Apr 27 '22 20:04 jottinger

@plasticrake if. you need I can show the behavior, and I'm more than happy to help in any way I can - I just don't know how to set up a development environment to properly diagnose and fix.

jottinger avatar Apr 27 '22 20:04 jottinger

This sounds like an issue at the device level. Calling setLightState just passes the commands you pass in to the device. If the device is not responding to it perhaps the device is expecting different command inputs. Example code would help.

plasticrake avatar Jul 11 '22 21:07 plasticrake

Just came across the same issue. It seems that color_temp overrides the hue. Resolved by setting color_temp to 0

        device.lighting.setLightState({
            on_off: 1,
            mode: 'normal',
            hue: 120,
            color_temp: 0,
            saturation: 100,
            brightness: 5
          })
          .then(console.log)

mattcave avatar Nov 18 '22 18:11 mattcave