plasticrake / homebridge-tplink-smarthome

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

Please add support for Kasa Light Strips, model KL430 #113

Open akballow opened 4 years ago

akballow commented 4 years ago

Please let me know if there is anything I can share with the strips I own to help get the support added to this great plugin!

CoastalSilk commented 4 years ago

Having same issue with KL430 strips not working when trying to add:

[Homebridge] [1/29/2020, 16:47:52] [TplinkSmarthome] [Light Strip] [Homebridge] [1/29/2020, 16:47:52] [TplinkSmarthome] ResponseError: err_code not zero response: {"err_code":-1,"err_msg":"module not support"} command: {"smartlife.iot.smartbulb.lightingservice":{"get_light_state":{}}} at processResponse (/home/hoobs/.hoobs/node_modules/tplink-smarthome-api/lib/device/index.js:509:11) at /home/hoobs/.hoobs/node_modules/tplink-smarthome-api/lib/device/index.js:274:23 at Generator.next () at asyncGeneratorStep (/home/hoobs/.hoobs/node_modules/tplink-smarthome-api/lib/device/index.js:3:103) at _next (/home/hoobs/.hoobs/node_modules/tplink-smarthome-api/lib/device/index.js:5:194) { name: 'ResponseError', response: { err_code: -1, err_msg: 'module not support' }, command: { 'smartlife.iot.smartbulb.lightingservice': { get_light_state: {} } }, errorModules: 'smartlife.iot.smartbulb.lightingservice' }

kirilballow commented 4 years ago

I have not tried yet, but what if I put KL430 into the package.json "keywords": [ "homebridge-plugin", "homebridge", "tplink", "kasa", "lb100", "lb110", "lb120", "lb130", "lb200", "lb230", "hs100", "hs103", "hs105", "hs107", "hs110", "hs200", "hs210", "hs220", "hs300", "kp303", "kp400", "kl430", <--- here... "home", "smartplug", "smartbulb" ]

kirilballow commented 4 years ago

looks like the same author writes tplink-smarthome-api, will need to get support there... adding a comment in that repo

ArthurJGuy commented 4 years ago

Also looking for this, it doesn't appear that the strips (KL430) use the same protocol as the RGB LED bulbs (KL130) at all.

ArthurJGuy commented 4 years ago

Here is a JSON status of the KL430, the mic_type indicates it is still part of the iot.smartbulb family but none of the iot.smartbulb commands are successful.

"system":{ "get_sysinfo":{ "sw_ver":"1.0.7 Build 191120 Rel.201531", "hw_ver":"1.0", "model":"KL430(US)", "deviceId":"801259C74CCD014D2411A65A30811F1C1BBDBC6C", "oemId":"1A3F21A5B9AE0ED6C80ED1A107885DB2", "hwId":"375D4CCE7C909516CFD57BA93A304404", "rssi":-58, "longitude_i":0, "latitude_i":0, "alias":"Office Keyboard", "status":"new", "description":"Kasa Smart Light Strip, Multicolor", "mic_type":"IOT.SMARTBULB", "mic_mac":"98DAC47E9139", "dev_state":"normal", "is_factory":false, "disco_ver":"1.0", "ctrl_protocols":{ "name":"Linkie", "version":"1.0" }, "active_mode":"none", "is_dimmable":1, "is_color":1, "is_variable_color_temp":1, "length":14, "light_state":{ "on_off":1, "mode":"normal", "hue":0, "saturation":0, "color_temp":3500, "brightness":100 }, "lighting_effect_state":{ "enable":1, "name":"Aurora", "custom":0, "id":"xqUxDhbAhNLqulcuRMyPBmVGyTOyEMEu", "brightness":63 }, "preferred_state":[ ], "err_code":0

mlamoure commented 4 years ago

Became a sponsor in hopes of support for the KL430. If there is anything I can do to help or test, please let me know.

plasticrake commented 4 years ago

I'll do some poking around to see if anyone has a working example of the API for this device. If anyone is aware of any other software that works that would be helpful! Unfortunately I don't have one of these devices.

mlamoure commented 4 years ago

Really appreciate it. The Python library for Kasa, I’ve tested with the KL430 and is able to change the HSV, temp, and brightness correctly. https://github.com/python-kasa/python-kasa

plasticrake commented 4 years ago

I need to pair up with someone with a KL430 device to run some commands for me and provide me with the output. Preferably someone I can chat with on discord. Please reply here with your discord username or email me code@plasticrake.com.

For starters: install tplink-smarthome-api:

$ npm install --global tplink-smarthome-api

Then run this command (replace 10.0.0.208 with the IP of the device)

$ tplink-smarthome-api send 10.0.0.208 '{"context":{"source":"bced4ee3-cf54-4767-902a-45bab63136c7"},"smartlife.iot.common.cloud":{"get_info":{}}}'

And I would need you to run it with the device logged into the cloud and also logged off the cloud (local only device) and send me the output.

mlamoure commented 4 years ago

Here is the output of running that command:

root@Development:~# tplink-smarthome-api send 10.66.40.40 '{"context":{"source":"bced4ee3-cf54-4767-902a-45bab63136c7"},"smartlife.iot.common.cloud":{"get_info":{}}}'
Sending to 10.66.40.40: via tcp...
response:
'{"smartlife.iot.common.cloud":{"get_info":{"username":"MYUSERNAME","server":"n-devs.tplinkcloud.com","binded":1,"cld_connection":1,"illegalType":0,"stopConnect":0,"tcspStatus":1,"fwDlPage":"","tcspInfo":"","fwNotifyType":-1,"err_code":0}}}'

Can you advise on how to best test with the device logged off the cloud? I disconnected my IoT VLAN from the internet and recieved the same response from the device.

plasticrake commented 4 years ago

@mlamoure You used to be able to do it easily in the kasa app but it looks like they removed it? You may need to remove the device and re-add it but don't hook it up to the cloud. You want it to show "local only".

IMG_4939

IMG_4940

mlamoure commented 4 years ago

I removed the device earlier today and re-added it, there was no unlink it from my Kasa account or the cloud. This page seems to imply that the KL430 requires cloud. Is that your read too? I dont have a Kasa device other than the 430 to compare it to.

https://www.tp-link.com/us/support/faq/2707/

plasticrake commented 3 years ago

@mlamoure I have a tplink device simulator I wrote, and normally what I do is I create a simulated device then use the Kasa app to inspect how they are communicating with each other. It allows me to see the exact commands sent by the app and I can use the simulated device to test out my code. I'm having issues getting this device added to Kasa and it may be due to some newer devices requiring cloud setup.

When I try to go through the setup wizard in Kasa for KL430 I am getting this request. Can you run this and provide the results?

Thanks!

$ tplink-smarthome-api -u send 10.0.0.208 '{"cnCloud":{"get_info":{}},"smartlife.iot.common.cloud":{"get_info":{}},"system":{ "get_sysinfo":{}}}'
plasticrake commented 3 years ago

@mlamoure Also I just bought a KL430 to help getting this to work, Should be here next week

mlamoure commented 3 years ago

Hey @plasticrake, here is the output of that command:

root@development:~# tplink-smarthome-api -u send 10.66.40.40 '{"cnCloud":{"get_info":{}},"smartlife.iot.common.cloud":{"get_info":{}},"system":{ "get_sysinfo":{}}}'
Sending to 10.66.40.40: via udp...
response:
'{"cnCloud":{"err_code":-1,"err_msg":"module not support"},"smartlife.iot.common.cloud":{"get_info":{"username":"XXXX","server":"n-devs.tplinkcloud.com","binded":1,"cld_connection":1,"illegalType":0,"stopConnect":0,"tcspStatus":1,"fwDlPage":"","tcspInfo":"","fwNotifyType":-1,"err_code":0}},"system":{"get_sysinfo":{"sw_ver":"1.0.10 Build 200522 Rel.104340","hw_ver":"1.0","model":"KL430(US)","deviceId":"8012350FA58E795379DA8F6E5BFFACC01D1009B7","oemId":"1A3F21A5B9AE0ED6C80ED1A107885DB2","hwId":"375D4CCE7C909516CFD57BA93A304404","rssi":-59,"longitude_i":-712284,"latitude_i":422104,"alias":"Server Rack Lights","status":"new","description":"Kasa Smart Light Strip, Multicolor","mic_type":"IOT.SMARTBULB","mic_mac":"D8473265F60C","dev_state":"normal","is_factory":false,"disco_ver":"1.0","ctrl_protocols":{"name":"Linkie","version":"1.0"},"active_mode":"none","is_dimmable":1,"is_color":1,"is_variable_color_temp":1,"length":23,"light_state":{"on_off":1,"mode":"normal","hue":0,"saturation":0,"color_temp":0,"brightness":66},"lighting_effect_state":{"enable":0,"name":"","custom":0,"id":"","brightness":50},"preferred_state":[],"err_code":0}}}'
mlamoure commented 3 years ago

checking in @plasticrake . Anything else I can help with?

plasticrake commented 3 years ago

@mlamoure I got the KL430 I ordered a few days ago and had it mostly working in my simulator. I still need a few days work to get it in my library, then I can work on adding it to my homebridge plugin. First version will probably just be setting the entire strip on/off or a color. Not entirely sure the best way to set the strip "zones" but that could probably be added with each zone being a separate light bulb. I can do that if someone wants that functionality.

mlamoure commented 3 years ago

I realize it’s being greedy, but that would be my vote - to have zones represented as separate bulbs in HomeKit. Given that the KL430 doesn’t support couplers and extenders like the Hue, you may have to buy multiple units for a single area that you want to treat as one.

Thanks for the work on this.

The other request I wonder how to handle is the triggering of the effects. Maybe enabling switches to turn on pre-defined or customized effects?

thecameramen commented 3 years ago

@plasticrake Thanks so much for working on this! Not sure if this is possible, but it would be really useful to be able to set Kasa Effects and/or Kasa Scenes through HomeKit. This would allow you to design your effects or color paint zones in the Kasa app, then trigger these effects/paintings via a HomeKit scene.

mlamoure commented 3 years ago

@plasticrake actually, I revise my advice in that Homekit allows for grouping of accessories. This is how I group multiple Hue devices as well. I would put it back on the user to re-create the zones in Homekit by grouping them.

Triggering the effects and scenes would be a bonus. I personally hate the temporary fix of adding switches for

Any update on the progress?

aushump commented 3 years ago

Any updates on this?

jenra commented 3 years ago

Any updates on this?

I second this?

irctrakz commented 3 years ago

fwiw, I'd also love to get this up and running in Homebridge. Thank you @plasticrake for all the help / work, very appreciated.

alexneth commented 3 years ago

I just bought a KL430, I'd love an update on this too please. I'm using HOOBS to connect to non apple supported smart home devices, my other TP link smart plugs / bulbs work fine, just this KL430 isn't working, all I want to do is turn it on/off.

mudojo commented 3 years ago

Would like to see this functionality as well.

bendrick92 commented 3 years ago

Friendly monthly bump to see if there’s any progress on adding light strip support!

smarthousetips commented 3 years ago

@plasticrake Would love to see this functionality as well!

steveredden commented 3 years ago

Based on tests with python-kasa it looks like a KL400L5 would be properly exposed if KL430 is.

I have the former product and am available to chat on discord.

steveredden commented 3 years ago

Wrote a separate plugin for the interim… works for my KL400L5. Does someone want to try their KL430?

https://github.com/steveredden/homebridge-kasa-lightstrip

aushump commented 3 years ago

Hello! Just wanted to let you know I tried this out for my KL430 and I got it set up correctly, but no commands are ever actually carried out. HomeKit will say it’s changed the status to On, but the Light Strip remains off and won’t change Power, Brightness or Color. I tried turning it on with the Kasa app and then controlling with HomeKit, but still no interactions. HomeKit always shows as off after a moment. Hoping you can figure out why!

On Sep 12, 2021, at 4:38 AM, steveredden @.***> wrote:

 Wrote a separate plugin for the interim… works for my KL400L5. Does someone want to try their KL430?

https://github.com/steveredden/homebridge-kasa-lightstrip

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

steveredden commented 3 years ago

@aushump might be resolved - just released a new version. take any further issues/discussion to that github repo :)

MayaGans commented 3 years ago

Thank you so much for all your work with this! It still doesn't seem to be working for me 😢 (also using KL430)

mlamoure commented 3 years ago

Same for me. @steveredden I use python-kasa to control my KL430's for another project, so I know the library is able to work with them. Let me know if I can help test.

aushump commented 3 years ago

I was able to get it fully working! Just hadn’t had python-Kasa installed yet but once I did that and verified the IP of my LED strip was correct, it immediately started working! Thanks for your work! Is there any functionality possible for the “effects” and “scenes”?

On Sep 13, 2021, at 3:27 PM, Michael Lamoureux @.***> wrote:

 Same for me. @steveredden I use python-kasa to control my KL430's for another project, so I know the library is able to work with them. Let me know if I can help test.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

mlamoure commented 3 years ago

I assumed python-kasa was included? Is it not? I run my Homebridge in a docker container so it's hard to add to the base install.

aushump commented 3 years ago

I had to install it separately to get it working. I also thought it was included initially.

On Sep 13, 2021, at 3:35 PM, Michael Lamoureux @.***> wrote:

 I assumed python-kasa was included? Is it not? I run my Homebridge in a docker container so it's hard to add to the base install.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

steveredden commented 3 years ago

added a validation section to my README. @mlamoure not 100% sure how to install the lib to the docker image. Might be worth checking in with onzu. I'll look into it too...

i'll urge any issues / discussion continue on the new repo to avoid other people getting spammed :P

plasticrake commented 2 years ago

I've added support for light strips in homebridge-tplink-smarthome@7.0.0-next.0 please try it out and let me know how its working!

dvanoni commented 2 years ago

After installing version 7.0.0-next.0 and restarting Homebridge, it appears to be working great for me! Thanks for making this happen, @plasticrake!