Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ring camera integration #1567

Merged
merged 6 commits into from
Jan 25, 2025
Merged

Add Ring camera integration #1567

merged 6 commits into from
Jan 25, 2025

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
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.

2 participants