Probably not the right place - but I have an automation that just runs a simple python script that requires a python module to be installed. I cannot figure out how to get this module to install and stay available. If I pip install it from the HAOS command line it still doesn't work. I'm running HAOS 15.2 2025.4.4 and I have HACS isntalled. Yes, there's a TP-Link Kasa addon, but that relies on kasa cloud - which I'm trying to avoid (it's slow sometimes). Any guidance?
#Kasa python
1 messages · Page 1 of 1 (latest)
the kasa integration uses the python-kasa library
newer kasa devices on the newer firmware are however moving over to the "tapo" system which means they are at least partially cloud dependant
The kasa integration reqruies you to login to TP-Link cloud
only if the device tells it that its needed to authenticate
i have some kasa stuff and (although i am moving away from it ASAP) and with older version it doesnt request it
Odd - because if my internet is down not a single kasa device works in automation, but if I call the kasa python directly with --host <ip> I can still control the device
yeah its a really awkward midpoint currently. during the setup handshake the plug asks for authentication. but also doesnt nessasarily need it
(for reference, here's the python library I'm referring to https://github.com/python-kasa/python-kasa)
I'd prefer to not use the TP-Link integration and just use custom scripts for the devices I want to control
and heres the manifest of the tplink integration showing it uses that library already
if you run the script from within the context of the home assistant container then the library should be there
the 'kasa' command is non-existent from terminal
pip install python-kasa and suddenly it's available... until an update and it goes away
then you are not in the context of the home assistant container
ensure that your terminal is not in protected mode then run
docker exec -it homeassistant /bin/bash
ok so make sure the terminal is not running in protected mode
then go to the terminal and type as above
like this
protected mode is inside the terminal addon settings
it's off
no, I switched it off a year ago
ok
ha core runs within a container which has the dependencies inside it. in this case python-kasa. once you switch to that container context you will be able to use it
kasa command should definetly be there
tp-link are a pain in the arse and are slowly locking down kasa stuff. i would definetly avoid it in future and consider replacing what you have
they are slowly changing stuff so they don't totally break old setups but new setups can be used without cloud and at some point they are just gunna fuck everyone over by the looks of things