do you know how those feature files are made ? are they a dump of the camera's settings ? if so, just dumping when line detection is enabled and disabled to see if it's the right data.
Ps
I've seen also other missing features like "getMeowDetectionConfig", "getPetDetectionConfig", "getVehicleDetectionConfig" , "getGlassDetectionConfig" to name a few.
all the missing "...DetectionConfig" work, I'm doing some commit to add them, but the getLdc is unrelated with line detection and I've no idea where to find it because fixture file doesn't change when enabling/disabling it.
The fixture files are creating by executing a list of known commands on devices and storing the responses of the succeeded commands, there is a script under devtools that does that. The procedure for contributing fixtures can be found here https://python-kasa.readthedocs.io/en/stable/contribute.html#contributing-fixture-files . As you noticed, the fixture files are at times more complete than what is being exposed by the library. That is simply because @sdb9696 figured out lots of commands that were not added to the initial implementation, the fixture files serve as a resource to help adding new features in the future if the need arises :-)
You can execute raw commands on the device using kasa raw-command, but the format for cameras is rather complex so the easiest way to find the structure is to execute some command using --debug and looking what is sent to the device.
You could perhaps give a try if the line detection is something like getLineDetectionCrossingConfig or getLineDetectionConfig.
If you figure out something, feel free to create a PR and I can review and help to get it in. For exposing features to homeassistant, an extra step described in the integration's README is necessary. We should probably add a note to this somewhere in our contributing docs to make it more visible, but hope that wil get you started!
Feel free to ask if you need any support and I will see what I can do!
Activity
rytilahti commented on Jun 15, 2025
I guess it would be possible after someone figures out how the configuration works and implements it.
Looking at one of the fixture files, I'm guessing that https://github.com/python-kasa/python-kasa/blob/master/tests%2Ffixtures%2Fsmartcam%2FC210%28EU%29_2.0_1.4.3.json#L290 are the related settings?
Alas, all the main contributors are currently busy with other projects, so if someone wants to help, that would be awesome!
gpongelli commented on Jun 15, 2025
hi @rytilahti , I don't know how those fixture files are used, but I've found "linedetectioncrossing" and "getLdc" (supposing that Ldc stands for "Line detection crossing"), with something that sounds like the enable/disable switch .
do you know how those feature files are made ? are they a dump of the camera's settings ? if so, just dumping when line detection is enabled and disabled to see if it's the right data.
Ps
I've seen also other missing features like "getMeowDetectionConfig", "getPetDetectionConfig", "getVehicleDetectionConfig" , "getGlassDetectionConfig" to name a few.
gpongelli commented on Jun 16, 2025
all the missing "...DetectionConfig" work, I'm doing some commit to add them, but the getLdc is unrelated with line detection and I've no idea where to find it because fixture file doesn't change when enabling/disabling it.
rytilahti commented on Jun 16, 2025
The fixture files are creating by executing a list of known commands on devices and storing the responses of the succeeded commands, there is a script under devtools that does that. The procedure for contributing fixtures can be found here https://python-kasa.readthedocs.io/en/stable/contribute.html#contributing-fixture-files . As you noticed, the fixture files are at times more complete than what is being exposed by the library. That is simply because @sdb9696 figured out lots of commands that were not added to the initial implementation, the fixture files serve as a resource to help adding new features in the future if the need arises :-)
You can execute raw commands on the device using kasa raw-command, but the format for cameras is rather complex so the easiest way to find the structure is to execute some command using --debug and looking what is sent to the device.
You could perhaps give a try if the line detection is something like getLineDetectionCrossingConfig or getLineDetectionConfig.
If you figure out something, feel free to create a PR and I can review and help to get it in. For exposing features to homeassistant, an extra step described in the integration's README is necessary. We should probably add a note to this somewhere in our contributing docs to make it more visible, but hope that wil get you started!
Feel free to ask if you need any support and I will see what I can do!
gpongelli commented on Jun 16, 2025
Hi @rytilahti , thank you, I've spot the feature looking at this page https://md.depau.eu/s/r1Ys_oWoP#Modules (link found inside the code).
There is a missing root key "getLinecrossingDetectionConfig" to be added into SMARTCAM_REQUEST so it can be dumped by dump_devinfo .
I'll make a PR with also HA integration and let you know, thanks!
Prepare 0.11.0 (#1776)
Prepare 0.11.0.1 (#1780)