Skip to content

Camera stream#800

Open
zackcornelius wants to merge 64 commits intoSecKatie:masterfrom
zackcornelius:camera_stream
Open

Camera stream#800
zackcornelius wants to merge 64 commits intoSecKatie:masterfrom
zackcornelius:camera_stream

Conversation

@zackcornelius
Copy link

@zackcornelius zackcornelius commented Mar 7, 2026

This adds webRTC stream implementation based off the my.wyze.com/live web implementation

Tested with Wyze v2, v3, and Floodlight pro, but the mechanism appears to be the same (using Kinesis video streams with webRTC) for all wyze web view supported cameras (which is maybe all of them?)

This does use the cloud implementation of streaming, rather than the local tutk interface, but does not require a local streaming server (no go2rtc, etc), as it uses HA's native webRTC implementation.

@zackcornelius zackcornelius requested a review from SecKatie as a code owner March 7, 2026 15:38
@CLAassistant
Copy link

CLAassistant commented Mar 7, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ zackcornelius
❌ diogormendes
You have signed the CLA already but the status is still pending? Let us recheck it.

@zackcornelius
Copy link
Author

@brg468 - Took a look more at those Ring and Nest reports, looks like it was actually a stricter webRTC SDP validation in Chrome 143+ causing issues with the AWS Kinesis video stream response not being technically valid.

I've duplicated the fix from the Ring add-on and validated with Chrome 143. You can try with the updated code, it should work now.

Interesting that the cam v2 worked (it's TUTK internally, so no native/local webRTC) and the cam v3/4 did not (those are webRTC in the camera, and might even be using a local connection).

@SecKatie - I think this might be ready for another review

@brg468
Copy link
Collaborator

brg468 commented Mar 13, 2026

@zackcornelius ok I’ll try the updated code in the next couple days, I’m out of town so can’t right now.

I have a few other comments from my quick review:

  • I think we need to add the device_info property so these cameras tie in with the existing devices. Right now they’re just orphaned entities.

  • I’m pretty sure the camera_image method needs to be added. Was getting a NotImpemented error as it’s trying to generate a preview pic.

https://developers.home-assistant.io/docs/core/entity/camera/#camera-image

  • It may be addressed in the commits you just pushed but having a camera either off or offline caused an exception and caused all the cameras not to load.

  • I think right now the state could be both RECORDING and STREAMING. Seems like it shouldn’t be both. Streaming makes more sense to me, so I would recommend just not implementing the is_recording property since it defaults to false anyway.

I’ll get a chance to play around with it more in a few days, thanks for your work on this!

@zackcornelius
Copy link
Author

Added the device_info property, and removed the is_recording property, should clean those up

I haven't implemented a camera_image yet, as it'll need some more integration with the wyzeapy to get the preview URLs.

And the recent updates do fix the startup with an offline camera.

@brg468
Copy link
Collaborator

brg468 commented Mar 13, 2026

Can camera_image just return None for now to avoid the implementation error?

@brg468
Copy link
Collaborator

brg468 commented Mar 16, 2026

I tried the new code, the Failed to connect WebRTC stream error is gone, but I still get the ValueError: Session ID not found trace.

I don't know much of anything about WebRTC but just using breakpoints it seems like async def async_on_webrtc_candidate is getting called first when I click on a camera, and at that point in the code self.sessions is an empty dict. It is strange that a couple cams throw that error and still load a feed while the rest never show anything.

I'm happy to keep testing but like I said I don't know the best way to troubleshoot besides passing on what I'm seeing.

Add pending candidates handling for WebRTC sessions.

Signed-off-by: Diogo Mendes <[email protected]>
@diogormendes
Copy link

diogormendes commented Mar 17, 2026

Try this one @brg468 zackcornelius#9, working for me !

I hope it helps !! And thanks for initializing this @zackcornelius 🚀

Refactor signaling URL handling to undouble percent-escapes while preserving necessary encodings for AWS signature verification.

Signed-off-by: Diogo Mendes <[email protected]>
Update motion_detection_enabled property to handle None values gracefully.

Signed-off-by: Diogo Mendes <[email protected]>
@brg468
Copy link
Collaborator

brg468 commented Mar 17, 2026

@diogormendes I can confirm that fixes the issue I was having, nice job! Camera feeds now load for all my cams. I added a couple things in your PR as a review if you could take a look please.

diogormendes and others added 3 commits March 17, 2026 17:08
Co-authored-by: Brian Rogers <[email protected]>
Signed-off-by: Diogo Mendes <[email protected]>
Co-authored-by: Brian Rogers <[email protected]>
Signed-off-by: Diogo Mendes <[email protected]>
Co-authored-by: Brian Rogers <[email protected]>
Signed-off-by: Diogo Mendes <[email protected]>
@diogormendes
Copy link

@zackcornelius , is this PR still alive ?

@zackcornelius
Copy link
Author

zackcornelius commented Mar 21, 2026 via email

Copy link
Collaborator

@brg468 brg468 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small addition to hopefully avoid the blocking call.

@brg468
Copy link
Collaborator

brg468 commented Mar 21, 2026

@zackcornelius while you're cleaning things up can you address some of the formatting issues, like unsorted imports and missing docstrings. That's been on my list of things to do for the other platforms and this will help out with one less to tackle. Thanks!

Implement buffering for ICE candidates in WebRTC
@zackcornelius
Copy link
Author

@diogormendes - Since I've merged your PR to my branch, can you sign the CLA? There's a comment at the top of the issue with instructions

@brg468 brg468 self-requested a review March 22, 2026 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants