Home Assistant Companion Android App 2021 Q1 Releases

Hey everyone! It has been quite some time since we last provided an update on all that is new with the Android app. You may have already noticed that we had changed our release versioning to match that of Home Assistant Core. In fact, we will be attempting to align our releases more closely to Core releases. This way we can start supporting brand new features quickly, like the recently released My Home Assistant.

Security Check

As of Home Assistant Core 2021.1.5 some security vulnerabilities were fixed and it is very critical that all users update their instances to at least this version. The app will now do a check every 24 hours to ensure that the instance is at least on the release mentioned in the security alert. This check will be updated anytime a new security alert is issued.

Location Disabled Check

Certain app features that depend on the connected WiFi network (SSID), require the location permission to not only be granted to the app, but also have it enabled on the device. Without this, the app is unable to read the connected SSID, impacting usage of the Internal URL and any WiFi based sensors. Previously, the application would continue to function and silently fail while showing bad data for the sensors. Although the application still worked, certain parts were found to be buggy as a result of the silent failure.

Starting in android-2021.1, the app was showing a prompt before a user was able to interact with the Home Assistant frontend. We received feedback that users found this pop-up to be too intrusive. Starting android-2021.2, this pop-up has been converted to a persistent Android notification with its own notification channel. This allows the user to fully control how it is displayed on the device, including turning the channel off. The new channel name for this notification is Location disabled.

Screenshot of the location disabled notification.

High Accuracy Mode

High accuracy mode is a new feature in android-2021.2 to allow users to get much faster location updates at the cost of additional battery drain. Background location updates typically get reported every 30 seconds to a few minutes. This new feature allows the user to specify the update interval that defaults to every 5 seconds. When enabled, a persistent notification will be displayed containing some location data. This feature is an enhancement to the Background Location sensor and you can access it from the sensor settings screen. You can also control this feature via a new notification command to enable/disable it on the fly. You can learn more about this feature in the documentation.

Screenshot of the high accuracy mode notification.

New Sensors

We have several new sensors to welcome to the app, all of which are disabled by default:

  • Active Notifications - The total count of active notifications visible to the user. Attributes will include all notification data.

  • App Data Sensors - Sensors to determine how much data the app has used since the last device reboot.

  • App Importance Sensor - A sensor to determine if the app is in the foreground, background or any other importance level.

  • App Memory Sensor - A sensor to determine how much memory is used by the app.

  • App Usage sensors - Sensors to help users troubleshoot if the app is considered inactive and the current app standby bucket.

  • BLE Transmitter Sensor - A sensor to control whether or not the app is actively sending out a beacon to provide support for services like Room Assistant.

  • Sleep Sensors - Sensors based on a new API provided by Google for devices running the full version. These sensors can be used to determine if the user is sleeping or not. The sensors update when we get data from Google so donā€™t expect them to update as soon as you fall asleep.

Notification Enhancements

There have been several additions and improvements to notifications:

  • Controlling Bluetooth
  • Broadcast intent command has been updated to allow the user to send intent extras
  • A command to launch activities, see below for more details
  • A new command to launch the application to any dashboard or view without needing to click on anything
  • A new actionable notification type REPLY which will add a reply button to the notification and the response will be sent back in the mobile_app_notification_action event
  • A command to control whether or not the BLE transmitter sensor is enabled

Intents and Activities

We have made several enhancements to further integrate Home Assistant into the Android ecosystem. First and foremost, the Last Update Trigger sensor was updated in 2021.2 to allow users to register for any intent that they want. Intents are a way for applications to communicate with another so they can send data back and forth. In fact the app itself uses many intents provided by Android, which is why certain sensors update faster than others. This means that users can now get data from apps that have an Intent API. You will need to know the intent action string that you wish to register for. Once the intent is received the application will fire an event to Home Assistant as android.intent_received along with the intent action and any extra data provided by the intent. Personally, I am using my Mi Band 5 with the Notify for Mi Band application that sends out intents for when I have fallen asleep, my step count or even my heart rate.

A new notification command was added to allow the user to launch an activity on their android device. This command requires a new permission to be granted in order to launch activities from the background, Draw Over Other Apps. The first attempt to use this notification will take the user to the permission page so the user can grant proper access. It is important to note that if the app is not considered active then this permission page will not show up due to missing permissions. Try to test this with the app open or you can grant the permission manually in your device settings. There are lots of use cases for this feature such as being able to launch Google Maps driving mode or even setting an alarm on your device.

Unfortunately, it is not so straightforward to determine which intents and activities are supported by applications. You really need to know what to look for and there is not much in terms of documentation here from applications. Try reaching out to the developers of your favorite apps to see if they have any intents to consume. We have provided several live examples in the companion documentation. I have also started a new thread in the forums to maintain a list of all that we can find here. I will be trying to keep the first post as up to date as possible.

Other Enhancements

We have also spent time making improvements to all other areas too:

  • Support for links from My Home Assistant
  • Power menu fixes and enhancements including support for vacuum entities
  • Haptic feedback support in the frontend
  • Overriding certain URL types to launch an application or an intent from the frontend
  • 3 finger swipe down gesture to trigger the Quick Bar

3 finger swipe gesture to trigger Quick Bar

Big thank you to everyone involved. Please keep those bug reports and feature requests coming!

Changelogs


This is a companion discussion topic for the original entry at https://www.home-assistant.io/blog/2021/03/04/android-2021-q1-releases/
4 Likes

Nice! Whatā€™s the place for feature requests? With the High-accuracy mode, it would be great to be able to automatically have that turn on when within a certain distance of a zone, then have it turn back off once the zone is entered. Particularly useful when arriving home for having that detected quickly. It looks like it would be possible to do that with HA sending the right notifications to the phone, but itā€™d be nice to have that happen on the phone side. I currently use OwnTracks and Tasker to accomplish something similar, but I wouldnā€™t mind doing away with OwnTracks.

https://github.com/home-assistant/android/issues/new?assignees=&labels=enhancement&template=feature_request.md&title=

Make sure to be specific and to also break up different points if possible, donā€™t try to add more than 1 thing otherwise the request may get closed prematurely.

Try using the proximity sensor https://www.home-assistant.io/integrations/proximity/ for now.

I agree turning off high accuracy when you enter any zone does sound useful, we already get geofencing alerts and send them as events.

1 Like

I think at the very least providing the option to have high accuracy turned on when phone is charging (often the case when travelling in the car)

there is a setting for high accuracy mode to be automated based on a connected bluetooth device which would work when you are in the car :slight_smile:

3 Likes

Any plan to support Wear OS?

Iā€™m excited to try out the BLE Transmitter. It makes so much sense to build this into the main app. I particularly like the option to hopefully be able to stop/start it with an automated command. With my current BLE app, it sometimes stops transmitting once a week or so and I have to send an actionable notification to reopen the app. This way I should just be able to fix it without user interaction.

Support is planned, currently there has been some work done in the backend but nothing worthy of mentioning in the blog post. All that is really done is that the team has created a non-functional package which is basically the first baby step. I donā€™t really know how long it will take for anything to be ready for use, I donā€™t own any wear OS devices so I wouldnā€™t be contributing to this area yet.

1 Like

My imagination canā€™t keep up with all these possibilities, thanks for an awesome update!

One cool thing you can do now is sending a notification on movement in the hallway, with a picture taken by a nearby camera of course, and then in that notification have a reply button so that whatever text you enter there is then read out loud by some speaker to the person who entered. :nerd_face:

In the thread with intents, there is a link to the Waze thread, in that thread there is a link to a very cheap bluetooth receiver you can have in the car.

I just want to thank the contributors for this amazing app. The amount of sensors and possibilities is just amazing. Thank you @dshokouhi for your contributions and willingness to reply on many posts. Iā€™m loving the BLE beacon feature.

1 Like

Did anyone figure out if thereā€™s a way to set the intent category or component?

Not supported yet, the docs outline everything we currently support. Feel free to submit a feature request on GitHub

Edit: if possible give us an example of something that uses the category/component so it can be tested

I follow all the app updates super closely and somehow I still missed this. Definitely something Iā€™ll be trying out, I really wanted to use room-assistant but couldnā€™t get it to talk to my phone before. Thanks for the update!

1 Like

Great idea to enable the sensor when entering a specific zone :+1: I created a PR for that.

2 Likes

But you donā€™t want high accuracy mode when you are home.
Something needs to be a trigger for it to switch of when you get home.

Yep exactly that i tried to accomplish with the expanded zones. The expanded zone triggers on and the original zone triggers off.

1 Like

That expanded zone feature looks absolutely perfect! Thanks!

Might need to tweak the wording a bit with the settings. Based on those screenshots, there doesnā€™t appear to be any indication that when using an expanded zone, high accuracy mode turns back off within the zone itself.

Yes you are right. Tried to use a different wording for now in the app itself. Itā€™s hard to describe that setting in a one liner.
I tried to describe this feature in the docs. https://github.com/home-assistant/companion.home-assistant/pull/472