Unlocking the Power of the Home Assistant Companion App: Beyond Basic Control

0
0
  • #home_assistant
  • #mobile_app
  • #automation
  • #presence_detection
  • #sensors
5m read

While Home Assistant gives you incredible control over your smart devices, the Home Assistant Companion app for iOS and Android elevates this experience by tightly integrating your mobile device into the ecosystem. It's far more than just a remote control interface; your smartphone becomes a sensor hub, a notification receiver with actionable buttons, and a key component for advanced presence detection.

Getting Started: Installation and Basic Setup

If you haven't already, the first step is to install the Home Assistant Companion app from your device's app store (Google Play Store for Android, Apple App Store for iOS). Once installed, launching the app will guide you through the initial connection process:

  1. Ensure your mobile device is connected to the same network as your Home Assistant instance (at least for the initial setup).
  2. The app should automatically discover your Home Assistant instance. If not, you can manually enter its local IP address or Nabu Casa Cloud URL.
  3. Log in using your Home Assistant username and password.
  4. The app will then ask for permissions, primarily related to location, notifications, and background activity. Granting these is crucial for unlocking the app's full potential.
  5. Finally, you'll register the device with Home Assistant, giving it a unique name (e.g., "John's iPhone", "Living Room Tablet").

Once connected, you'll see your familiar Lovelace dashboard, allowing you to control devices and view states just like the web interface. But the real magic happens behind the scenes.

Advanced Presence Detection: Knowing Who's Home

Basic device tracking might tell you if a phone is connected to the network, but the Companion app provides much more granular and reliable presence data. By leveraging the phone's GPS, Wi-Fi state, and accelerometer, it can significantly improve accuracy.

Utilizing Zones

Define zones in Home Assistant (e.g., 'Home', 'Work', 'Gym'). The Companion app reports when your device enters or leaves these zones. This is foundational for automations like:

  • Turning off lights and arming the alarm when the last person leaves the 'Home' zone.
  • Turning on the heating/cooling when the first person enters the 'Home' zone.
  • Sending a notification when a family member arrives at a specific location (like school).

Tip: For reliable zone-based presence, ensure the app has 'Always Allow' location permission (on iOS) or equivalent background location access (on Android). Configure the app's location settings to use high accuracy and background updates.

Combining Wi-Fi and GPS

For the 'Home' zone, combining GPS with Wi-Fi state (connected to home SSID) provides robustness. You can create a Template Binary Sensor in Home Assistant that is 'on' only when *both* the GPS indicates you are in the Home zone *and* the phone is connected to your home Wi-Fi. This prevents false 'away' states if GPS briefly drifts or false 'home' states if Wi-Fi disconnects temporarily.

Harnessing Companion App Sensors

The app exposes a wealth of sensor data from your phone directly to Home Assistant. These appear as entities associated with your mobile device. The exact list varies slightly between iOS and Android, but common examples include:

  • Battery Sensors: State (charging/discharging), level (percentage). Automate reminders to plug in or trigger actions when battery is low.
  • Connectivity Sensors: Wi-Fi state, SSID, cellular state, connection type. Useful for the combined presence detection strategy mentioned above or tracking network issues.
  • Activity Sensors: Detecting if the device is still, walking, running, cycling, in a vehicle. Great for advanced presence or activity-based automations (e.g., dimming lights when you're detected as 'still' late at night).
  • Step Counter: Track daily steps and integrate into dashboard cards or automations.
  • Light Sensor: Use the phone's ambient light sensor (if available) to trigger lighting changes.
  • Headphone/Audio State: Detect if headphones are plugged in or music is playing.
  • Notification Count: On Android, track the number of active notifications.
  • Next Alarm: On Android, know when the user's next alarm is set, useful for morning routines.

You can enable or disable specific sensors within the app's settings to manage privacy and battery usage.

Using Sensor Data in Automations

These sensors open up a world of automation possibilities. For example:

!$0$!

Actionable Notifications

One of the most powerful features is the ability to send notifications to your phone that include actionable buttons. These buttons can trigger Home Assistant services or events directly from the notification banner, without needing to open the app.

Creating Actionable Notifications

You define actions within the !$1$! payload of a !$2$! service call:

!$3$!

You then create an automation or script in Home Assistant that is triggered by the !$4$! event, specifying the !$5$! string you defined:

!$6$!

Widgets and Shortcuts

Both iOS and Android apps support adding widgets to your home screen or today view for quick control of entities without opening the full app. You can configure which entities (lights, switches, scenes, etc.) appear in these widgets for instant access.

Android also supports 'shortcuts' that can be pinned directly to the home screen, providing single-tap access to trigger an action or navigate to a specific view.

Best Practices for Reliability

  • Enable Background Activity: Ensure the app is allowed to run in the background and use battery (within reason) to maintain connection and sensor updates. Check your phone's battery optimization settings.
  • Location Permissions: Grant 'Always Allow' (iOS) or appropriate background permissions (Android) for reliable presence detection.
  • Disable Battery Optimizations: On Android, exclude the Home Assistant app from battery optimization to prevent the OS from killing its background process.
  • Test Notifications: Regularly send test notifications from the Home Assistant Services developer tool (`notify.mobile_app_`) to ensure they are arriving promptly. Check your phone's notification settings for the app.
  • Review Sensor Usage: Only enable sensors you actively use to minimize battery drain and reduce the load on Home Assistant.
  • Keep App Updated: Install app updates promptly as they often contain bug fixes and performance improvements related to sensor reporting and connectivity.

Troubleshooting Common Issues

  • Presence Issues: Verify location permissions, background refresh settings, and battery optimizations. Check Home Assistant logs for sensor update errors. Ensure your Home Assistant instance is accessible from your phone's network (local or external via Nabu Casa/DuckDNS).
  • Notifications Not Arriving: Check phone's notification settings for the app, including Do Not Disturb or focus modes. Verify the service call syntax in Home Assistant developer tools. Ensure the app is running in the background.
  • Battery Drain: Review enabled sensors, background activity settings, and location update frequency within the app settings.
  • App Not Connecting: Ensure Home Assistant is running, accessible via the configured URL/IP, and that firewall rules aren't blocking the connection. Try logging out and back in within the app.

Conclusion

The Home Assistant Companion app is a cornerstone of a reliable and responsive smart home. By leveraging its rich sensor data, advanced presence capabilities, and actionable notifications, you can create truly intelligent and context-aware automations that react not just to your devices, but to your activities and location. Investing time in configuring the app properly unlocks a new level of integration between your personal mobile device and your Home Assistant ecosystem.

Written by:

NGC 224

Author bio:

There are no comments yet
loading...