8000 LED strips effects are not supported (was LEDs is not turning on after switching on) · Issue #191 · python-kasa/python-kasa · GitHub
[go: up one dir, main page]

Skip to content

LED strips effects are not supported (was LEDs is not turning on after switching on) #191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
iprodanovbg opened this issue Aug 16, 2021 · 10 comments · Fixed by #293
Closed

Comments

@iprodanovbg
Copy link
Contributor

After switching on with kasa --host 192.168.0.17 on command the LEDs are not turning on but when I check with kasa --host 192.168.0.17 state the status indicated ON (same status in the Kasa android app)

python-kasa version kasa, version 0.4.0.dev3
python version 3.8.10
OS Ubuntu 20.04.2 LTS

Dump when I use python-kasa cli:

{
  "smartlife.iot.common.emeter": {
    "get_daystat": {
      "day_list": [
        {
          "day": 14,
          "energy_wh": 5,
          "month": 8,
          "year": 2021
        },
        {
          "day": 16,
          "energy_wh": 103,
          "month": 8,
          "year": 2021
        }
      ],
      "err_code": 0
    },
    "get_monthstat": {
      "err_code": 0,
      "month_list": [
        {
          "energy_wh": 108,
          "month": 8,
          "year": 2021
        }
      ]
    },
    "get_realtime": {
      "err_code": 0,
      "power_mw": 16760,
      "total_wh": 103
    }
  },
  "system": {
    "get_sysinfo": {
      "LEF": 1,
      "active_mode": "none",
      "alias": "light strip",
      "ctrl_protocols": {
        "name": "Linkie",
        "version": "1.0"
      },
      "description": "Kasa Smart Light Strip, Multicolor",
      "dev_state": "normal",
      "deviceId": "***",
      "disco_ver": "1.0",
      "err_code": 0,
      "hwId": "***",
      "hw_ver": "2.0",
      "is_color": 1,
      "is_dimmable": 1,
      "is_factory": false,
      "is_variable_color_temp": 1,
      "latitude_i": ***,
      "length": 16,
      "light_state": {
        "brightness": 100,
        "color_temp": 9000,
        "hue": 0,
        "mode": "normal",
        "on_off": 1,
        "saturation": 0
      },
      "lighting_effect_state": {
        "brightness": 100,
        "custom": 1,
        "enable": 0,
        "id": "yMwcNpLxijmoKamskHCvvravpbnIqAIN",
        "name": "Aurora 1"
      },
      "longitude_i": ***,
      "mic_mac": "C0:06:C3:**:**:**",
      "mic_type": "IOT.SMARTBULB",
      "model": "KL430(UN)",
      "oemId": "***",
      "preferred_state": [
        {
          "brightness": 100,
          "color_temp": 9000,
          "hue": 0,
          "index": 0,
          "mode": 1,
          "saturation": 0
        },
        {
          "brightness": 100,
          "color_temp": 0,
          "hue": 217,
          "index": 1,
          "mode": 1,
          "saturation": 99
        },
        {
          "brightness": 100,
          "color_temp": 0,
          "hue": 194,
          "index": 2,
          "mode": 1,
          "saturation": 50
        },
        {
          "brightness": 100,
          "color_temp": 0,
          "hue": 277,
          "index": 3,
          "mode": 1,
          "saturation": 86
        }
      ],
      "rssi": -42,
      "status": "new",
      "sw_ver": "1.0.8 Build 210121 Rel.084339"
    }
  }
}

Dump when I use Kasa android app:

{
    "smartlife.iot.common.emeter": {
      "get_daystat": {
        "day_list": [
          {
            "day": 14,
            "energy_wh": 5,
            "month": 8,
            "year": 2021
          },
          {
            "day": 16,
            "energy_wh": 103,
            "month": 8,
            "year": 2021
          }
        ],
        "err_code": 0
      },
      "get_monthstat": {
        "err_code": 0,
        "month_list": [
          {
            "energy_wh": 108,
            "month": 8,
            "year": 2021
          }
        ]
      },
      "get_realtime": {
        "err_code": 0,
        "power_mw": 16760,
        "total_wh": 103
      }
    },
    "system": {
      "get_sysinfo": {
        "LEF": 1,
        "active_mode": "none",
        "alias": "light strip",
        "ctrl_protocols": {
          "name": "Linkie",
          "version": "1.0"
        },
        "description": "Kasa Smart Light Strip, Multicolor",
        "dev_state": "normal",
        "deviceId": "***",
        "disco_ver": "1.0",
        "err_code": 0,
        "hwId": "***",
        "hw_ver": "2.0",
        "is_color": 1,
        "is_dimmable": 1,
        "is_factory": false,
        "is_variable_color_temp": 1,
        "latitude_i": ***,
        "length": 16,
        "light_state": {
          "brightness": 100,
          "color_temp": 9000,
          "hue": 0,
          "mode": "normal",
          "on_off": 1,
          "saturation": 0
        },
        "lighting_effect_state": {
          "brightness": 100,
          "custom": 1,
          "enable": 1,
          "id": "yMwcNpLxijmoKamskHCvvravpbnIqAIN",
          "name": "Aurora 1"
        },
        "longitude_i": ***,
        "mic_mac": "C0:06:C3:**:**:**",
        "mic_type": "IOT.SMARTBULB",
        "model": "KL430(UN)",
        "oemId": "***",
        "preferred_state": [
          {
            "brightness": 100,
            "color_temp": 9000,
            "hue": 0,
            "index": 0,
            "mode": 1,
            "saturation": 0
          },
          {
            "brightness": 100,
            "color_temp": 0,
            "hue": 217,
            "index": 1,
            "mode": 1,
            "saturation": 99
          },
          {
            "brightness": 100,
            "color_temp": 0,
            "hue": 194,
            "index": 2,
            "mode": 1,
            "saturation": 50
          },
          {
            "brightness": 100,
            "color_temp": 0,
            "hue": 277,
            "index": 3,
            "mode": 1,
            "saturation": 86
          }
        ],
        "rssi": -44,
        "status": "new",
        "sw_ver": "1.0.8 Build 210121 Rel.084339"
      }
    }
  }

If you compare both dump files you will see that one parameter is different system.lighting_effect_state.enable

@iprodanovbg iprodanovbg changed the title KL430: leds is not turning on after switching on KL430: LEDs is not turning on after switching on Aug 16, 2021
@rytilahti
Copy link
Member

Looks like that the strip has different modes and that the effect mode is controlled separately (the light uses light_state.on_off for the state). There is currently no handling for the effect mode as the commands are unknown. Maybe you could do a packet capture and use the devtools/parse_pcap.py to find out how the app controls the effect mode & what sort of logic we need to add?

@rytilahti
Copy link
Member

Looks like yours has a separate LEF key in the sysinfo, maybe that's related? Also, could you use the dump_devinfo and create a PR to add a fixture under https://github.com/python-kasa/python-kasa/tree/master/kasa/tests/fixtures ?

@iprodanovbg
Copy link
Contributor Author

I created PR #192 with dump for the device

@iprodanovbg
Copy link
Contributor Author

HI @rytilahti
I managed to turn on the LEDs when I execute the "on" command.
The KL430 light strip have another service smartlife.iot.lighting_effect and method set_lighting_effect with set the effects to each zone in the strip.

This is the code I tested at my end:
File: smartdevice.py
Code:

    async def set_light_state(self, state: Dict, *, transition: int = None) -> Dict:
        """Set the light state."""
        if transition is not None:
            state["transition_period"] = transition

        # if no on/off is defined, turn on the light
        if "on_off" not in state:
            state["on_off"] = 1

        # This is necessary to allow turning on into a specific state
        state["ignore_default"] = 1

        light_state = await self._query_helper(
            self.LIGHT_SERVICE, self.SET_LIGHT_METHOD, state
        )

        sys_info = self.sys_info
        if re.match(r"KL430", sys_info["model"]):
            if light_state["on_off"] == 1:
                light_effect = {}
                light_effect["custom"] = 0
                light_effect["direction"] = 4
                light_effect["duration"] = 0
                light_effect["enable"] = 1
                light_effect["expansion_strategy"] = 1
                light_effect["id"] = "xqUxDhbAhNLqulcuRMyPBmVGyTOyEMEu"
                light_effect["name"] = "Aurora"
                light_effect["repeat_times"] = 0
                light_effect["segments"] = [0]
                light_effect["sequence"] = [[120,100,100],[240,100,100],[260,100,100],[280,100,100]]
                light_effect["spread"] = 7
                light_effect["transition"] = 1500
                light_effect["type"] = "sequence"

                print(await self._query_helper(
                    self.LIGHT_EFFECT_SERVICE, self.SET_LIGHT_EFFECT_METHOD, light_effect
                ))

        return light_state

File: smartlightstrip.py
Code:

    LIGHT_EFFECT_SERVICE = "smartlife.iot.lighting_effect"
    SET_LIGHT_EFFECT_METHOD = "set_lighting_effect"

However this is first preset effect in Kasa app and there is dump for all effectes:

{"custom": 0, "id": "xqUxDhbAhNLqulcuRMyPBmVGyTOyEMEu", "brightness": 100, "name": "Aurora", "segments": [0], "expansion_strategy": 1, "enable": 1, "type": "sequence", "duration": 0, "transition": 1500, "direction": 4, "spread": 7, "repeat_times": 0, "sequence": [[120, 100, 100], [240, 100, 100], [260, 100, 100], [280, 100, 100]]}
{"custom": 0, "id": "tIwTRQBqJpeNKbrtBMFCgkdPTbAQGfRP", "brightness": 100, "name": "Bubbling Cauldron", "segments": [0], "expansion_strategy": 1, "enable": 1, "type": "random", "hue_range": [100, 270], "saturation_range": [80, 100], "brightness_range": [50, 100], "duration": 0, "transition": 200, "init_states": [[270, 100, 100]], "fadeoff": 1000, "random_seed": 24, "backgrounds": [[270, 40, 50]]}
{"custom": 0, "id": "HCOttllMkNffeHjEOLEgrFJjbzQHoxEJ", "brightness": 100, "name": "Candy Cane", "segments": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], "expansion_strategy": 1, "enable": 1, "type": "sequence", "duration": 700, "transition": 500, "direction": 1, "spread": 1, "repeat_times": 0, "sequence": [[0, 0, 100], [0, 0, 100], [360, 81, 100], [0, 0, 100], [0, 0, 100], [360, 81, 100], [360, 81, 100], [0, 0, 100], [0, 0, 100], [360, 81, 100], [360, 81, 100], [360, 81, 100], [360, 81, 100], [0, 0, 100], [0, 0, 100], [360, 81, 100]]}
{"custom": 0, "id": "bwTatyinOUajKrDwzMmqxxJdnInQUgvM", "brightness": 100, "name": "Christmas", "segments": [0], "expansion_strategy": 1, "enable": 1, "type": "random", "hue_range": [136, 146], "saturation_range": [90, 100], "brightness_range": [50, 100], "duration": 5000, "transition": 0, "init_states": [[136, 0, 100]], "fadeoff": 2000, "random_seed": 100, "backgrounds": [[136, 98, 75], [136, 0, 0], [350, 0, 100], [350, 97, 94]]}
{"custom": 0, "id": "bCTItKETDFfrKANolgldxfgOakaarARs", "brightness": 100, "name": "Flicker", "segments": [1], "expansion_strategy": 1, "enable": 1, "type": "random", "hue_range": [30, 40], "saturation_range": [100, 100], "brightness_range": [50, 100], "duration": 0, "transition": 0, "transition_range": [375, 500], "init_states": [[30, 81, 80]]}
{"custom": 0, "id": "CdLeIgiKcQrLKMINRPTMbylATulQewLD", "brightness": 100, "name": "Hanukkah", "segments": [1], "expansion_strategy": 1, "enable": 1, "type": "random", "hue_range": [200, 210], "saturation_range": [0, 100], "brightness_range": [50, 100], "duration": 1500, "transition": 0, "transition_range": [400, 500], "init_states": [[35, 81, 80]]}
{"custom": 0, "id": "oJnFHsVQzFUTeIOBAhMRfVeujmSauhjJ", "brightness": 80, "name": "Haunted Mansion", "segments": [80], "expansion_strategy": 2, "enable": 1, "type": "random", "hue_range": [45, 45], "saturation_range": [10, 10], "brightness_range": [0, 80], "duration": 0, "transition": 0, "transition_range": [50, 1500], "init_states": [[45, 10, 100]], "fadeoff": 200, "random_seed": 1, "backgrounds": [[45, 10, 100]]}
{"custom": 0, "id": "joqVjlaTsgzmuQQBAlHRkkPAqkBUiqeb", "brightness": 70, "name": "Icicle", "segments": [0], "expansion_strategy": 1, "enable": 1, "type": "sequence", "duration": 0, "transition": 400, "direction": 4, "spread": 3, "repeat_times": 0, "sequence": [[190, 100, 70], [190, 100, 70], [190, 30, 50], [190, 100, 70], [190, 100, 70]]}
{"custom": 0, "id": "ojqpUUxdGHoIugGPknrUcRoyJiItsjuE", "brightness": 100, "name": "Lightning", "segments": [7, 20, 23, 32, 34, 35, 49, 65, 66, 74, 80], "expansion_strategy": 1, "enable": 1, "type": "random", "hue_range": [240, 240], "saturation_range": [10, 11], "brightness_range": [90, 100], "duration": 0, "transition"
8000
: 50, "init_states": [[240, 30, 100]], "fadeoff": 150, "random_seed": 600, "backgrounds": [[200, 100, 100], [200, 50, 10], [210, 10, 50], [240, 10, 0]]}
{"custom": 0, "id": "oJjUMosgEMrdumfPANKbkFmBcAdEQsPy", "brightness": 30, "name": "Ocean", "segments": [0], "expansion_strategy": 1, "enable": 1, "type": "sequence", "duration": 0, "transition": 2000, "direction": 3, "spread": 16, "repeat_times": 0, "sequence": [[198, 84, 30], [198, 70, 30], [198, 10, 30]]}
{"custom": 0, "id": "izRhLCQNcDzIKdpMPqSTtBMuAIoreAuT", "brightness": 100, "name": "Rainbow", "segments": [0], "expansion_strategy": 1, "enable": 1, "type": "sequence", "duration": 0, "transition": 1500, "direction": 1, "spread": 12, "repeat_times": 0, "sequence": [[0, 100, 100], [100, 100, 100], [200, 100, 100], [300, 100, 100]]}
{"custom": 0, "id": "QbDFwiSFmLzQenUOPnJrsGqyIVrJrRsl", "brightness": 30, "name": "Raindrop", "segments": [0], "expansion_strategy": 1, "enable": 1, "type": "random", "hue_range": [200, 200], "saturation_range": [10, 20], "brightness_range": [10, 30], "duration": 0, "transition": 1000, "init_states": [[200, 40, 100]], "fadeoff": 1000, "random_seed": 24, "backgrounds": [[200, 40, 0]]}
{"custom": 0, "id": "URdUpEdQbnOOechDBPMkKrwhSupLyvAg", "brightness": 100, "name": "Spring", "segments": [0], "expansion_strategy": 1, "enable": 1, "type": "random", "hue_range": [0, 90], "saturation_range": [30, 100], "brightness_range": [90, 100], "duration": 600, "transition": 0, "transition_range": [2000, 6000], "init_states": [[80, 30, 100]], "fadeoff": 1000, "random_seed": 20, "backgrounds": [[130, 100, 40]]}
{"custom": 0, "id": "QglBhMShPHUAuxLqzNEefFrGiJwahOmz", "brightness": 100, "name": "Valentines", "segments": [0], "expansion_strategy": 1, "enable": 1, "type": "random", "hue_range": [340, 340], "saturation_range": [30, 40], "brightness_range": [90, 100], "duration": 600, "transition": 2000, "init_states": [[340, 30, 100]], "fadeoff": 3000, "random_seed": 100, "backgrounds": [[340, 20, 50], [20, 50, 50], [0, 100, 50]]}

@rytilahti
Copy link
Member
rytilahti commented Aug 17, 2021

@iprodanovbg glad that you figured it out! I think the proper way to support this would be adding some new functionality (e.g. set_effect(Effect) for setting the effect) and adapt is_on (and others like turn_on if we can differentiate between the regular mode and the effect mode?) to take the effect on state into account when reporting on the state state.

@iprodanovbg
Copy link
Contributor Author

Yes I agree with you this should be different function. Unfortunately last days I have no time to research more about this problem.

@steveredden
Copy link
Contributor
steveredden commented Sep 14, 2021

have either of you found a way to smartlife.iot.lighting_effect > set_lighting_effect via CLI?

Been trying on the CLI with raw-command and haven't found a valid "PARAMETERS" (bombs at cli.py:267)

kasa --host <ip> raw-command "smartlife.iot.lighting_effect" "set_lighting_effect" <whaaaaat>

passed a string representation of json, using single-quote around each key, and no spaces.

ex: Aurora:

kasa --host <ip> raw-command "smartlife.iot.lighting_effect" "set_lighting_effect" "{'custom':0,'id':'xqUxDhbAhNLqulcuRMyPBmVGyTOyEMEu','name':'Aurora','segments':[0],'expansion_strategy':1,'enable':1,'type':'sequence','duration':0,'transition':1500,'direction':4,'spread':7,'repeat_times':0,'sequence':[[120,100,100],[240,100,100],[260,100,100],[280,100,100]]}"

@rytilahti rytilahti changed the title KL430: LEDs is not turning on after switching on LED strips effects are not supported (was LEDs is not turning on after switching on) Nov 2, 2021
@rytilahti rytilahti mentioned this issue Nov 2, 2021
@SergeantPup
Copy link

HI @rytilahti I managed to turn on the LEDs when I execute the "on" command. The KL430 light strip have another service smartlife.iot.lighting_effect and method set_lighting_effect with set the effects to each zone in the strip.

This is the code I tested at my end: File: smartdevice.py Code:

    async def set_light_state(self, state: Dict, *, transition: int = None) -> Dict:
        """Set the light state."""
        if transition is not None:
            state["transition_period"] = transition

        # if no on/off is defined, turn on the light
        if "on_off" not in state:
            state["on_off"] = 1

        # This is necessary to allow turning on into a specific state
        state["ignore_default"] = 1

        light_state = await self._query_helper(
            self.LIGHT_SERVICE, self.SET_LIGHT_METHOD, state
        )

        sys_info = self.sys_info
        if re.match(r"KL430", sys_info["model"]):
            if light_state["on_off"] == 1:
                light_effect = {}
                light_effect["custom"] = 0
                light_effect["direction"] = 4
                light_effect["duration"] = 0
                light_effect["enable"] = 1
                light_effect["expansion_strategy"] = 1
                light_effect["id"] = "xqUxDhbAhNLqulcuRMyPBmVGyTOyEMEu"
                light_effect["name"] = "Aurora"
                light_effect["repeat_times"] = 0
                light_effect["segments"] = [0]
                light_effect["sequence"] = [[120,100,100],[240,100,100],[260,100,100],[280,100,100]]
                light_effect["spread"] = 7
                light_effect["transition"] = 1500
                light_effect["type"] = "sequence"

                print(await self._query_helper(
                    self.LIGHT_EFFECT_SERVICE, self.SET_LIGHT_EFFECT_METHOD, light_effect
                ))

        return light_state

File: smartlightstrip.py Code:

    LIGHT_EFFECT_SERVICE = "smartlife.iot.lighting_effect"
    SET_LIGHT_EFFECT_METHOD = "set_lighting_effect"

However this is first preset effect in Kasa app and there is dump for all effectes:

{"custom": 0, "id": "xqUxDhbAhNLqulcuRMyPBmVGyTOyEMEu", "brightness": 100, "name": "Aurora", "segments": [0], "expansion_strategy": 1, "enable": 1, "type": "sequence", "duration": 0, "transition": 1500, "direction": 4, "spread": 7, "repeat_times": 0, "sequence": [[120, 100, 100], [240, 100, 100], [260, 100, 100], [280, 100, 100]]}
{"custom": 0, "id": "tIwTRQBqJpeNKbrtBMFCgkdPTbAQGfRP", "brightness": 100, "name": "Bubbling Cauldron", "segments": [0], "expansion_strategy": 1, "enable": 1, "type": "random", "hue_range": [100, 270], "saturation_range": [80, 100], "brightness_range": [50, 100], "duration": 0, "transition": 200, "init_states": [[270, 100, 100]], "fadeoff": 1000, "random_seed": 24, "backgrounds": [[270, 40, 50]]}
{"custom": 0, "id": "HCOttllMkNffeHjEOLEgrFJjbzQHoxEJ", "brightness": 100, "name": "Candy Cane", "segments": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], "expansion_strategy": 1, "enable": 1, "type": "sequence", "duration": 700, "transition": 500, "direction": 1, "spread": 1, "repeat_times": 0, "sequence": [[0, 0, 100], [0, 0, 100], [360, 81, 100], [0, 0, 100], [0, 0, 100], [360, 81, 100], [360, 81, 100], [0, 0, 100], [0, 0, 100], [360, 81, 100], [360, 81, 100], [360, 81, 100], [360, 81, 100], [0, 0, 100], [0, 0, 100], [360, 81, 100]]}
{"custom": 0, "id": "bwTatyinOUajKrDwzMmqxxJdnInQUgvM", "brightness": 100, "name": "Christmas", "segments": [0], "expansion_strategy": 1, "enable": 1, "type": "random", "hue_range": [136, 146], "saturation_range": [90, 100], "brightness_range": [50, 100], "duration": 5000, "transition": 0, "init_states": [[136, 0, 100]], "fadeoff": 2000, "random_seed": 100, "backgrounds": [[136, 98, 75], [136, 0, 0], [350, 0, 100], [350, 97, 94]]}
{"custom": 0, "id": "bCTItKETDFfrKANolgldxfgOakaarARs", "brightness": 100, "name": "Flicker", "segments": [1], "expansion_strategy": 1, "enable": 1, "type": "random", "hue_range": [30, 40], "saturation_range": [100, 100], "brightness_range": [50, 100], "duration": 0, "transition": 0, "transition_range": [375, 500], "init_states": [[30, 81, 80]]}
{"custom": 0, "id": "CdLeIgiKcQrLKMINRPTMbylATulQewLD", "brightness": 100, "name": "Hanukkah", "segments": [1], "expansion_strategy": 1, "enable": 1, "type": "random", "hue_range": [200, 210], "saturation_range": [0, 100], "brightness_range": [50, 100], "duration": 1500, "transition": 0, "transition_range": [400, 500], "init_states": [[35, 81, 80]]}
{"custom": 0, "id": "oJnFHsVQzFUTeIOBAhMRfVeujmSauhjJ", "brightness": 80, "name": "Haunted Mansion", "segments": [80], "expansion_strategy": 2, "enable": 1, "type": "random", "hue_range": [45, 45], "saturation_range": [10, 10], "brightness_range": [0, 80], "duration": 0, "transition": 0, "transition_range": [50, 1500], "init_states": [[45, 10, 100]], "fadeoff": 200, "random_seed": 1, "backgrounds": [[45, 10, 100]]}
{"custom": 0, "id": "joqVjlaTsgzmuQQBAlHRkkPAqkBUiqeb", "brightness": 70, "name": "Icicle", "segments": [0], "expansion_strategy": 1, "enable": 1, "type": "sequence", "duration": 0, "transition": 400, "direction": 4, "spread": 3, "repeat_times": 0, "sequence": [[190, 100, 70], [190, 100, 70], [190, 30, 50], [190, 100, 70], [190, 100, 70]]}
{"custom": 0, "id": "ojqpUUxdGHoIugGPknrUcRoyJiItsjuE", "brightness": 100, "name": "Lightning", "segments": [7, 20, 23, 32, 34, 35, 49, 65, 66, 74, 80], "expansion_strategy": 1, "enable": 1, "type": "random", "hue_range": [240, 240], "saturation_range": [10, 11], "brightness_range": [90, 100], "duration": 0, "transition": 50, "init_states": [[240, 30, 100]], "fadeoff": 150, "random_seed": 600, "backgrounds": [[200, 100, 100], [200, 50, 10], [210, 10, 50], [240, 10, 0]]}
{"custom": 0, "id": "oJjUMosgEMrdumfPANKbkFmBcAdEQsPy", "brightness": 30, "name": "Ocean", "segments": [0], "expansion_strategy": 1, "enable": 1, "type": "sequence", "duration": 0, "transition": 2000, "direction": 3, "spread": 16, "repeat_times": 0, "sequence": [[198, 84, 30], [198, 70, 30], [198, 10, 30]]}
{"custom": 0, "id": "izRhLCQNcDzIKdpMPqSTtBMuAIoreAuT", "brightness": 100, "
8000
name": "Rainbow", "segments": [0], "expansion_strategy": 1, "enable": 1, "type": "sequence", "duration": 0, "transition": 1500, "direction": 1, "spread": 12, "repeat_times": 0, "sequence": [[0, 100, 100], [100, 100, 100], [200, 100, 100], [300, 100, 100]]}
{"custom": 0, "id": "QbDFwiSFmLzQenUOPnJrsGqyIVrJrRsl", "brightness": 30, "name": "Raindrop", "segments": [0], "expansion_strategy": 1, "enable": 1, "type": "random", "hue_range": [200, 200], "saturation_range": [10, 20], "brightness_range": [10, 30], "duration": 0, "transition": 1000, "init_states": [[200, 40, 100]], "fadeoff": 1000, "random_seed": 24, "backgrounds": [[200, 40, 0]]}
{"custom": 0, "id": "URdUpEdQbnOOechDBPMkKrwhSupLyvAg", "brightness": 100, "name": "Spring", "segments": [0], "expansion_strategy": 1, "enable": 1, "type": "random", "hue_range": [0, 90], "saturation_range": [30, 100], "brightness_range": [90, 100], "duration": 600, "transition": 0, "transition_range": [2000, 6000], "init_states": [[80, 30, 100]], "fadeoff": 1000, "random_seed": 20, "backgrounds": [[130, 100, 40]]}
{"custom": 0, "id": "QglBhMShPHUAuxLqzNEefFrGiJwahOmz", "brightness": 100, "name": "Valentines", "segments": [0], "expansion_strategy": 1, "enable": 1, "type": "random", "hue_range": [340, 340], "saturation_range": [30, 40], "brightness_range": [90, 100], "duration": 600, "transition": 2000, "init_states": [[340, 30, 100]], "fadeoff": 3000, "random_seed": 100, "backgrounds": [[340, 20, 50], [20, 50, 50], [0, 100, 50]]}

Hello,

I just migrated from HE because the KL430s are NOW working on HA natively. We had gotten the effects working for the KL430's in HE and it looks like you've got all the information that's needed to get the effects working. I am anxious to automate effects to my 37 KL340s but I can't figure out what I'm missing.

Are we waiting on dev work for this to be possible? It looks like the above post offers a workaround while we wait but unfortunately, that's a little outside my skill level unless somebody can walk me through the actual steps of making the workaround work on command.

I'm just trying to clarify where this project is at so I can determine if I'm doing something wrong or if there's still a gap.

@bdraco
Copy link
Member
bdraco commented Jan 28, 2022

It looks like tplink has finally fixed the firmware on these
https://community.tp-link.com/us/smart-home/forum/topic/242590
Maybe I can actually get it to connect to wifi now

@bdraco
Copy link
Member
bdraco commented Jan 28, 2022

Wifi Worked now.

rytilahti added a commit to rytilahti/python-kasa that referenced this issue Mar 21, 2022
This is the last release prior restructuring the code to enable easier extendability by moving towards more modular architecture.
The most prominent change in this release is the support for effects on light strips.

[Full Changelog](python-kasa/python-kasa@0.4.1...0.4.2)

**Implemented enhancements:**

- Allow environment variables for discovery target, device type and debug [\python-kasa#313](python-kasa#313) (@rytilahti)
- Add 'internal\_state' to return the results from the last update query [\python-kasa#306](python-kasa#306) (@rytilahti)
- Drop microsecond precision for on\_since [\python-kasa#296](python-kasa#296) (@rytilahti)
- Add effect support for light strips [\python-kasa#293](python-kasa#293) (@bdraco)

**Fixed bugs:**

- TypeError: \_\_init\_\_\(\) got an unexpected keyword argument 'package\_name' [\python-kasa#311](python-kasa#311)
- RuntimeError: Event loop is closed on WSL [\python-kasa#294](python-kasa#294)
- Don't crash on devices not reporting features [\python-kasa#317](python-kasa#317) (@rytilahti)

**Closed issues:**

- SmartDeviceException: Communication error on system:set\_relay\_state [\python-kasa#309](python-kasa#309)
- Add Support: ES20M and KS200M motion/light switches [\python-kasa#308](python-kasa#308)
- New problem with installing on Ubuntu 20.04.3 LTS [\python-kasa#305](python-kasa#305)
- KeyError: 'emeter' when discovering [\python-kasa#302](python-kasa#302)
- RuntimeError: Event loop is closed  [\python-kasa#291](python-kasa#291)
- provisioning format [\python-kasa#290](python-kasa#290)
- Fix CI publishing on pypi [\python-kasa#222](python-kasa#222)
- LED strips effects are not supported \(was LEDs is not turning on after switching on\) [\python-kasa#191](python-kasa#191)

**Merged pull requests:**

- Add pyupgrade to CI runs [\python-kasa#314](python-kasa#314) (@rytilahti)
- Depend on asyncclick \>= 8 [\python-kasa#312](python-kasa#312) (@rytilahti)
- Guard emeter accesses to avoid keyerrors [\python-kasa#304](python-kasa#304) (@rytilahti)
- cli: cleanup discover, fetch update prior device access [\python-kasa#303](python-kasa#303) (@rytilahti)
- Fix unsafe \_\_del\_\_ in TPLinkSmartHomeProtocol [\python-kasa#300](python-kasa#300) (@bdraco)
- Improve typing for protocol class [\python-kasa#289](python-kasa#289) (@rytilahti)
- Added a fixture file for KS220M [\python-kasa#273](python-kasa#273) (@mrbetta)
rytilahti added a commit that referenced this issue Mar 21, 2022
This is the last release prior restructuring the code to enable easier extendability by moving towards more modular architecture.
The most prominent change in this release is the support for effects on light strips.

[Full Changelog](0.4.1...0.4.2)

**Implemented enhancements:**

- Allow environment variables for discovery target, device type and debug [\#313](#313) (@rytilahti)
- Add 'internal\_state' to return the results from the last update query [\#306](#306) (@rytilahti)
- Drop microsecond precision for on\_since [\#296](#296) (@rytilahti)
- Add effect support for light strips [\#293](#293) (@bdraco)

**Fixed bugs:**

- TypeError: \_\_init\_\_\(\) got an unexpected keyword argument 'package\_name' [\#311](#311)
- RuntimeError: Event loop is closed on WSL [\#294](#294)
- Don't crash on devices not reporting features [\#317](#317) (@rytilahti)

**Closed issues:**

- SmartDeviceException: Communication error on system:set\_relay\_state [\#309](#309)
- Add Support: ES20M and KS200M motion/light switches [\#308](#308)
- New problem with installing on Ubuntu 20.04.3 LTS [\#305](#305)
- KeyError: 'emeter' when discovering [\#302](#302)
- RuntimeError: Event loop is closed  [\#291](#291)
- provisioning format [\#290](#290)
- Fix CI publishing on pypi [\#222](#222)
- LED strips effects are not supported \(was LEDs is not turning on after switching on\) [\#191](#191)

**Merged pull requests:**

- Add pyupgrade to CI runs [\#314](#314) (@rytilahti)
- Depend on asyncclick \>= 8 [\#312](#312) (@rytilahti)
- Guard emeter accesses to avoid keyerrors [\#304](#304) (@rytilahti)
- cli: cleanup discover, fetch update prior device access [\#303](#303) (@rytilahti)
- Fix unsafe \_\_del\_\_ in TPLinkSmartHomeProtocol [\#300](#300) (@bdraco)
- Improve typing for protocol class [\#289](#289) (@rytilahti)
- Added a fixture file for KS220M [\#273](#273) (@mrbetta)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
0