Some Tapo PTZ cameras support an automatic cruise mode in addition to manual pan/tilt movements.
On a Tapo C200, cruise can run:
- horizontally
- vertically
- and be stopped explicitly
python-kasa already exposes PTZ controls through the SmartCam PanTilt module, so cruise support seems to fit naturally there.
I could not find an existing issue or PR specifically covering cruise / patrol support.
Protocol
Known Tapo commands:
Horizontal cruise:
{"do":{"motor":{"cruise":{"coord":"x"}}}}
Vertical cruise:
{"do":{"motor":{"cruise":{"coord":"y"}}}}
Stop cruise:
{"do":{"motor":{"cruise_stop":{}}}}
Existing implementations use the same commands:
Possible API
For example:
await pantilt.start_cruise(CruiseAxis.HORIZONTAL)
await pantilt.start_cruise(CruiseAxis.VERTICAL)
await pantilt.stop_cruise()
with:
class CruiseAxis(StrEnum):
HORIZONTAL = "x"
VERTICAL = "y"
The exact API naming is open for discussion, but keeping cruise would match the underlying Tapo protocol and existing implementations.
It could also expose action features such as:
ptz_cruise_horizontal
ptz_cruise_vertical
ptz_cruise_stop
Device available for testing
I can test this on a physical C200:
- Hardware:
1.0
- Firmware:
1.3.17 Build 260112 Rel.54862n(4555)
ptz component version: 1
The device is already covered by the fixture added in #1760.
Open question
The C200 advertises PTZ/motor capabilities but does not appear to explicitly advertise cruise support.
It would be useful to determine whether cruise:
- is available on all compatible PTZ devices,
- can be detected through another capability/query,
- or should initially be exposed for PTZ devices and let unsupported devices return the protocol error.
I would prefer avoiding a model-specific whitelist.
Cruise is also a persistent motor mode, so manual pan / tilt / move commands may fail while it is active. I would avoid stopping cruise implicitly unless that behavior is intentional.
Tests
If accepted, I can provide:
- unit tests for horizontal / vertical / stop payloads,
- physical tests on the C200,
- a test for interaction with manual PTZ movement while cruise is active.
Some Tapo PTZ cameras support an automatic cruise mode in addition to manual pan/tilt movements.
On a Tapo C200, cruise can run:
python-kasaalready exposes PTZ controls through the SmartCamPanTiltmodule, so cruise support seems to fit naturally there.I could not find an existing issue or PR specifically covering
cruise/patrolsupport.Protocol
Known Tapo commands:
Horizontal cruise:
{"do":{"motor":{"cruise":{"coord":"x"}}}}Vertical cruise:
{"do":{"motor":{"cruise":{"coord":"y"}}}}Stop cruise:
{"do":{"motor":{"cruise_stop":{}}}}Existing implementations use the same commands:
Possible API
For example:
with:
The exact API naming is open for discussion, but keeping
cruisewould match the underlying Tapo protocol and existing implementations.It could also expose action features such as:
ptz_cruise_horizontalptz_cruise_verticalptz_cruise_stopDevice available for testing
I can test this on a physical C200:
1.01.3.17 Build 260112 Rel.54862n(4555)ptzcomponent version:1The device is already covered by the fixture added in #1760.
Open question
The C200 advertises PTZ/motor capabilities but does not appear to explicitly advertise cruise support.
It would be useful to determine whether cruise:
I would prefer avoiding a model-specific whitelist.
Cruise is also a persistent motor mode, so manual
pan/tilt/movecommands may fail while it is active. I would avoid stopping cruise implicitly unless that behavior is intentional.Tests
If accepted, I can provide: