Open nick2525 opened 4 years ago
But could it help to have a different setting in frontend for mobile apps/browsers?
Thats unrelated to the android app but I am sure you can start a discussion about it in the frontend repo because that is where the update will come from.
Done that: https://github.com/home-assistant/frontend/discussions/8831
Last month I had almost 20GB of background data (luckily through wifi due to corona), which could be dramatically lower if the connection closes after 10 seconds.
You can just remove cameras from the home page and keep them on a tab that isn't normally visible and it will greatly reduce the camera stream issue. The issue here is that the camera is the last thing being observed so its kept open. By ensuring the video doesnt even start on the tab it removes the issue. Also as noted in this thread the connection closing didn't solve the issue so we are not sure where it is coming from.
My cameras aren't on the homepage. Actually when I open a tab with cameras traffic goes up significantly, then switch to one without and close the app, traffic keeps on that level. Closing the app eliminates the traffic.
Wouldn't this whole issue be frontend related? When a stream is out of view (either because the tab/view has changed to another, or the browser/app closed), it should not use traffic.
Also as noted in this thread the connection closing didn't solve the issue so we are not sure where it is coming from.
Btw, traffic does stop for me after XX (probably 5) minutes.
For MotionEye users:
Don't use the streaming url and camera entity, but embed url with iframe card. When the camera is out of view (either closing the app or changing tab/view) stops camera traffic. Unfortunately not possible with picture_glance to show certain entity states, but I will think of something else for that...
still happening
This might (probably?) be fixed in 2021.9
This might (probably?) be fixed in 2021.9
Great! Any pointer to the fix commit?
Im not sure yet if this is indeed fixed in 2021.9, Im only upgrading now, but I need an emergency workaround in case this isnt fixed or happens again in the future; today I blew through my monthly datacap and incurred a 50 euro data charge in an hour, and I hadnt even turned on my phone's screen. I need something to restrict companion's data usage. I disabled "background data" but that doesnt seem to help.
I can presumably totally block it with an android firewall, but then I might as well just uninstall it.
Im trying to make a node red flow that monitors the app_rx_gb sensor and correlates it with being on mobile data, but somewhat ironically, that sensor doesnt seem to update in the background, unless something else changes (like my location or alarm clock?) And even if it did, Im not sure what I can do to stop the data, other then send myself a notification. Which Ill probably read too late.
All known workarounds are mentioned in this issue
2019.9 doesnt fix it for me. Checked HA on my phone this morning for 5 seconds, closed the app and phone and and 30 minutes later it has used 1.5GB and keeps going up.
When I said workaround, I mean some emergency / brute force "solution", something that works independently of the companion app. An android app or setting of some kind to limit the impact this issue can have or just deny it access to mobile data at all. In android settings I disabled mobile background data usage:
but it seems to think HA doesnt run in the background? In the app it says it has background access:
How do I revoke that?
I need something other than uninstalling HA companion (a ton of automations depend on its sensors), and right now all I have is turning off mobile data on my phone whenever I leave the house.
2019.9 doesnt fix it for me. Checked HA on my phone this morning for 5 seconds, closed the app and phone and and 30 minutes later it has used 1.5GB and keeps going up.
When I said workaround, I mean some emergency / brute force "solution", something that works independently of the companion app. An android app or setting of some kind to limit the impact this issue can have or just deny it access to mobile data at all. In android settings I disabled mobile background data usage:
but it seems to think HA doesnt run in the background? In the app it says it has background access:
How do I revoke that?
I need something other than uninstalling HA companion (a ton of automations depend on its sensors), and right now all I have is turning off mobile data on my phone whenever I leave the house.
Well... couple things.... Android Settings > apps > home assistant > Battery > Allow background Activity Android Settings > apps > home assistant > Battery > Optimize battery usage BUT... disabling these options will mess with the sensors you NEED working. IF you want to reset all permissions,... you could always delete/re-install app... not sure if it would create duplicate phone/sensors in HA... have not tried. but AGAIN.... these background permissions are needed for your phone sensors...
Im in the same boat. So i removed the camera page from home assistant. I use blue iris to check them instead.
But here are a couple things that were helping me before i removed them. it fixed the problem for me, but others in my home could not follow these 2 simple rules..... so i eventually removed the page for those users..
i really dont understand why fixing this is so hard.... if app not in foreground, then close video streams
- press BACK BACK BACK BACK BACK ect.... until you see the home screen. or 2. press RECENT APPS button and swipe the app away
This doesnt help. I force closed HA and it would still gobble up bandwidth "in the background". Im no developer, but I dont understand the problem either. The companion app should be 2 parts; one for the front end (basically a browser), one for the sensors/communication. Only the latter should be allowed to run in the background. I wouldnt even mind if companion only did the latter; provide sensor data, something for instructions (and via MQTT please!), while we use a browser for the dashboard. A browser we can actually close :).
Regarding Blue Iris, I did the same, relying mostly on BI web interface, and now I managed to actually integrate individual BI UI3 web streams and its web GUI in to HA. I wrote a little piece on it here: https://www.reddit.com/r/homeassistant/comments/po34pg/finally_low_latency_low_bandwidth_high_quality/
This also completely solves this particular issue, as blue iris will stop streaming when the camera frame has no focus, and/or after a configurable time. Completely independently of HA.
This isnt a good or universal solution (especially for those not using BI), but its a great workaround for me, or anyone in the same boat; and even if this bug finally gets fixed, it will be some time before I trust HA cameras with my bandwidth. 50 euro is bad enough, but if this had happened while I was traveling abroad, it could have been a very expensive lesson.
Using iframes for camera streams to work around this bug has at least problem I wasnt aware off; it stops android from entering sleep mode, which is particularly annoying on wall mounted tablets.
I worked around that, and that solution may also work -or at least help- for this bug, if you use regular picture entity cards for camera's: whenever I want the tablet to sleep, I redirect companion to a dedicated view that has no iframes (or camera's). I dont know for sure if this will stop regular camera entities from streaming in the background, but it may help and it certainly stops UI3 streams which only stream when they are in the foreground.
This behavior has an unexpected benefit for wallpanels too; instead of having to keep sending notifications (which require the cloud!) just to keep my tablets awake while im in the room or the lights are on, the iframe does that for me now. So I can pretty much turn the screen on or off with one command. Full node red flow here: https://www.reddit.com/r/homeassistant/comments/ppwln7/node_red_flow_to_allow_ha_tablets_to_enter_sleep/
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
now the camera stream picture dies if HA is open for a very long time. For example, I have a tablet hanging on the wall. I would like the stream to automatically restart
now the camera stream picture dies if HA is open for a very long time. For example, I have a tablet hanging on the wall. I would like the stream to automatically restart
Does that happen in chrome for android? I think there was some frontend websocket issues in HA core 2021.12 that were fixed in the latest point release.
this is still an issue. App on Android even in background pulling video stream all the time
yeah this did not happen to me in chrome. HASS companion app
I’m also having the issue anytime a camera entity is on the dashboard, it will eventually crash the app. The more camera entities, the fast it manifests.
I’m also having the issue anytime a camera entity is on the dashboard, it will eventually crash the app. The more camera entities, the fast it manifests.
That is actually not the same issue as this one, as far as I know the app is not crashing here because there is background data occurring and if the app crashes after a short while I dont think anyone will see GB of data like above. Once an app crashes it is no longer connected to webview. If you are seeing crashes please open a new issue and fill out the template provided with the crash log. In your case check to see if there is a Recent Crash tab when you pull hte app logs for the template. If it is there that is the log we will need.
Still an issue as of 21th of March. Huawei android phone. Latest companion app and latest HA on server. 2 camera streams on page 1.
Still an issue as of May 2024
Same issue happening to HA app running on my NSPanel Pro and absolutely trashing its RAM.
Home Assistant Android version: 2.4.1-full
Android version: 10 Phone model: Xiaomi mi 9 Home Assistant version: 0.115.3 Last working Home Assistant release (if known): no Description of problem:
When app in background, video streams from cameras does not stop stream. Almost all apps stops video stream at onPause() Android lifecycle, but HA does not. Now the problem is even more serious, because from the activities of the sensors, the system almost never kills the application. I have a lot of cameras and I wasted 70 gigabytes in a month because of this bug. Plus the battery runs out quickly. Traceback (if applicable):
Screenshot of problem:
Additional information: Solution: You should stop stream, when device goes onStop(), maybe communicate with HA server, and show video placeholder.