Home Assistant Companion Android App Release 2.4.0

Hey there, I hope everyone has been enjoying the last release of the Android app. We have another update coming up where we felt its time to give everyone a heads up before release. There are several new changes done that you will immediately notice after installing the update to 2.4.0, so we wanted to cover what’s new. You can expect this release to be available in the Google Play Store tomorrow.

Current and Future Breaking Changes

Sometimes when we move really fast, we may move a bit too fast. While we had fun adding all the new sensors, we didn’t stop to think about the new user experience and how we are making a burden on them by having non-static attributes for some of the sensors. In reality, these attributes are a state and we need to treat them as such. If we don’t, there will be a need to use templates that are not user-friendly. We wanted to fix this issue and be courteous to our current users, so we have made a few changes. Some of which take place in this release and some in the following release after 2.4.0.

The first major change in this release is that the app will no longer send needless updates to your Home Assistant server when there is nothing new to report state-wise. This helps cut down on the amount of data that gets sent out. Some attributes attached to some sensors update outside of the state, to combat this change, we have split those attributes to become their own sensor. For example, the audio sensor had an attribute to tell if headphones were currently plugged into the device. This, by itself, is a state change and thus now a binary sensor.

We have opted to keep the existing attributes where they are for this release, this way they do not break existing templates. However, they may trigger slower until you move to the new sensor. All of the new sensors are also disabled by default (with the exception of battery), so you may want to enable the ones you care for. The following sensors have had their attributes split up:

  • Audio Sensor - All attributes. The sensor name for new users is changed to Ringer Mode to better align with what the state represents.
  • Battery State Sensor - All attributes.
  • Bluetooth Connection - Only is_bt_on now has its own binary sensor. The other attributes update with the state.
  • Storage Sensor - External storage attributes. The new sensor will behave the same as the current storage sensor, which is now labeled as Internal Storage.
  • WiFi Connection - All attributes with the exception of is_hidden.

These attributes mentioned above will be removed in the next release. Please make your switch to the new sensors now to avoid the breaking change then.

Attributes have also had a slight breaking change as we are now sending the correct data type for the attribute. Previously they were all sent as a string, which meant binary values needed to be wrapped in quotes.

The Geocoded location sensor also had its attribute of Location split into the attributes they reflect as latitude and longitude.

Foreground Service Worker

We have seen issues where some of the sensors do not update reliably; There were times when the sensor worker could not run. We have gone ahead and converted this to become a foreground service, which means from time to time, you will see a low priority notification when the sensors are updating. This low priority notification does not make a sound and just appears briefly in the status bar. We felt this to be a good compromise instead of having to use a persistent notification.

If you are on Android Oreo or later you can minimize or turn off the channel completely. Please keep in mind that doing that, may affect the update reliability. Google’s recommendation was to make it low priority and if you have seen recent updates to the Google Phone and Calendar apps you have already seen this described behavior.

Screenshot of the Foreground Service.

New Sensors

We have new sensors added this time around. All of the below sensors are disabled by default:

  • Doze mode - Android 6.0+ only, a binary sensor to represent the state of doze mode.

Screenshot of Doze Mode.

  • Interactive - A binary sensor that represents whether or not the device is being interacted with.
  • Power Save mode - A binary sensor that turns on when the device reports it’s in power-saving mode. Most manufacturers allow this to be user-configurable on the device.
  • Public IP - A sensor that shows the public IP address of the device.

Other Changes

We have also spent time making improvements in other areas of the application:

  • Several more location improvements have been made.
  • Sensors are hidden on devices that do not have them.
  • General improvements to the app architecture to help developers understand the flow.
  • More localization improvements.
  • General improvements to the settings screen.

Special thanks to JBassett, chriss158, anyuta1166 and skynetua for all of your contributions. So keep them bug reports and feature requests coming, we’ll chat again next time!


This is a companion discussion topic for the original entry at https://www.home-assistant.io/blog/2020/09/12/android-240-release/
13 Likes

Thanks for the heads up and for the dev effort.

1 Like

Nice work guys. Thanks

Could you please disablevthi this notifications ‘updating sensors’? I have my Phone connetec to smart watch and keep getting this annoying notifications…

Did you even read the blog post? It’s explained in the section Foreground Service Worker that you can turn it off by disabling the channel.

2 Likes

Hello.
I’m still facing of duplicated device :

Everything is up-to-date.

try these steps: https://companion.home-assistant.io/docs/troubleshooting/faqs/#starting-fresh-with-the-android-app

make sure to delete all integrations for your device if more than one exists

You can if you have android oreo or later. And what about if not? And yes I have read it

I seem to somehow have gotten in a catch-22: when i install the app and log in, it says “Unable to register … ensure you have the mobile_app integration enabled”, but when i add the mobile_app in HA, it says “Aborted - Open the mobile app to set up the integration with Home Assistant. See the docs for a list of compatible apps.”… I’ve already tried rebooting both HA as well as my phone.

I’m sorry, your post totally sounded like you didn’t even take your time to read the blog. Maybe for the next time ask a bit more specific like “how can I disable foreground notifications in android version lower than oreo?”.
From my limited knowledge about Android I think below android 8, there’s no way to easily hide these. I think they need to program some kind of fake service to enable the users to disable the notifications. I think this blogpost explains it fairly well.

Make sure you either have mobile_apps:or default_config: in your configuration.yaml.

Your smart watch app might/should be able to provide more granular control.

Devs, I love the app and keeping the attributes for one release is a great compromise!

Maybe watch is a big Word cause it is Just mi band 4. Ans as far as I know there is only option to show notifications from app or not

Unfortunately for you Android has made major improvements to how notifications are handled (I updated to a new phone this week from Android 7 to 11, huge difference!), so you may be suffering on account of that.

An app like tasker might allow you to mute those. Powerful but complicated.

Is there an install link somewhere in the site, if not I’d recommend adding one since anyone can put the word official in their app description

Its located in a few places but not on the HA homepage, we can add it to the post but there is a link to github found at the bottom that also links to the play store




Its too bad they don’t allow you to filter by the priority of the notification if they cannot do so using notification channels.

I just looked at my entities and it’s quite messy now with two sets of entities.

I can’t say I have remembered exactly what all they all were called, any chance there is a translation table what entity was renamed to what and how it behaves different now?

Because if we only have until next release to fix our stuff then it would be nice if we knew what to look for exactly and what to do with it.

All the sensors you used before remained the same, no changes there. Only new entities were created from the attributes in this release. Under App Configuration look at Manage Sensors to see what is what.

1 Like

Already tried that but no success.
I thinks it’s because I often flash my phone with weekly update.