Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Support for Tapo C420S2 #243

Closed
h0jeZvgoxFepBQ2C opened this issue Oct 27, 2022 · 23 comments · Fixed by #263
Closed

Feature Request: Support for Tapo C420S2 #243

h0jeZvgoxFepBQ2C opened this issue Oct 27, 2022 · 23 comments · Fixed by #263
Assignees
Labels
Enhancement New feature or request
Milestone

Comments

@h0jeZvgoxFepBQ2C
Copy link
Contributor

h0jeZvgoxFepBQ2C commented Oct 27, 2022

Would be nice to know if the new Tapo C420S2 is supported (its not listed in the docs).

Any experiences anyone? I will receive my package from amazon soon, but I would like to know it before :)

@JurajNyiri
Copy link
Owner

If not we will get it supported. 😉
I would bet it will work just fine though. Do let us know!

@h0jeZvgoxFepBQ2C
Copy link
Contributor Author

Sounds really great, thank you!
Will report if it works! :)

2 way audio streaming is not supported at all I guess (only saw that audio streaming is not working even one way as far as I understand it?)

@JurajNyiri
Copy link
Owner

JurajNyiri commented Oct 27, 2022

I just read it's actually battery camera. So I guess the streams will not work or consume a lot of battery if it exposes rtsp stream? 🤔 If the camera does not expose rtsp stream at all, you will not be able to add it but let's cross that bridge once we get to it.

Control should be fine though if it uses the same app and they didn't change things specifically for it.

No 2 way audio unfortunately (there is an issue which you can read more in). Audio in video stream is supported via webrtc (see faq).

@h0jeZvgoxFepBQ2C
Copy link
Contributor Author

Ok, lets see, thanks so much for your answer! ❤️
Will close this issue after I can report how it works (and maybe provide a PR with hints about working/not working functionality).

@h0jeZvgoxFepBQ2C
Copy link
Contributor Author

Hm it seems that the cameras don't have a dedicated IP address, but are ony available via the H200 hub which is included in the package. Is there any way to make it work with the hub? :(

@h0jeZvgoxFepBQ2C
Copy link
Contributor Author

Details from the API:

{
    "error_code": 0,
    "result": {
        "deviceList": [
            {
                "deviceType": "SMART.TAPOHUB",
                "role": 0,
                "fwVer": "1.1.1 Build 20220713 rel.56639",
                "appServerUrl": "https://eu-wap.tplinkcloud.com",
                "deviceRegion": "eu-west-1",
                "deviceId": "802D1C9E238D3730FCF2A81B6CAA766920358116",
                "deviceName": "H200",
                "deviceHwVer": "1.0",
                "alias": "VGFwb19IdWJfRDc5NQ==",
                "deviceMac": "1C61B4DAD795",
                "oemId": "20BDFF5DD35D9F82C31FC30217AA348D",
                "deviceModel": "H200(EU)",
                "hwId": "99A36151C79A3A5D72823C98BC0FDA5F",
                "fwId": "BD6A2A57605B151F2ADBC71AC4839310",
                "isSameRegion": true,
                "status": 0
            }
        ]
    }
}

@JurajNyiri
Copy link
Owner

I see that is unfortunate.

Could you try adding the hub instead? Can you make a video how does hub look like in the app and what is available?

@h0jeZvgoxFepBQ2C
Copy link
Contributor Author

No, I also tried this integration: petretiandrea/home-assistant-tapo-p100#273 but it doesn't work to add the hub in neither integration, it timeouts or says the ports are not open (but which are).

Screenshots of the app details of the hub and one of the cameras:

signal-2022-10-28-141228_003
signal-2022-10-28-141228_002

@JurajNyiri
Copy link
Owner

I will need to see more. Send me a message through discord.

@JurajNyiri
Copy link
Owner

We talked on discord and it looks like the camera uses a hub as a proxy for all communication and does not expose rtsp stream.

Once someone reverse engineers the communication with the camera through the hub and publishes the results I will look into possibly adding support for this camera. It will be especially tricky with stream because there is no rtsp available and it uses a custom protocol for it as was found when trying to get recordings from the camera.

PRs are of course as always welcomed.

@JurajNyiri JurajNyiri added Enhancement New feature or request Help wanted Extra attention is needed labels Oct 28, 2022
@JurajNyiri JurajNyiri changed the title Feature Request: any experiences with Tapo C420S2? Feature Request: Support for Tapo C420S2 Oct 28, 2022
@bebo-dot-dev
Copy link

This is what I received from a little exchange with Tapo support:

We have reconfirmed with our senior engineer that the Tapo C420S does not support the use of RTSP.
We are sorry that this camera is new to us, so it is a little different from other cameras.
What are the main differences between the C420S2 and the traditional Tapo wifi- protocol smart cameras?
(1) Camera C420 is powered by a battery, and its installation position is more flexible.
(2) Camera C420 cannot be used alone, so it needs to be used together with Hub H200.
(3) The C420 does not support 24-hour Continuous Recording due to the battery power-saving design, it only has Motion Detection recording.
(4) C420 does not support Onvif and RTSP protocols.

My guess is that there might be a way to capture a motion detection stream via the hub but so far my tests and attempts to see API comms between the hub and cameras with a wireshark trace have seen and captured nothing at all :(

@bebo-dot-dev
Copy link

Followed the suggestion from @JurajNyiri in Discord to get a HTTP proxy inline between the Tapo app and the H200 hub to enable API request / responses to be seen.

Burp Suite community edition running on Linux with the Tapo app running on a rooted Android phone with the Burp Suite root CA cert installed on the phone worked nicely to intercept Tapo app API requests and H200 hub responses.

My H200 / C420S2 setup is configured to stream and record to an SD card inserted in the H200 hub.

During a camera motion detection capture test, no request / responses were trapped in the Burp Suite HTTP trace. The Tapo app was not seen to make any long lived websocket connections to the hub, all API interaction appears to be by way of regular HTTP POST requests.

A motion detection test was captured and logged in the Tapo app but this event wasn't seen to be surfaced in the proxied API request response trace. A number of API requests are performed when navigating the Tapo app to play back the recorded motion detection but none of these responses include video stream data or a video stream location.

The IP addresses for the cameras was seen in the HTTP trace in the getChildDeviceList response, the IP addresses for the cameras are in a private 172.23.30.x subnet, not the regular 192.168.1.x LAN subnet that the H200 hub is present and visible on. Presumably the H200 is acting as a DHCP server handing out IP addresses to camera clients.

The cameras appear to talk to and send their motion detected stream to the H200 over a custom protocol (sub G?) on the private 172.23.30.x subnet when motion is detected.

Attached the recorded Burp Suite request / responses from the trace.

burpsuite tapo h200 requests.xml.txt

@JurajNyiri
Copy link
Owner

It's most probably using port 8800. See JurajNyiri/pytapo#4 this issue for more details about how that works. Unfortunately we were still not able to get a stable stream out of it.

@bebo-dot-dev
Copy link

Attached burpsuite.tapo.h200.requests2.xml.txt - this trace includes request / responses for getAlarmConfig + setAlarmConfig

burpsuite.tapo.h200.requests2.xml.txt

@bebo-dot-dev
Copy link

Attached burpsuite.tapo.h200.requests3.xml.txt - this trace includes request / responses for camera advanced settings area options (powerline frequency, frames per second, OSD settings etc)

burpsuite.tapo.h200.requests3.xml.txt

@bebo-dot-dev
Copy link

Attached burpsuite.tapo.h200.requests4.xml.txt - this trace includes request / responses for camera rotation status and other camera settings

burpsuite.tapo.h200.requests4.xml.txt

@JurajNyiri JurajNyiri removed the Help wanted Extra attention is needed label Dec 21, 2022
@JurajNyiri
Copy link
Owner

Working on HUB support now. Probably only control will be available from the start and it might increase battery usage.

@JurajNyiri JurajNyiri linked a pull request Dec 21, 2022 that will close this issue
@JurajNyiri JurajNyiri added this to the 4.2.0 milestone Dec 21, 2022
JurajNyiri added a commit that referenced this issue Dec 21, 2022
@bebo-dot-dev
Copy link

Attached burpsuite.tapo.h200.requests5.xml.txt - this trace includes get and set api requests around night mode settings (IR, full colour mode, smart mode and IR viewing distance)

burpsuite.tapo.h200.requests5.xml.txt

@DamienMrtl
Copy link

Any updates on stream access via the hub ?

@DamienMrtl
Copy link

DamienMrtl commented Aug 11, 2023

Guys we can vote here so they add the RTSP stream on these cams
https://community.tp-link.com/en/business/forum/topic/600676?sortDir=DESC&page=1

@slothking87
Copy link

I also have some C420's They integrate fine but there is no video streaming, and no motion sensor. Just wanted to make sure that those features are not expected to work before I spent more time trying to find out where the problem might be.

@Chazzba
Copy link

Chazzba commented Jan 1, 2024

I have some C420s and was also hoping to have live view streaming through HA and this integration. Anyway we can picky back off smart things to integrate into HA as live view works through smartthings app?

@robbie-brender
Copy link

@slothking87 unfortunately, that is the expected behaviour. For the C420s, no live view/stream, only control. Would love to find a workaround for this. I dont want it permenantly streaming. I would love a way to open the connection when i hit play or something, like in the Tapo app

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants