Camera widget consumes bandwidth even if not visible

Hello, the app is really great!

I just run into problems when configured camera widget. I bind two items: the snapshot url and live url.

The problem is that
when:

  • the widget is not visible currently (scrolled to another dashboard)
  • or when the live preview is closed (tapped the snapshot to see live preview then closed)

then:

  • bandwidth usage is relatively high (the same value as when the live preview is running)
  • all my transfer is immediately consumed (I use LTE connection with transfer limit)

So I can’t use the widget in fact.

I think it shouldn’t buffer the data when the widget is not visible :slight_smile:

Would be great to have it solved this way!
Thanks!

What is the data format for those two items? Is snapshot URL a static image?
What is snapshot interval in camera widget config?

The expected behavior should be: refresh snapshot URL based on configured interval when dashboard is open (even if on different dashboard page) and use video URL only in popup.
So if you can answer questions above, it could help figuring out if there is a bug there somewhere.

Hello,

For both (“Video URL” and “Snapshot URL”) I used “Raspberry Pi Camera” item, which I selected from “Bind an item” menu. Then, “Video URL” and “Snapshot URL” has value “/api/camera_proxy_stream/camera.raspberry_pi_camera”.

In Home Assistant I use configuration:

camera:
- platform: rpi_camera  
  name: Raspberry Pi Camera
  image_width: 640
  image_height: 480
  image_quality: 7
  image_rotation: 0
  timelapse: 1000
  horizontal_flip: 0
  vertical_flip: 0
  file_path: /mnt/ramdisk/raspistill.jpg

@KrystianPW Thanks for providing the information.

Just want to confirm that both Video and Snapshot URLs properties show the same URL in widget editor?

/api/camera_proxy_stream/camera.raspberry_pi_camera

Normally Snapshot property should show something like that:

/api/camera_proxy/camera.raspberry_pi_camera

This might be the reason the extra bandwidth is consumed.

Can you also screenshot attributes shown in the last column for that camera component in HA UI on /developer-tools/state page?

I added 6 cameras to my second dashboard. Now from time to time the app crashes.
I also think that the widget should not poll any snapshot when it is not visible.

Did you add to a separate dashboard (switched through drawer menu) or just second page of the same dashboard (switched through tabs or swipe)?

Second page.

Currently all pages are loaded at the same time for fast switching, and avoiding showing stale information.
Now that I’m thinking about it though, camera snapshot might need to be an exception to that, but not sure what is possible there yet.

I removed the camera widgets (left ony 1, instead of 7), no more crashes.
Meanwhile I noticed that the camera sends huge still pictures (2688x1520px JPEG files) at the still_image_url. At the stream_source i’ve specified a lower resolution sub-stream, but still pictures resolution cannot be modified.

Perhaps HomeHabit puts too much workload on the tablet’s CPU processing such big still pictures, just for the scope of thumbnails in the widgets.

If I set to refresh the image every 10 seconds, often I see that some cameras are refreshed at once, that may cause even more load. Maybe some rotation with a little delay would free up CPU.

I’m thinking to implement a quick proxy in php with imgmagick on my home server just to resize the photos while they’re pulled from the camera - to offload the tablet.

@Robi what is the tablet model?

It’s model YC-1011 from https://portworld-solu.com/poe-tablet/
An industrial wall-mounted POE tablet.

My tablet model is quite popular one: “Samsung Galaxy Tab 3 Lite SM-T113”.

Initially both properties were bound to the same entity - raspberry pi camera (/api/camera_proxy/camera.raspberry_pi_camera). I use Home Assistant.

When both were bound the problem occurred. When only snapshot is bound (no live video) then I had no problem but couldn’t see live image, only the snapshot refreshed every 60 seconds.

And my screenshot from the tablet:

What was the problem that occurred? Too much bandwidth usage?

The problem is that video preview is closed but it still consumed bandwidth like it was opened.
So I go to video preview, look for 5 seconds, close the preview.
And then in 24 hours I’m going to have so much bandwidth consumed as it was opened all 24 hours. But It was opened only for 5 seconds.
So I don’t want the app to consume bandwidth when video preview is closed.

@KrystianPW yes, that’s not normal behavior. The video stream connection should be disconnected when preview is closed. What is Android OS version on that device?

From the 1.7 release Camera widget will pause when it is not visible for a period of time (1 minute).

Thanks a lot!
It was Android 4.4.4

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.