frigate-hass-integration: 2024.11.0 WebRTC stream not working

Version of the custom_component

5.4.0

Configuration


Describe the bug

After HASS upgrade to 2024.11, streams for cameras that exposed via Frigate/Frigate integration are stoped working, only static image. I’m not using Frigate card, only native HASS camera view. Information about my steup:

  • frigate are up and running on a separate host (192.168.1.209 in logs) from homeassistant
  • frigate proxy addon are configured on hass and connected to frigate instance

WebRTC is enabled in Frigate Integration. No errors in browser console.

Debug log



2024-11-07 23:02:06.445 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140568319030848] Error handling message: Unknown error (unknown_error) from 192.168.1.30 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 28, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/camera/webrtc.py", line 263, in ws_webrtc_offer
    await camera.async_handle_async_webrtc_offer(offer, session_id, send_message)
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 634, in async_handle_async_webrtc_offer
    answer = await self.async_handle_web_rtc_offer(offer_sdp)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/frigate/camera.py", line 332, in async_handle_web_rtc_offer
    answer = await resp.json()
             ^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/aiohttp_client.py", line 80, in json
    return await super().json(*args, loads=loads, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1277, in json
    raise ContentTypeError(
aiohttp.client_exceptions.ContentTypeError: 500, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url='http://192.168.1.209:5000/api/go2rtc/webrtc?src=cam_back'

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 40 (8 by maintainers)

Most upvoted comments

This is now fixed (tested by both myself and @felipecrs ). Will do a new release this weekend.

Update: Myself and @felipecrs played around and think we have a fix. PR coming soon…

For example, Tuya integration wasn’t changed (apparently) for 2024.11. https://github.com/home-assistant/core/blob/dev/homeassistant%2Fcomponents%2Ftuya%2Fcamera.py#L82

Does it actually support webrtc though? Does not have a async_handle_async_webrtc_offer method …

Not natively, but that’s the thing: it does not need to. HA 2024.11 will feed its RTSP into HA’s go2rtc, which then enables WebRTC stream (automatically and transparently).

Maybe for cameras which has an RTSP interface, providing a native WebRTC handling is unnecessary.

i.e. there’s magic in Home Assistant (via built-in go2rtc) that will have this work out of the box? Let me quickly edit the integration and test…