Home Assistant Companion for Android 1.6 and 1.7

Over the last week, we’ve released some awesome new features and improvements to Home Assistant Companion for Android. I wanted to take a moment to highlight some of the recent things that we introduced in 1.6 and 1.7.

Actionable notifications

Now you can define action buttons to attach to a notification dynamically. When you click one of those buttons, an event is fired back to Home Assistant so you can take action based on the button chosen.

Here’s an example to check with a user if they want to close the garage door after it has been left open for 30 minutes:

automation:
  - alias: Notify apps when garage door opens
    trigger:
      platform: state
      entity_id: cover.garage_door
      from: 'closed'
      to: 'open'
      for: ‘0:30:00’
    action:
      service: notify.mobile_app_robbies_pixel_5
      data:
        message: "The garage has been left open"
        data:
          actions:
            - action: "close_garage" # The key you are sending for the event
              title: "Close Garage Door" # The button title
  - alias: Close the garage when notification action is tapped
    trigger:
      platform: event
      event_type: mobile_app_notification_action
      event_data:
        action: close_garage
    action:
      service: cover.close_cover
      entity_id: cover.garage_door

After adding these automations, whenever your garage door remains open for 30 minutes, your device will get a notification that looks like this:

![](upload://ajEdPIR5lCTdXGZ4BhGLwuDVzhR.png)

When you press that close garage button… your garage will close!

We are planning to expand notifications over the next few versions to continue to match the existing functionality available in the iOS app. That includes things like sending text back to Home Assistant and critical alerts.

Requesting location updates via notification

You can now send a notification with just the message request_location_update and once it reachces your device it will update its current location in Home Assistant. Be careful using this too much though, as it can drain your battery.

Sensors

New in version 1.7, we have added the first sensors to the app. For now, you will find the following new sensors:

  • Battery percentage
  • Battery state
  • Current WiFi network information

We plan to keep expanding sensors in the near future to add things like cellular status and more.

Docs

Thanks to a few dedicated volunteers and a mad dash, we have a newly refreshed docs website. It’s using the latest version of Docusaurus which means it’s got a new coat of paint and even dark mode support. So much easier on the eyes!

In addition to the tooling updates, we’ve also begun documenting Android and iOS differences. Keep an eye out for the Android and Apple logos to denote what works where.

Over time we plan to bring Android and iOS as close together in terms of features and the ways they interact with Home Assistant so that, as much as possible, those that have users of both platforms have to do as little work.

Finale

In addition to the highlights above, we’ve also killed an impressive amount of bugs. Thanks goes to JBassett, KBerstene, quthla and neopilou for their work on all of the above.


This is a companion discussion topic for the original entry at https://www.home-assistant.io/blog/2020/02/11/android-16-17-release/
8 Likes

Great example, although i dont see the image in the automation code?

With the 1.7 app on my android phone, I get the notification but it contains not actionable buttons …

thank you for all your hard work

I’ve had to do this the last few releases. Try logging out and back in through the profile page in the app and restart HA.

Also these updates have been awesome!

Awesome !!! Thank a lot for this app, always light with more and more features !
Proposal feature : add a sensor with set alarm clock to lauch an action when I wake up. :wink:

Very nice!

I have a concern about the sensor.battery_level and sensor.wifi_connection. When I have more than 1 android phone running the app, what happens?

1 Like

To add an image do it in this format:

message: "Alert"
title: "test"
data:
  actions:
    - action: "TEST"
      title: "click me"
  image: "https://i.pinimg.com/originals/0f/7b/fa/0f7bfa4e6775b5977694a6036fc85b48.png"

Works for me like this.

It gets the _2, _3,… suffixes as usual.

1 Like

ok, thnx for feedback

is the message priority also imporved? i already have disabled battery optimalization
but when phone is in deep sleep, i only receive message a few minutes later, not instant
so for a doorbell system, its not suitable

Don’t know to be honest.

Has the app always acted like this, or is it a recent development?

always acted like that, same behaviour as html5 notifications
so still using pushover for notifications :frowning:

What device do you have? Does it run a stock ROM or something else?

yes, stock rom, a Oneplus 6T

Very weird. One of the developers working on the app also has a OP6T and hasn’t experienced any delays…

verry easy to reproduce here :slight_smile:
whats also funny, if i know a notification should come, and it doesnt when it sleeps
if i then send a pushover message, at that point also the other notification from the ha client comes trough at the same time

Can you set TTL to 0 and priority to high in your notifications and see if that changes anything? For example:

title: 'Title Text'
message: 'Body Text'
data:
  ttl: 0
  priority: 'high'

ok, will try that next time

This is insane guys! Thanks for this, no more panic 30 seconds trying to disarm the alarm