core icon indicating copy to clipboard operation
core copied to clipboard

Nest webcam Issue "Failed to connect WebRTC stream

Open codemonkeybr opened this issue 2 weeks ago • 10 comments

The problem

Nest webcam and ringdoor giving this issue: Failed to connect WebRTC stream: Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to set remote answer sdp: Incompatible send direction

Its a fresh install of this integration btw.

What version of Home Assistant Core has the issue?

core-2025.11.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Google Nest

Link to integration documentation on our website

https://www.home-assistant.io/integrations/nest/#configuration

Diagnostics information

{ "home_assistant": { "installation_type": "Home Assistant OS", "version": "2025.11.2", "dev": false, "hassio": true, "virtualenv": false, "python_version": "3.13.9", "docker": true, "arch": "x86_64", "timezone": "America/Edmonton", "os_name": "Linux", "os_version": "6.12.51-haos", "container_arch": "amd64", "supervisor": "2025.12.2", "host_os": "Home Assistant OS 16.3", "docker_version": "28.3.3", "chassis": "vm", "run_as_root": true }, "custom_components": { "bambu_lab": { "documentation": "https://github.com/greghesp/ha-bambulab", "version": "2.2.16", "requirements": [ "beautifulsoup4" ] }, "webrtc": { "documentation": "https://github.com/AlexxIT/WebRTC", "version": "v3.6.1", "requirements": [] }, "google_home": { "documentation": "https://github.com/leikoilja/ha-google-home", "version": "1.13.1", "requirements": [ "glocaltokens==0.7.6" ] }, "hubspace": { "documentation": "https://github.com/jdeath/Hubspace-Homeassistant/blob/main/README.md", "version": "5.10.0", "requirements": [ "aioafero==6.0.1", "aiofiles", "packaging" ] }, "hacs": { "documentation": "https://hacs.xyz/docs/use/", "version": "2.0.5", "requirements": [ "aiogithubapi>=22.10.1" ] }, "hoymiles_wifi": { "documentation": "https://github.com/suaveolent/ha-hoymiles-wifi", "version": "0.5.1", "requirements": [ "hoymiles-wifi==0.5.5" ] } }, "integration_manifest": { "domain": "nest", "name": "Google Nest", "after_dependencies": [ "media_source" ], "codeowners": [ "allenporter" ], "config_flow": true, "dependencies": [ "ffmpeg", "http", "application_credentials" ], "dhcp": [ { "macaddress": "18B430*" }, { "macaddress": "641666*" }, { "macaddress": "D8EB46*" } ], "documentation": "https://www.home-assistant.io/integrations/nest", "iot_class": "cloud_push", "loggers": [ "google_nest_sdm" ], "requirements": [ "google-nest-sdm==7.1.4" ], "is_built_in": true, "overwrites_built_in": false }, "setup_times": { "null": { "setup": 0.0027063559973612428 }, "01KBVGE3V99CFXNCC408EJK67R": { "config_entry_setup": 3.909169449005276 } }, "data": { "data": { "traits": { "sdm.devices.traits.Info": { "custom_name": "REDACTED" }, "sdm.devices.traits.CameraLiveStream": { "maxVideoResolution": { "width": null, "height": null }, "videoCodecs": [ "H264" ], "audioCodecs": [ "OPUS" ], "supportedProtocols": [ "WEB_RTC" ] }, "sdm.devices.traits.CameraMotion": {}, "sdm.devices.traits.CameraPerson": {} }, "name": "REDACTED", "type": "sdm.devices.types.CAMERA", "parentRelations": [ { "parent": "REDACTED", "displayName": "REDACTED" } ] }, "command": { "sdm.devices.commands.CameraLiveStream.GenerateWebRtcStream_count": 6, "sdm.devices.commands.CameraLiveStream.GenerateWebRtcStream_sum": 13366, "sdm.devices.commands.CameraLiveStream.StopWebRtcStream_count": 4, "sdm.devices.commands.CameraLiveStream.StopWebRtcStream_sum": 10271 } }, "issues": [] }

Example YAML snippet


Anything in the logs that might be useful for us?


Additional information

No response

codemonkeybr avatar Dec 07 '25 05:12 codemonkeybr

Hey there @allenporter, mind taking a look at this issue as it has been labeled with an integration (nest) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of nest can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign nest Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


nest documentation nest source (message by IssueLinks)

home-assistant[bot] avatar Dec 07 '25 05:12 home-assistant[bot]

Hi, my first guess is this is an issue specific to certain browsers (e.g. firefox).Would you be up for trying a couple and reporting back?

allenporter avatar Dec 07 '25 05:12 allenporter

You're damn right its a browser thing lol...

Linux Mint, Chrome Version 143.0.7499.40 (Official Build) (64-bit) didnt work Same machine, Firefox, it did work.

Windows 11 Chrome Version 142.0.7444.xx did work (then i tried to update to the latest version) Windows 11 Chrome Version 143.0.7499.41 didnt work

Android Pixel 9 pro fold, home assistant app, didnt work, same issue Same Android, using chrome browser 142.0.744.171, did work

Galaxy Tablet (couple of years old, Android) home assistant app DID WORK

codemonkeybr avatar Dec 07 '25 17:12 codemonkeybr

This appears to have the same root cause as the Ring integration issue (#135223).

The error message is the same and this is failing for the same reason.

This is caused by Chromium 143+ introducing stricter WebRTC validation. The issue affects both Ring and Nest because both services' cloud backends generate SDP (Session Description Protocol) responses that violate WebRTC specifications.

Chrome v143+, or any other Chromium 143 or later will be affected. This version was released 5 days ago and is still in the process of rolling out to users.

The only way to fix this, besides Nest or Ring making back-end fixes, is to patch the integrations to normalize the cloud-generated SDP before it reaches the browser.

There are some suggestions on how this issue can be fixed for Ring outlined here. The fix for Nest is likely to be similar.

For Ring, there's a pending PR in the python-ring-doorbell library, but it's been stalled for months due to maintainer inactivity. For Nest, perhaps it could be patched directly in Home Assistant's Nest integration.

References

  • Ring issue: #135223
  • Research: https://github.com/home-assistant/core/issues/138821#issuecomment-3622669865
  • Relevant Chromium 143 release notes (introduced stricter validation): https://developer.chrome.com/release-notes/143#webrtc_rtp_header_extension_behavior_change

rorygallagher2024 avatar Dec 08 '25 00:12 rorygallagher2024

(1) Do you know what needs to be changed? (2) The nest library already has an approach for rewriting SDP Answers, so it should be updated in the library not in the integration: google_nest_sdm/webrtc_util.py

allenporter avatar Dec 08 '25 00:12 allenporter

(1) Do you know what needs to be changed? (2) The nest library already has an approach for rewriting SDP Answers, so it should be updated in the library not in the integration: google_nest_sdm/webrtc_util.py

The fix_sdp_answer function in the python-google-nest-sdm library should address the RFC 3264 violation; the same as what is breaking Ring. But I'm not clear if the code you linked is in the version that home assistant currently uses, or if there's additional fixes required.

If you can capture the actual SDP from the failing Nest camera using this JavaScript snippet, that might help determine what needs fixing or whether the existing code handles it.

To capture Nest's SDP for analysis:

  1. Open Chrome DevTools
  2. Go to Console tab
  3. Paste the function and press Enter:
(function() {
  const origSetRemoteDescription = RTCPeerConnection.prototype.setRemoteDescription;
  RTCPeerConnection.prototype.setRemoteDescription = function(description) {
    console.log('=== NEST ANSWER SDP ===');
    console.log(description.sdp);
    console.log('=== END ===');
    return origSetRemoteDescription.apply(this, arguments);
  };
  
  const origSetLocalDescription = RTCPeerConnection.prototype.setLocalDescription;
  RTCPeerConnection.prototype.setLocalDescription = function(description) {
    console.log('=== NEST OFFER SDP ===');
    console.log(description.sdp);
    console.log('=== END ===');
    return origSetLocalDescription.apply(this, arguments);
  };
})();
  1. Now try to connect to your Nest camera
  2. Copy the SDP output from the console

You may wish to redact the following lines (containing temporary session credentials):

  • a=ice-ufrag:...
  • a=ice-pwd:...
  • a=candidate:... (IP addresses)
  • a=fingerprint:...

The important parts for debugging are the a=sendrecv/a=sendonly/a=recvonly lines and any a=extmap lines.

rorygallagher2024 avatar Dec 08 '25 01:12 rorygallagher2024

(1) Do you know what needs to be changed? (2) The nest library already has an approach for rewriting SDP Answers, so it should be updated in the library not in the integration: google_nest_sdm/webrtc_util.py

The fix_sdp_answer function in the python-google-nest-sdm library should address the RFC 3264 violation; the same as what is breaking Ring. But I'm not clear if the code you linked is in the version that home assistant currently uses, or if there's additional fixes required.

Yes, i'm trying to say library is already used by Home Assistant nest integration, and the required additional fixes can go there.

allenporter avatar Dec 08 '25 01:12 allenporter

You can also get the offer / answer from enabling debug mode in the integration and they will be recorded in the log.

allenporter avatar Dec 08 '25 01:12 allenporter

Is there anything that i can do to help u folks?

codemonkeybr avatar Dec 09 '25 17:12 codemonkeybr

I think next steps are: (1) capture debug logs with the answer / offer causing a problem (redact as suggested above) (2) someone with technical knowledge of webrtc diagnoses the problem and/or also reproduces the problem and tries modifying the offer/answer to meet Chrome's new standards. (I don't know what these standards are that are not being met)

allenporter avatar Dec 10 '25 03:12 allenporter

You're damn right its a browser thing lol...

Linux Mint, Chrome Version 143.0.7499.40 (Official Build) (64-bit) didnt work Same machine, Firefox, it did work.

Windows 11 Chrome Version 142.0.7444.xx did work (then i tried to update to the latest version) Windows 11 Chrome Version 143.0.7499.41 didnt work

Android Pixel 9 pro fold, home assistant app, didnt work, same issue Same Android, using chrome browser 142.0.744.171, did work

Galaxy Tablet (couple of years old, Android) home assistant app DID WORK

Same error in MS Edge Version 143.0.3650.80 on Windows 11 PC and Home Assistant android app version 2025.11.4-full on Android 16 Pixel 8 Pro

Fresh install. Installation method Home Assistant Container Core 2025.5.3 Frontend 20250516.0.

sgerick avatar Dec 16 '25 05:12 sgerick

If you can capture the actual SDP from the failing Nest camera using this JavaScript snippet, that might help determine what needs fixing or whether the existing code handles it.

I followed instructions and captured the log. Hope it helps.

home-assistant_nest_2025-12-16T05-29-00.929Z.log

sgerick avatar Dec 16 '25 07:12 sgerick

OK. I'm no expert but this is my understanding.

The error, incompatible send direction, is a direct result of the stricter RFC compliance for WebRTC SDP validation introduced in Chromium 143(released December 2025) [including the HA Android App WebView]. Chromium and the standard WebRTC Offer/Answer model (RFC 3264) require that if an offer is a=recvonly, the answer must be a=sendonly (if the responder intends to send) or a=inactive (if it does not). Because the Nest Answer returns a=sendrecv, it implies the server expects the client to send media that the client has already stated it will not provide, leading to a negotiation failure in the browser.

As seen in the attached log, home-assistant_nest_2025-12-16T05-29-00.929Z.log, the Nest Offer (client-side) is configured as a receiver (offers a=recvonly), but the Nest Answer (server-side) is returning a=sendrecv. By changing Nest's sendrecv to sendonly, you are telling the browser: "Nest will only be sending media to you, and it no longer expects you to send anything back." This satisfies the new validation rules introduced with the RTP header extension behavior change.

And it looks like fixes in google_nest_sdm/webrtc_util.py address this issue, but maybe these changes haven't propagated to my version yet.

sgerick avatar Dec 18 '25 06:12 sgerick