Add on: RTSPtoWeb and RTSPtoWebRTC

This may be a silly question, but I couldn’t find the answer anywhere: The frigate lovelace card mentions using the Native RTSPToWeb and RTSPToWebRTC addons, but I just can’t figure out how it works. If I create “generic” or “ffmpeg” camera, the stream is converted to webRTC correctly, but none of the frigate lovelace live views seem to use it.

I’ve forced the “live_provider” to “ha”, but no deal.

Anyone has examples for those?

Thanks

@allenporter After discovering that the webRTC camera feeds worked fine in Edge (I don’t use it so I only tested Chrome and FireFox), I realized that webRTC was disabled in both the other browsers. I found out by installing a browser plug in that enables/disables it to prevent your IP from being leaked when you are on a VPN. I then took a look at the settings of PureVPN which is installed on both Chrome and FireFox but not Edge and sure enough there was a default on setting which seems to work even when not connected to the VPN. If I turn that off it works just fine.

Mystery solved! Hope it helps others having my same issue!

Summary: Check webRTC settings in your VPN client regardless of you using it or not when the webRTC camera feeds don’t work.

Now I wonder whether turning that off can negate part of the benefit of using a VPN… as far as I know I only use webRTC in this context.

Edit: Not sure how useful this is but in my digging I ran across this (works in Chrome and shows some info on the webRTC streams):

chrome://webrtc-internals/

To expand on this, the new integration is a night and day difference between the “old” add-on from AlexIT. Don’t get me wrong, Alex’s worked really well and he certainly paved the way for this integration, but I was amazed at how much better the built in integration works now. No more stuttering; buttery smooth and it even loads the initial camera feed faster (1 sec vs 2 sec, but when you have 12+ cameras that makes a huge difference).

Hello. This is great. I successfully added it to a system that already has 4 cameras. I then added two more. At the time I was using HA Cloud, which I have disabled. Now, I use VPN to connect, but when away from home - HA will only load the two cameras I added after installing this Add On. Any ideas where I should start?

Has anyone used this to restream Blue Iris streams? I find that the blue iris cameras I added to HA via the custom integration don’t always load up in the HA app. Plus I noticed that the video could be a few seconds behind real-time. Just looking to see if this addon might fix my issues.

Is there a way to have the audio unmuted by default when loading a picture card? I have audio working but it only plays when you view the camera entity directly or load more-info from the picture card. I want to hear the audio without having to interact with the card.

Thanks

EDIT:

After 3 days of searching I finally found the solution: Frigate lovelace card in HACS

This thing is awesome - very configurable and does not require frigate integration. It can work with home assistant natively including with HLS, LL-HLS, or WebRTC. Of course, has an option to auto-unmute live video.

Still cant get it work remotely using picture glance card, only able to view locally

Hey,

I just installed the addon in order to be able to proxy my camera from my second house to my home HA instance (I got 2 HA instances up).

However, using demo:demo isn’t really secure, even if it is on a local network (i’m using wireguard as a VPN between the two houses). On my RTSP camera feed I have a username and password which is kinda strong, therefore having it in clear in the addon is a bit buggin me.
Do you know if I can change the default username and password and if so, how? Maybe directly in the docker container somewhere?

Thanks!

I have never changed an add-on docker container before, but assuming you can then you can see the upstream project for more info on how to configure it and what options are available.

I am facing this issue webtortc sometimes fails to load
image
and in logs.

Logger: homeassistant.config_entries
Source: config_entries.py:366
First occurred: 1:52:57 PM (2 occurrences)
Last logged: 1:53:02 PM

Config entry 'RTSPtoWeb - WebRTC' for rtsp_to_webrtc integration not ready yet: RTSPtoWeb server communication failure: Cannot connect to host 127.0.0.1:8083 ssl:default [Connect call failed ('127.0.0.1', 8083)]; Retrying in background
Config entry 'WLED' for wled integration not ready yet: Invalid response from API: Error occurred while communicating with WLED device at 192.168.18.224; Retrying in background
Source: components/rtsp_to_webrtc/__init__.py:49
First occurred: 1:53:32 PM (1 occurrences)
Last logged: 1:53:32 PM

Error setting up entry RTSPtoWeb - WebRTC for rtsp_to_webrtc
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/rtsp_to_webrtc/__init__.py", line 49, in async_setup_entry
    client = await get_adaptive_client(
  File "/usr/local/lib/python3.9/site-packages/rtsp_to_webrtc/client.py", line 48, in get_adaptive_client
    await webrtc_heartbeat
  File "/usr/local/lib/python3.9/site-packages/rtsp_to_webrtc/webrtc_client.py", line 74, in heartbeat
    await self._request("get", HEARTBEAT_PATH, label="heartbeat")
  File "/usr/local/lib/python3.9/site-packages/rtsp_to_webrtc/webrtc_client.py", line 89, in _request
    resp = await self._session.request(method, url, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 535, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 542, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 907, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1175, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 986, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore[return-value]  # noqa
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1041, in create_connection
    sock = await self._connect_sock(
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 955, in _connect_sock
    await self.sock_connect(sock, address)
  File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 502, in sock_connect
    return await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/rtsp_to_webrtc/__init__.py", line 49, in async_setup_entry
    client = await get_adaptive_client(
  File "/usr/local/lib/python3.9/site-packages/async_timeout/__init__.py", line 129, in __aexit__
    self._do_exit(exc_type)
  File "/usr/local/lib/python3.9/site-packages/async_timeout/__init__.py", line 212, in _do_exit
    raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError

Have a look from the add-on side. Is it started and are there errors in in be the log?

that is working fine, it seems

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-rtsp-to-web: executing... 
[13:53:40] INFO: Updating configuration
[cont-init.d] 01-rtsp-to-web: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[13:53:50] INFO: Starting discovery service
[13:53:50] INFO: Starting RSTPtoWeb
[13:53:57] INFO: Successfully send discovery information to Home Assistant (8083).

here is configuration

log_level: info
debug: false
http_port: 8083
rtsp_port: 5541
insecure_skip_verify: false

to rectify this I have to restart the add-on, delete the integration and re-add it manually with URL.

Ok glad you have it working. If it happens again might be useful to see the integration diagnostics data.

this happens every other day.

Can you visit the web page for the server addon? From the log it look like the server is running. Maybe this is a startup timing issue? As in it’s not retrying if the addon isn’t set up right so maybe you can compare timing in the logs

1 Like

Since it is working right now, i can’t be sure. once I face it next time I will check.

I’m using this add-on and locally it’s almost like magic, the zero delay is awesome and allows me to check on my baby without issues.
But when I’m outside and connected through Nabu Casa the camera stops working. Anyone faced the same issue? Is there a way to enable/disable this through an automation when I leave home?

Thanks in advance!

try accessing http://your-ip-or-domain:8083/

Sadly I don’t have an external IP address.

I think I’ll have to use the frigate card and show the RTSP card when everyone is home and the HLS card when someone leaves.

Do you have nabu casa? Just replace port 8123 with 8083 in the address. Or you can still use tailscale Tailscale, anyone using it? - #14 by nick6. or on zero-tier
e.g I can access mine at 10.147.19.23:8083 (obviously I can connect to bcz I am using zero-tier) i.e your Homeassistant zero-tier/Tailscale IP:8083.

In case of tailscale it will be your localhomeassistantip:8083 and in zerotier you can choose whatever range you need.