Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

I try to control Tapo T100 with python. It is link with Tapo H200. I use "await sensor.turn_on()" to turn it on, but it always say the sensor is not turning on when I check it state.
python

You must be logged in to vote

Replies: 1 comment · 13 replies

Comment options

You cannot turn sensors on and off, and at the moment it does not support changing many settings either.

What are you trying to do with the sensor (besides reading if the movement has been detected)?

Anyway, here's an example how you can explore the device API:

> kasa --host 192.168.123.123 shell
Discovering device 192.168.123.123 for 10 seconds
Opening shell for <DeviceType.Hub at 192.168.123.123 - Smart Hub (H100)>
>>> dev.children
[<DeviceType.Thermostat Smart Radiator Valve (None) of <DeviceType.Hub at 192.168.123.123 - Smart Hub (H100)>>, <DeviceType.Sensor Temperature Humidity Sensor (None) of <DeviceType.Hub at 192.168.123.123 - Smart Hub (H100)>>, <DeviceType.Sensor Contact Sensor (None) of <DeviceType.Hub at 192.168.123.123 - Smart Hub (H100)>>, <DeviceType.Sensor Bewegungssensor (None) of <DeviceType.Hub at 192.168.123.123 - Smart Hub (H100)>>, <DeviceType.Sensor Smart Button (None) of <DeviceType.Hub at 192.168.123.123 - Smart Hub (H100)>>, <DeviceType.Sensor Wasserleck-Sensor (None) of <DeviceType.Hub at 192.168.123.123 - Smart Hub (H100)>>]
>>> motion = dev.children[3]
>>> motion
<DeviceType.Sensor Bewegungssensor (None) of <DeviceType.Hub at 192.168.123.123 - Smart Hub (H100)>>

>>> for feat in motion.features.values():
...     print(feat)
Device ID (device_id): xxxx
Signal Level (signal_level): 3
RSSI (rssi): -70 dBm
Reboot (reboot): <Action>
Battery low (battery_low): False
Cloud connection (cloud_connection): False
Update available (update_available): None
Current firmware version (current_firmware_version): 1.12.0 Build 230512 Rel.103011
Available firmware version (available_firmware_version): None
Check latest firmware (check_latest_firmware): <Action>
Motion detected (motion_detected): False
>>>

>>> motion.features["motion_detected"]
Motion detected (motion_detected): False
>>> motion.features["motion_detected"].value
False

You can also access individual modules and use their API instead of features API:

>>> motion.modules
{'BatterySensor': <Module BatterySensor (battery_detect) for 192.168.123.123>, 'Cloud': <Module Cloud (cloud_connect) for 192.168.123.123>, 'DeviceModule': <Module DeviceModule (device) for 192.168.123.123>, 'Firmware': <Module Firmware (firmware) for 192.168.123.123>, 'MotionSensor': <Module MotionSensor (sensitivity) for 192.168.123.123>, 'TriggerLogs': <Module TriggerLogs (trigger_log) for 192.168.123.123>}

You can find the code for individual sensors under https://github.com/python-kasa/python-kasa/tree/master/kasa/smart/modules if you want to use the regular, non-Feature based API.

You must be logged in to vote
13 replies
@willis1203
Comment options

this is the result {'get_sensitivity_info': {'sensitivity': 'low', 'report_interval': 60}}

@sdb9696
Comment options

Could you time how long it takes to clear? I'm hoping it's 60 seconds and we've never really got confirmation on the report interval units but it looks like it could be seconds.

@willis1203
Comment options

If you said report_interval, I can adjust the settings with Tapo apps. I can change the 'report_interval' to 4 seconds and it take longer than 4 seconds to clear. The variable call 'Detection interval' (I am not sure, I can't change the default language). There is a caption under the variable say that the device only triggers at specified intervals to conserve power.

@sdb9696
Comment options

Detection interval is what it's called in the Tapo app? And it's a different setting to the report interval in the tapo app?

@willis1203
Comment options

There are no "report interval" in Tapo app. Changing the value of detection interval in app, the value of report interval in program will be changed. I believe they are same thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.