Android Companion 2022.2: Local Push Notifications!

Will this also work for Fire OS devices (where no Google services and no Firebase Messaging service is available)?

Can you create a feature request for this on GitHub so it doesn’t get lost in the comments?

Yup it works!

2 Likes

Thanks! First time filing: https://github.com/home-assistant/android/issues/2273 (filed with my current understanding of the issue).

I like the idea of the websockets. So far positive experience but I am seeing quite a different battery drain on 2 Google Pixels. Typically HA companion takes around 2-3%. On my wife’s phone (never even opened the app) its using around 7-8%. Just fyi for people.

Hi all,

could someone please tell me, what the benefit of this change is?

Just what I’ve gotten so far:

  1. if I choose ‘do not listen’ I won’t be notified at all, once my washing machine is done.
  2. if I use ‘only when the screen is turned on’, I need to be lucky, that I’m just checking my phone and the screen is on, when the machine is ready
  3. if I let it listen constantly, I need to be lucky that the battery did not die before the washing machine is ready

Is that correct? Is there a way (configuration) to use the old way? I mean, sometimes I’ve gotten the message a couple of minutes after the machine was ready, but at least it popped up.
Did someone run some tests to quantify the battery drain just to have some facts and to make a development decision?

Thank you,
Fridolin

What I understood is if you turn it off, it defaults back to normal FCM and pre-change connections. The alerting really then depends on Google’s FCM which can be delayed (like it was previously). websockets should be much faster. I turned mine off and I do indeed still see notifications and if I check notification history, I still get FCM tagged notifications.

Turning it off appears to correctly revert to the old way. Turning it on means much faster notifications and no google intermediate.

I am running some tests on my wife’s phone to quantify the change between off and always. She doesn’t use HA much so its a better test than my phone. She is also much more ‘consistent’ in her usage. My immediate reaction is that it uses more battery but might be knee-jerk reaction at this point. I’ll see.

2 Likes

Yup this is correct, FCM is the fallback so even if the app cannot make the persistent connection you can still expect to see FCM show up.

Has she had to change her charging habits due to the change? Once the first beta was live I went on my wifes phone and set the option to Always. I have not noticed her charging her phone more than she usually does and she hasn’t noticed a change either and she usually tells me when it drains like crazy.

The thing with battery life is that if you watch it all the time religiously then I think any user will say the app is draining battery. What it really comes down to is charging habits for those who don’t monitor it so closely. Now thats not to say this new feature won’t drain more battery because it would be silly for anyone to say that it doesn’t. Thats why charging habits are a better indication.

I get that back in the day with android battery life was a huge thing but a lot of changes were done to android since then and honestly battery life hasn’t been much of an issue since Android 8 or 9 which have been out for quite some time now.

For everyone else reading…

We have made a change in a hot fix that was released to Google yesterday as 2022.2.1. This change switches back to the default setting for Play Store installations to “Never”. If you already changed this setting the default change will not impact you. We also made some adjustments to the text of the settings page to make it more understandable. I hope this helps lessen some confusion around this new feature.

4 Likes

I’m noticing what seems to be a UI bug in the settings on my Samsung S20 FE 5G phone on Android 12. I cannot scroll from the page in the attached picture. Anyone else see this issue?

Edit: to clarify, that’s as far as I can scroll down

1 Like

I agree it is very difficult. Especially that the android screens will show ‘percent of usage’ which isn’t very useful. I noticed my battery dropped a lot but that can be placebo and maybe I was just using/checking it more. It is a very difficult thing to measure. I’ll be monitoring her usage and see. I can do some calculations on charging wth websockets on/off using the integration itself. Should give me a rough idea.

I’m not telling her anything so as not to introduce a placebo effect for her. She’s fairly consistent in her usage.

EDIT: I actually have an unused pixel that I am going to test with and without websockets. discharge time with zero activity, discharge time with screen on and home assistant active in foreground.

I should be able to add all the notifications I receive and let it just go for a number of cycles.

@calisro Thanks for answering my questions. I’ve switched it to off and got a message a couple of minutes later. So yes, the default fallback is working.
Let’s see what your battery test will show - maybe it makes sense to turn it back on :wink:

Thanks.

Anyone have an estimate on the usual delay for when f-droid ships the new version?

we do not maintain the fdroid app, you’ll want to ask them

1 Like

since they all have the same keys, you can just install the apk…

2 Likes

Thanks @calisro for the detailed clarification.

Has something changed in this version (2022.2) how the step_sensor works? Allthough i walk the same distances, numbers have dropped from 10000 to 40 steps. I use the minimal version b.t.w. Anyone else noticed the same?


SOLVED: The sollution was to give the app permission to the data.

1 Like

I discovered a strange thing:

  1. Updated the app
  2. Updated HA to 2022.2.6

Here in the log I found a message telling me the „notify.mobile_app_devicename“ service could not be created.
In fact: yes, it’s not there anymore.

As it is the only Android device updated to latest HA Companion app v 2022.2 so far: coincidence? Will I need to re-add the device (remove app integration, add and configure aaaaall that stuff once again)?

With this change regarding notifications, is there anything else in the companion app that is dependent on external services? Meaning that if whole nabu-casa/homeassistant infrastructure is down, will the companion app still work? (I don’t use home assistant cloud just to clarify)

I dont have that issue. Just fyi.

The notifications aren’t dependent on Nabu. The app only opens connections to HA. Is there a reason you think there are dependencies to Nabu? By ‘external’ in the notifications, The context here is that it is dependent on being able to connect to your HA instance from the internet. In FCM (the fallback and prior method) it leverages google servers for notifications via FCM which is still doable if the HA is not reachable.

In retrospect I may have used better wording in my question, so I will clarify now. I was just curious whether companion app is dependent in any way of official HA insfrastructure being up or down, not only notifications-wise. I know notifications are now standalone and, thanks to your reply, previous mechanism was also HA-independent, so thats great. I was just wondering how failure-proof is the app.

1 Like