I just tested the new PIR options in the latest update but was unable to see or configure the settings for it on the KS200M (non-dimmer PIR switch).
I ran kasa --type dimmable --host xxx.xxx.xxx.xxx and was able to see the new "ambient_light" feedback, but nothing in regards to the PIR sensor. My hope is to be able to toggle with motion detection on and off via scripts. I have tried to use a python script with my very limited knowledge to get the PIR sensor settings but have not been successful.
I've attached the output of the fixture file, although it looks like the one already in the repo. KS200M(US)_1.0_1.0.11.json
I'm assuming this device is detected as a wall switch, but if you add --debug to your command line, you could verify that.
It's odd that you are not seeing the PIR information when you force the device type to dimmer, could you check how the device response looks like for the PIR query?
I created #1227 that likely fixes this, feel free to give it a try and report back!
Thank you!! And such a quick response too! I checkout the branch and it all works great when using it in a script. The cli command doesn't show the feature, but I only need it for a script anyway.
No, not really right off the bat. Maybe the device is not initialized as a wall switch after all, and @eternalliving is initializing the class manually instead of using the device factory?
No I think it's my issue. I have kasa installed through pip but used the git repo to create the fixture file and test the fix branch. I have to update my cli kasa file which I'm just wrapping my head around.
Activity
rytilahti commented on Nov 3, 2024
I'm assuming this device is detected as a wall switch, but if you add --debug to your command line, you could verify that.
It's odd that you are not seeing the PIR information when you force the device type to dimmer, could you check how the device response looks like for the PIR query?
I created #1227 that likely fixes this, feel free to give it a try and report back!
eternalliving commented on Nov 3, 2024
Thank you!! And such a quick response too! I checkout the branch and it all works great when using it in a script. The cli command doesn't show the feature, but I only need it for a script anyway.
sdb9696 commented on Nov 3, 2024
@rytilahti any idea why @eternalliving cant see the feature?
rytilahti commented on Nov 3, 2024
No, not really right off the bat. Maybe the device is not initialized as a wall switch after all, and @eternalliving is initializing the class manually instead of using the device factory?
eternalliving commented on Nov 3, 2024
No I think it's my issue. I have kasa installed through pip but used the git repo to create the fixture file and test the fix branch. I have to update my cli kasa file which I'm just wrapping my head around.
eternalliving commented on Nov 3, 2024
Ok... the cli does work!! I had to use uv run kasa instead 😁 the PIR and ambient are showing correctly and configurable. Sorry for the run around.
sdb9696 commented on Nov 3, 2024
No worries that’s great thanks.
adamef93 commented on Jan 4, 2026
How did you end up making this work? I think I'm trying to do something similar in #1627.