Page 1 of 1

Kasa hardware

Posted: Wednesday 13 October 2021 19:21
by pjsgsy
Hi,

Just wanted to share this, as I could not find this info here, but, it works beautifully!

So, I've had TPLink plug for a while and used a script from here to make it work. It's one that works only with the old firmware and it works with the plugs only. I recently got some BL50 bulbs. The old on/off only script for the plugs does not work with them.

I found this - https://github.com/python-kasa/python-kasa

It's a complete kasa plug including discovery, for lights, plugs, strip, the lot! Does brightness, colours. etc. too. All tested and working well. Super easy to install with a 'pip install python-kasa', too.

For me, using windows, I have to have a batch file in the middle and call it like this, using the switch on/off actions

script://C:\PROGRA~2\Domoticz\scripts\kasa.bat --host 192.168.2.13 --plug off

The kasa.bat simply contains

cmd /c kasa %1 %2 %3 %4 %5

I could not get python scripts to run directly from Domoticz for whatever reason, but this does the trick and has been working well for a long time.

Hope this might help someone.

If anyone knows how to pass the dimmer value from a switch / dimmer slider to the On/Off action, please let me know. That'd be the icing on the cake!

Re: Kasa hardware

Posted: Wednesday 13 October 2021 19:58
by waltervl
Did you check this thread for a TP-Link plugin?

https://domoticz.com/forum/viewtopic.php?f=56&t=32774

Re: Kasa hardware

Posted: Wednesday 13 October 2021 20:15
by pjsgsy
Hi - That's Tapo, not Kasa, I think. Different hardware/protocol, same people (tplink). My experience so far, Kasa works, tapo is junk :) But, yes - I did read that thread. Bought the tapo bulbs first as they were a little cheaper than the kasa ones. Could not even get them to detect the wifi. Gave up after 2 hours and ordered the kasa ones. 10 minutes, all setup. Amazing....

Re: Kasa hardware

Posted: Wednesday 13 October 2021 23:58
by waltervl
Ok, I missed that difference :-). The TP-Link plugin is based on a similar python library so perhaps it is easy to modify the tapo plugin into a kasa plugin.

There is also another TPlink plugin https://github.com/lordzurp/domoticz-tplink-smartplug,
Perhaps also to be used as inspiration.