How to use this repo?
- User
How to use this repo?
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
How to use this repo?
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
The provided documentation explains how to use the WebRTC Camera component within Home Assistant. Here's a breakdown of the key steps:
1. Installation:
Method 1 (HACS): The recommended method is to use HACS (Home Assistant Community Store). Navigate to HACS in your Home Assistant instance, go to "Integrations", click the "+" button, search for "WebRTC", and install it.
Method 2 (Manual): Alternatively, you can manually download the webrtc folder from the latest release and copy it to the /config/custom_components folder in your Home Assistant configuration directory.
YAML UI Mode (if applicable): If you manage your Home Assistant UI in YAML mode, you'll need to add a resource entry to your UI configuration:
url: /webrtc/webrtc-camera.js
type: module
Then, refresh your browser.
2. Configuration:
3. Using the Custom Card:
The webrtc-camera custom card is the primary way to display and interact with your camera streams. You'll add this card to your Lovelace dashboards.
Key Card Configuration Options:
url (Required if entity or streams is not provided): Specifies the URL of the camera stream. This can be:
go2rtc (e.g., rtsp, rtmp, http, onvif, etc.).name from your go2rtc configuration file (go2rtc.yaml).entity (Required if url or streams is not provided): The entity ID of a camera already configured in Home Assistant (e.g., camera.generic_stream).
streams (Required if url or entity is not provided): A list of streams with different configurations. Each stream can have a url, name, mode, and media specified.
type: Set to 'custom:webrtc-camera'.
Example Minimal Configurations:
type: 'custom:webrtc-camera'
url: 'rtsp://rtsp:[Redacted PhoneNumber]@[Redacted IPAddress]:554/av_stream/ch0'
type: 'custom:webrtc-camera'
url: 'camera1' # stream name from go2rtc.yaml
type: 'custom:webrtc-camera'
entity: camera.generic_stream # change to your camera entity_id
type: 'custom:webrtc-camera'
streams:
- url: go2rtc_stream_hd
name: HD # name is optional
mode: webrtc # mode is optional
media: video # media is optional
- url: go2rtc_stream_sd
name: SD
mode: mse
media: audio
Full Configuration Example:
type: 'custom:webrtc-camera'
url: 'rtsp://rtsp:[Redacted PhoneNumber]@[Redacted IPAddress]:554/av_stream/ch0'
entity: camera.generic_stream
mode: webrtc,webrtc/tcp,mse,hls,mjpeg # stream technology, default all of them
media: video,audio # select only video or audio track, default both
server: http://192.168.1.123:1984/ # custom go2rtc server address, default empty
ui: true # custom video controls, default false
digital_ptz: # digital zoom and pan via mouse/touch, defaults:
mouse_drag_pan: true
mouse_wheel_zoom: true
mouse_double_click_zoom: true
touch_drag_pan: true
touch_pinch_zoom: true
touch_tap_drag_zoom: true
persist: true # zoom factor and viewport position survive page reloads
# digital_ptz: false # to disable all mouse/touch digital zoom and pan
title: My super camera # optional card title
poster: https://home-assistant.io/images/cast/splash.png # still image when stream is loading
muted: true # initial mute toggle state, default is false (unmuted)
intersection: 0.75 # auto stop stream when less than 75% of video element is in the screen, 50% by default
background: true # run stream when not displayed (ex. for quick video loading), default false
shortcuts: # custom shortcuts, default none
- name: Record
icon: mdi:record-circle-outline
service: switch.toggle
service_data:
entity_id: switch.camera_record
mode: Specifies the streaming technology to use (e.g., webrtc, mse, hls, mjpeg). The card will attempt to use the best available mode based on browser capabilities and network conditions.4. go2rtc:
This component relies heavily on go2rtc as the streaming server. go2rtc handles the actual streaming from your camera to the browser.
Installation Options:
go2rtc for you.go2rtc or Frigate add-on.go2rtc as a binary or Docker container on any server on your LAN.Configuration: You can customize go2rtc's behavior by creating a go2rtc.yaml file in your Home Assistant configuration directory.
Important Security Note: By default, go2rtc runs a web interface on port 1984 without a password. Anyone on your local network can access this interface and view your camera streams. You can disable this in the go2rtc configuration.
5. Templates
shortcuts, style, and ptz card options.shortcuts and style can use states related templates.ptz can use streamName/streamID related templates.6. Two-Way Audio:
microphone to the media parameter in the card configuration.7. Snapshots to Telegram
go2rtc.8. Cast or Share Stream:
9. Stream to Camera
10. Debugging:
Add the following to your configuration.yaml to enable debug logging:
[Redacted Person]:
default: warning
logs:
custom_components.webrtc: debug
In summary, you install the integration, configure the go2rtc server (either automatically or manually), and then use the webrtc-camera custom card in your Lovelace dashboards, configuring it with the appropriate stream URL or camera entity. Remember to consult the go2rtc documentation for advanced configuration options.
media: Specifies whether to include video and/or audio tracks. You can also specify microphone for two-way audio.server: If you're running go2rtc on a different server, specify the URL here. If left empty, the component will attempt to manage go2rtc automatically.ui: Enables custom video controls.digital_ptz: Enables digital pan, tilt, and zoom controls via mouse/touch.title: Sets the title of the card.poster: Specifies a still image to display while the stream is loading. Can be a URL, a camera entity, or a stream name from go2rtc.muted: Sets the initial mute state of the video.intersection: Automatically stops the stream when the video element is not visible on the screen.background: Keeps the stream running even when the card is not displayed.shortcuts: Adds custom buttons to the card that can trigger Home Assistant services.