tsightler / ring-mqtt

Ring devices to MQTT Bridge
MIT License
600 stars 106 forks source link

Snapshot Fails For Generic Camera #717

Closed Drifter321 closed 1 year ago

Drifter321 commented 1 year ago

When adding the Generic Camera integration, the snapshot always times out. However, when manually visiting the URL that ends up in the error logs in a browser the snapshot works correctly. Snapshot images also work correctly from the "sensor"

Source: components/generic/config_flow.py:328
Integration: generic (documentation, issues)
First occurred: 7:03:07 AM (5 occurrences)
Last logged: 7:15:06 AM

Error getting camera image from http://192.168.1.32:20810/api/camera_proxy/camera.front_door_snapshot?token=5de761d9a6f796a90789035e68201177441c36592c2dc84be9e399a8ce1edfe3: ConnectError
Error getting camera image from http://192.168.1.32:20810/api/camera_proxy/camera.front_door_snapshot?token=5de761d9a6f796a90789035e68201177441c36592c2dc84be9e399a8ce1edfe3: ConnectTimeout
Error getting camera image from http://192.168.1.32:20810/api/camera_proxy/camera.front_door_snapshot?token=22936550b5922115d6863a87929c1c1d1af9533931aff7141895c3e06c34ccee: ConnectTimeout

Generic Camera Integration Setup: Still Image : http://192.168.1.32:20810{{ states.camera.front_door_snapshot.attributes.entity_picture }} Stream Source : rtsp://172.16.0.64:8554/a8e2c19097dd_live

I'm running this as a docker image on a Truenas Scale setup.

tsightler commented 1 year ago

Unfortunately, there's not much I can help with here. Since you don't appear to be using TLS/SSL you could try changing the URL to point to local host. Basically, the way this works is that the URL simply comes from the Home Assistant camera proxy API, so it's effectively Home Assistant making a request to itself. It's quite unusual for the HA UI to be on port 20810, so I guess I'd ask if you are sure this is correct. Otherwise, you have to figure out why it's being blocked but that is all on the Home Assistant side and I don't have any visibility into that.

Drifter321 commented 1 year ago

Thanks for the response.

The port comment lead me to the solution. So sharing the fix.

Truenas Charts defaults HA's port to 20810: https://github.com/truenas/charts/blob/master/charts/home-assistant/1.0.106/questions.yaml#L31 Not sure why but thats why the port is weird

Just below that option in the config was "Enable Host Network" which defaulted to false: https://github.com/truenas/charts/blob/master/charts/home-assistant/1.0.106/questions.yaml#L48

Enabling that fixed it.