Huge data use on Android Companion App

What happens if you use a template widget using the default text? Look at the logcat logs to prove your point if you think its making excessive calls as we will see that there. I have plenty of template widgets and none of them cause excessive data usage.

This is what I am seeing. I use a caddy reverse proxy and can see all the requests coming on. I ran this to grab my log data for this IP only of this android device while I clicked refresh on the ‘default template widget’ with the text “Enter Template Here”.


GET|500|<redacted>/api/media_player_proxy/media_player.living_room_shield?token=<REDACT>&cache=1616973193.72407|<IP>|NULL:|Mozilla/5.0 |3.291252223|0
POST|200|<redacted>/api/webhook/<redact>|<IP>|NULL:|okhttp/4.9.0|null|null
POST|200|<redacted>/api/webhook/<redact>|<IP>|NULL:|okhttp/4.9.0|0.620719388|35
GET|200|<redacted>/api/media_player_proxy/media_player.loft_shield?token=<REDACT>&cache=1616973203.599966|<IP>|NULL:|Mozilla/5.0 |null|null
GET|200|<redacted>/api/media_player_proxy/media_player.loft_shield?token=<REDACT>&cache=1616973203.599966|<IP>|NULL:|Mozilla/5.0 |3.080549226|37552
GET|500|<redacted>/api/media_player_proxy/media_player.living_room_shield?token=<REDACT>&cache=1616973206.996367|<IP>|NULL:|Mozilla/5.0 |null|null
GET|500|<redacted>/api/media_player_proxy/media_player.living_room_shield?token=<REDACT>&cache=1616973206.996367|<IP>|NULL:|Mozilla/5.0 |3.096843984|0
GET|500|<redacted>/api/media_player_proxy/media_player.living_room_shield?token=<REDACT>&cache=1616973213.56957|<IP>|NULL:|Mozilla/5.0 |null|null
GET|500|<redacted>/api/media_player_proxy/media_player.living_room_shield?token=<REDACT>&cache=1616973213.56957|<IP>|NULL:|Mozilla/5.0 |3.270496221|0
GET|500|<redacted>/api/media_player_proxy/media_player.loft_shield?token=<REDACT>&cache=1616973213.507984|<IP>|NULL:|Mozilla/5.0 |null|null
GET|500|<redacted>/api/media_player_proxy/media_player.loft_shield?token=<REDACT>&cache=1616973213.507984|<IP>|NULL:|Mozilla/5.0 |3.356048396|0
GET|500|<redacted>/api/media_player_proxy/media_player.living_room_shield?token=<REDACT>&cache=1616973223.557617|<IP>|NULL:|Mozilla/5.0 |null|null
GET|500|<redacted>/api/media_player_proxy/media_player.living_room_shield?token=<REDACT>&cache=1616973223.557617|<IP>|NULL:|Mozilla/5.0 |3.221655619|0
GET|200|<redacted>/api/media_player_proxy/media_player.loft_shield?token=<REDACT>&cache=1616973223.654615|<IP>|NULL:|Mozilla/5.0 |null|null
GET|200|<redacted>/api/media_player_proxy/media_player.loft_shield?token=<REDACT>&cache=1616973223.654615|<IP>|NULL:|Mozilla/5.0 |3.264383023|37552
POST|200|<redacted>/api/webhook/<redact>|<IP>|NULL:|okhttp/4.9.0|null|null
POST|200|<redacted>/api/webhook/<redact>|<IP>|NULL:|okhttp/4.9.0|0.061085367|35
GET|200|<redacted>/api/media_player_proxy/media_player.living_room_shield?token=<REDACT>&cache=1616973223.557617|<IP>|NULL:|Mozilla/5.0 |null|null
GET|200|<redacted>/api/media_player_proxy/media_player.living_room_shield?token=<REDACT>&cache=1616973223.557617|<IP>|NULL:|Mozilla/5.0 |6.676288868|3210247
GET|200|<redacted>/api/media_player_proxy/media_player.loft_shield?token=<REDACT>&cache=1616973233.621011|

Its interesting that each template refresh is somehow triggering a refresh of those media devices as well. The paste above is consistent for each refresh. (Its also interesting that I’m getting HTTP-500 errors but that is a different issue that I guess I need to track down but is likely increasing the data consumption in general).

Would it be expected for the media devices to be refreshing on template refreshes when those templates have nothing to do with media? I’ve not opened the app or anything else. I’m simply clicking the widget to refresh the default widget.

EDIT: BTW. If I remove the media players from my lovelace dashboard and perform the same procedure, I dont see the entries on the logs

do you have media player widgets as well?

the template widget only makes one call to HA so if your seeing anything else its not from the HA app https://github.com/home-assistant/android/blob/42ed8928dd1fb3e41566d6a3d25214e5f382e8ca/app/src/main/java/io/homeassistant/companion/android/widgets/template/TemplateWidget.kt#L127

one thing we do is update all widgets at the same time when we can just to make things easier but it wont be 7mb of data as its only text.

in HA if you enable debug logging for mobile app you will see all the calls being made homeassistant.components.mobile_app: debug too

1 Like

No. The only widgets I have are toggles for garage doors and locks. They call basic scripts or scenes nothing which uses a media player. I only added those yesterday and haven’t done much with the players.

I’ll look a little more tomorrow but it is very consistent that a widget refresh was triggering those media player entries until I removed them from lovelace. Remember too that background data for that app is completely disabled. While the widget may only be making an explicit post, it does go through the app to do it and when it does, it seems to be making those other implict calls as well.

This doesn’t mean that it triggers the apps webview activity, it only triggers the template widget call that I had showed you because thats how widgets work, they hit their own code and thats it. Based on the weirdness have you tried clearing data to see if that solves your issue?

1 Like

Okay I did make a bit of a leap there. You’re right. I just tailed the logs without doing anything on the phone for a period of time. Even with background data disabled, android somehow is letting these calls through which I don’t understand but not a topic for this forum really.

GET|200|REDACT/api/media_player_proxy/media_player.living_room_shield?token=REDACT&cache=1616977797.331759|REDACT|NULL:|Mozilla/5.0 |26.739351498|9764094

Sure enough that call is a png of 9 Megs (a screenshot of the nvidia screen)! So it isn’t the widget refresh… which makes me happy. I’m going to remove those from lovelace since I never really want that amount of data pulled down on a mobile. Is this a manifest of the same bug then that has been discussed above(cameras added to lovelace)?

unfortunately yes

1 Like