-
-
Notifications
You must be signed in to change notification settings - Fork 223
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
Comments
Looks like that the strip has different modes and that the effect mode is controlled separately (the light uses |
Looks like yours has a separate |
I created PR #192 with dump for the device |
HI @rytilahti This is the code I tested at my end: 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: 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]]} |
@iprodanovbg glad that you figured it out! I think the proper way to support this would be adding some new functionality (e.g. |
Yes I agree with you this should be different function. Unfortunately last days I have no time to research more about this problem. |
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]]}" |
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. |
It looks like tplink has finally fixed the firmware on these |
Wifi Worked now. |
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)
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)
After switching on with
kasa --host 192.168.0.17 on
command the LEDs are not turning on but when I check withkasa --host 192.168.0.17 state
the status indicated ON (same status in the Kasa android app)Dump when I use
python-kasa
cli:Dump when I use Kasa android app:
If you compare both dump files you will see that one parameter is different
system.lighting_effect_state.enable
The text was updated successfully, but these errors were encountered: