Skip to content

Add Ring camera source#1567

Merged
AlexxIT merged 6 commits intoAlexxIT:masterfrom
seydx:ring
Jan 25, 2025
Merged

Add Ring camera source#1567
AlexxIT merged 6 commits intoAlexxIT:masterfrom
seydx:ring

Conversation

@seydx
Copy link
Contributor

@seydx seydx commented Jan 24, 2025

Added Ring camera integration that allows users to connect their Ring cameras. Users can authenticate either via email/password (including 2FA support) or by providing a refresh token. (see below)

go2rtc_ring

After successful authentication, all available Ring cameras are displayed with their corresponding source configuration (ring:?device_id=XXX&refresh_token=XXX). These source configurations can then be used to add individual Ring cameras to go2rtc, which handles the WebRTC connection to stream the camera feed. Two-Way audio is also supported.

A separate producer was added for snapshot endpoints (ring:?device_id=XXX&refresh_token=XXX&snapshot) to directly obtain a snapshot from the Ring API

The Ring integration implementation is based on the ring-client-api library


Question: When making requests to Ring's API, sometimes a new refresh token is returned. What would be the best approach to handle and persist these updated refresh tokens in go2rtc's configuration @AlexxIT ?

Regarding to ring-client-api wiki, it is only important for push notification, which is not used here..

@ring-client-api
It may seem possible to simply re-use the initially generated token multiple times, and indeed it will generally work for authentication even if newer tokens are not saved...

@AlexxIT AlexxIT merged commit fc02e6f into AlexxIT:master Jan 25, 2025
@AlexxIT
Copy link
Owner

AlexxIT commented Jan 25, 2025

Thanks! You can safely change config yaml, like HomeKit integration do it for pairings:

func apiPair(id, url string) error {
conn, err := hap.Pair(url)
if err != nil {
return err
}
streams.New(id, conn.URL())
return app.PatchConfig(id, conn.URL(), "streams")
}

AlexxIT added a commit that referenced this pull request Jan 25, 2025
@AlexxIT AlexxIT added this to the v1.9.9 milestone Feb 18, 2025
@gambalaya
Copy link

@seydx I have been using this ring camera integration for over a month now (from a nightly build), and it has been working great, thanks! However yesterday for the first time the refresh token that I had been using for the last month became unauthorized and I had to regenerate again via the Add menu. I saw your comment above about reusing the old token shouldn't matter since it is only important for push notifications - but apparently the old token eventually rolls off somewhere... Wondering if there could be a way to auto-refresh so I don't have to redo it manually if it needs it?

@seydx
Copy link
Contributor Author

seydx commented Mar 9, 2025

@seydx I have been using this ring camera integration for over a month now (from a nightly build), and it has been working great, thanks! However yesterday for the first time the refresh token that I had been using for the last month became unauthorized and I had to regenerate again via the Add menu. I saw your comment above about reusing the old token shouldn't matter since it is only important for push notifications - but apparently the old token eventually rolls off somewhere... Wondering if there could be a way to auto-refresh so I don't have to redo it manually if it needs it?

yeah you re right, experienced the same, will make a new PR to auto update the refresh token

@AlexxIT AlexxIT changed the title Add Ring camera integration Add Ring camera source Mar 10, 2025
@AlexxIT
Copy link
Owner

AlexxIT commented Mar 10, 2025

@gambalaya
Copy link

gambalaya commented Mar 26, 2025

yeah you re right, experienced the same, will make a new PR to auto update the refresh token

Thanks @seydx - as a workaround I now automatically update the token by extracting a homebridge token via the echo source each time (only possible because I am also using the homebridge ring plugin of course):

streams:
  ring:  echo:/go2rtc/ring.sh

ring.sh

echo ring:\?device_id=xxx\&refresh_token=$(jq -r '.platforms[].refreshToken | values' /homebridge/config.json)

@Feierdevil
Copy link

Hello,

I dont understand how i can add the ring cam.

The Ring Login are correct and i see the devID with the refreshToken but i dont know what or where i do this.

Can anybody Help me?

Thx

@seydx
Copy link
Contributor Author

seydx commented May 4, 2025

Hello,

I dont understand how i can add the ring cam.

The Ring Login are correct and i see the devID with the refreshToken but i dont know what or where i do this.

Can anybody Help me?

Thx

copy the url like in the image above, and create a new stream with it in go2rtc

@laurenttaieb
Copy link

laurenttaieb commented Jul 14, 2025

Hi go2rtc team. I have finally managed to not get an error message by setting up the configuration file this way:
streams:
CamName:
- ring: ?device_id=(deviceID)&refresh_token=(my refresh token)
-

I am using v1.9.9. so the integration shall work.
But the camera shows a black screen. Any idea on what I may have missed ?

Thanks
Laurent

-> found the issue. The refresh token has changed...

@laurenttaieb
Copy link

see

This is not the end of the story.
when I click on stream on the web interface, the actual camera doesn't show up all the time, in more than 50% of cases, I have a back scree, with a MSE sign on the top right instead of the RTC one and when the image truly appears, it's only a snapshot not a live one.. Has anyone the same type of issue (I'm not using the "snapshot" version of the Token.
Thanks

@gambalaya
Copy link

see

This is not the end of the story. when I click on stream on the web interface, the actual camera doesn't show up all the time, in more than 50% of cases, I have a back scree, with a MSE sign on the top right instead of the RTC one and when the image truly appears, it's only a snapshot not a live one.. Has anyone the same type of issue (I'm not using the "snapshot" version of the Token. Thanks

I started getting a black screen a few weeks back. Maybe it is an H265 vs H264 codec issue? Tsightler's ring-mqtt project continues to work for me though, which I think tells Ring it is a Firefox client so it always delivers H264.

57Darling02 pushed a commit to 57Darling02/go2nvr that referenced this pull request Feb 17, 2026
Add Ring camera integration
57Darling02 pushed a commit to 57Darling02/go2nvr that referenced this pull request Feb 17, 2026
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