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

Unable to create streams for google nest camera entities - no entity_id #635

Open
twhittock opened this issue Jan 12, 2024 · 8 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@twhittock
Copy link

Trying to use go2rtc using this integration to create a stream for the my google nest camera so I can use it in more places.

Following the readme to configure it using hass entities (which are working directly in hass) in the go2rtc docs here: https://github.com/AlexxIT/go2rtc?tab=readme-ov-file#source-hass

I create a configuration like this:

streams:
  left_side_camera:
    - hass:entity_id=camera.left_side_camera

No errors on startup, but when I try to preview the stream using http://myhassinstance:1984/stream.html?src=left_side_camera I get the following error:

undefined error=streams: hass: no entity_id caller=github.com/AlexxIT/go2rtc/internal/mjpeg/init.go:166

Looking at go2rtc issues, this was reported before and was due to missing config info, but I can't see any way / need to do that when running as an integration?

@twhittock
Copy link
Author

twhittock commented Jan 12, 2024

If i should be using the different syntax in the readme in this repo, I'm a bit confused.

If I use hass://supervisor?entity_id=camera.left_side_camera then I get the error undefined error=streams: hass: wrong type: auth_invalid caller=github.com/AlexxIT/go2rtc/internal/mjpeg/init.go:166

If I use hass://myhassinstance?entity_id=camera.left_side_camera then I get undefined error=streams: hass: no token caller=github.com/AlexxIT/go2rtc/internal/mjpeg/init.go:166

If I then provide a token, it tells me undefined error=streams: websocket: bad handshake caller=github.com/AlexxIT/go2rtc/internal/mjpeg/init.go:166

So it's like it needs to treat the request as if it's an external system, even though it's running as an integration? But even with the token it can't seem to negotiate a connection.

@Lockie85
Copy link

I'm also getting this issue with my Nest Doorbell camera. Go2RTC is installed on my Home Assistant as an Addon. The code is as follows:

streams:
  bedroom_2:
    - hass:Camera-Hub-G3-E44E
    - ffmpeg:aqara_g3#audio=aac#audio=opus
  doorbell:
    - hass:doorbell

Worth noting that the bedroom_2 camera works fine.

@AlexxIT AlexxIT added the question Further information is requested label Feb 17, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented Feb 17, 2024

hass:entity_id=camera.left_side_camera syntax completely wrong.
How have you installed Hass?
How have you installed go2rtc?

@AlexxIT AlexxIT self-assigned this Feb 17, 2024
@twhittock
Copy link
Author

twhittock commented Feb 17, 2024

Yeah, I tried a lot of different variations on the syntax, since nothing I tried worked. The second message lists the variations.

Home Assistant is a simple hassos install, nothing special.

go2rtc is installed via this integration, which I relied on to install go2rtc automatically (which works for other camera types) My configuration is:

api:
  password: <password>
  username: admin
rtsp:
  password: <password>
  username: admin
hass:
  config: "/config"
streams:
  <other cameras which work...>
  nest_camera:
    - hass://supervisor?entity_id=camera.left_side_camera&token=<my token>

@AlexxIT
Copy link
Owner

AlexxIT commented Feb 17, 2024

Ok. I needs to test if hass://supervisor construction works when go2rtc runs inside hass container

@twhittock
Copy link
Author

I'm happy to use it some other way - I also tried the hostname of the actual hass instance...

@AlexxIT
Copy link
Owner

AlexxIT commented Feb 17, 2024

You need to use hass://supervisor and not use token when go2rtc runs as addon on same server.
And use hass://ip and token when hass installed on another server

@twhittock
Copy link
Author

twhittock commented Feb 17, 2024

ok thank you - here's my updated findings:

  1. hass://supervisor - fails with "auth invalid" error, no matter what I do.
  2. hass://hostname - fails due to resolving to the container-local IP (172....) for the name of the server.
  3. hass://ip - fails due to using port 80
  4. hass://ip:8123 - works if you supply a token!!

So the ip, port and token approach works in the integration with automatically installed go2rtc scenario! Thank you for your help. I guess it's meant to work with the supervisor URI, which would certainly be more convenient, but it's enough for me!

Thanks.

@AlexxIT AlexxIT added bug Something isn't working and removed question Further information is requested labels Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants