There is an official Home Assistant app for Android, and I’ve been trying it out.
It’s been available for a while, but I hadn’t felt the need to use it. The web interface is fine on a phone, and you can use the “Add to home screen” feature in your browser to have the site behave like a native app. It’s all you need if you just want to interact with the web interface.
So why use the native app? There are two main reasons that I can see. Firstly, it gives Home Assistant access to information from your phone including location and other sensor data. Secondly, it gives you a reliable way of getting push notifications on your phone if you want to generate alerts from your Home Assistant automations.
Those things can be done with other tools. I use Pushover for notifications and Owntracks for location tracking. Tasker can do the job of sending other sensor data into Home Assistant. Can the app replace those tools? There’s a lot to cover, so I’m going to break it down into multiple posts covering location tracking, notifications and other automations.
I’ll start with other automations as that’s where the app has opened up new options for me.
The app can send information about your phone back to your Home Assistant instance where it appears in the form of sensors. These can then be used within your automations. There are a lot of sensors and they can each be toggled on or off independently in the app, which is great.
And when I say a lot of sensors, I mean a lot:
Having them all switched on increases the number of times the app will report data, which has an impact on battery life. I’ve started by switching most of them on to see what I get, and then I’ll gradually switch off those that I don’t think are useful.
I’ve already found a couple of use cases. For example, I don’t like to leave my phone on charge once it’s fully charged. In fact, following what is (apparently) best practice for health of lithium batteries, I try to remember to take my phone off the charger before it reaches 100% charged.
The app can report the current charge and whether it’s currently charging, so I’ve set up a notification to remind me to take the phone off of the charger once it reaches 85%. Since I wear a smart watch, I get the alert even if I’m away from the phone.
Configuring through the UI, my automation starts with the trigger of the battery level going over 85%:
The condition uses the phone state so that the automation runs only if the phone is charging:
And the action then sends a notification:
I could use a smart plug socket and turn it off when the phone is charged, but I don’t always use the same charger so it’s simpler to get the notification.
The sensor doesn’t update continuously, so the phone will have reached more than 85% when the notification is sent but it’s good enough for my purposes and I could always lower the threshold if I needed to. It’s usually around 90% by the time I get the notification.
One of the other sensors can report when the phone is ringing or you’re in a call, reporting a state of “idle” “ringing”, or “offhook”.
I’ve set up an automation to turn the bedroom light on if the phone rings overnight and I’m at home, increasing the chances of the call actually waking me up. Obviously that’s only useful if getting calls overnight is rare and likely to be an emergency – the sensor can only tell if the phone is ringing or in a call and not the caller’s number.
You could also use the call functionality to mute media players when the phone rings or to trigger an automation if you miss a call.
Another sensor reports time of the next alarm set on your phone, so if you use your phone as an alarm clock you can trigger automations to run at the same time, or to gradually turn the light on just before your alarm is due to go off.
The app can also report connected Bluetooth devices. I use Bluetooth in the car, so I could use that as the basis for automations triggered when I’m driving. I could also use the activity sensor, which reports states such as “in vehicle” and “walking”, but the Bluetooth option not only tells me that I’m in a vehicle, but that I’m in my vehicle.
Coupled with location zones, it could, for example, give me a reliable way of determining that I’m leaving work and, since I’m in the car, I must be on my way home rather than just going for a lunchtime walk. Of course that’s less relevant now, as I’m working from home, but it’s definitely something that could be useful in the future.
It’s worth noting that the automations can’t make changes on the phone itself – the app is simply reporting phone state to your Home Assistant instance. You’ll need to use a tool such as Tasker If you want automations that can also manage the phone state, such as setting it to silent.
You could also use Tasker to send the same information to Home Assistant, but the advantage of the Home Assistant app is simplicity – you don’t need to worry about setting up access tokens, webhooks or sensors to receive the data. All you need to do is log on and choose the stats that you want to report.
Overall then, the app brings in some useful extra sensors that aren’t essential but are nice to have and open up some automation options. Coupled with location tracking and notifications, the app could be a great one stop shop for home assistant on your phone – if those features are up to scratch. In the next post I’ll be looking at location tracking and comparing it to Owntracks, which is my current tool of choice.in Mobile