If you are looking for documentation around the companion applications check out the Home Assistant Companion Documentation. This will provide you with instructions on using the applications.
-
Download and install Android Studio
-
Download / clone this repository to a folder on your computer
-
Create a Firebase project at Firebase Console
-
Create four Android apps, with the following package names
io.homeassistant.companion.android
io.homeassistant.companion.android.debug
io.homeassistant.companion.android.minimal
io.homeassistant.companion.android.minimal.debug
- Now download the
google-services.json
file and put it in the project’s /app, /automotive and /wear folders. This file contains the configuration of the whole project (all four applications). (You can also use the mock services file instead of generating your own. The file should contain client IDs for all packages listed above for debugging to work properly. If you do not generate your own file, FCM push notification will never work, only websocket notifications will). - Start Android Studio, open your source code folder, and check if the Gradle build will be successful using Build/Make Module “App”. You might have to install the right Android SDK via Tools/SDK Manager first.
- Run
gradlew assembleDebug
to build all debug versions, this might take a while. - If the build is successful, you can run the app by doing the following: click Run -> Run ‘app’.
- Connect your phone or create a new virtual device following on-screen instructions.
- 🎉
If you get stuck while setting up your own environment, you can ask questions in the #devs_mobile_apps channel on Discord.
If you want to work on push notifications or use a development build with push notifications, please go to the server-side code HERE and deploy it to your Firebase project. Once you have your androidV1 URL to the deployed service, set it in to your ${GRADLE_USER_HOME}/gradle.properties
file, e.g.:
homeAssistantAndroidPushUrl=mydomain.cloudfunctions.net/androidV1
You can also define the rate limit function URL, e.g.:
homeAssistantAndroidRateLimitUrl=mydomain.cloudfunctions.net/checkRateLimits
The Android app has a full
flavor that uses Google Play Services to offer features like location tracking and notifications. There is also a minimal
flavor that does not require Google Play Services and can be found in the releases section. The minimal flavor does not have location tracking or notifications.
To build the app for publishing, you will need to sign the app. To do this, do the following:
- Create a keystore containing a keypair for debug application signing. In Android Studio: Menu/Build/Generate signed APK, then use a button to create a new keystore. Remember the passwords and the key alias. Default, the keystore must be named
release_keystore.keystore
and should be placed in the home-assistant-Android/app and home-assistant-Android/wear folder. - Set environmental variables used in
app/build.gradle.kts
:
KEYSTORE_PASSWORD
KEYSTORE_ALIAS
KEYSTORE_ALIAS_PASSWORD
KEYSTORE_PATH
(if your keystore is located differently than stated above)
- Run
gradlew build
- The signed APK is located in your build folder
We are using Github Actions to perform continuous integration both by unit testing, deploying dev releases to Play Store Beta and final releases to the Play Store when we release. To help test out a specific feature/fixes users can find the APK on the Actions page for each pull request, this debug APK can be installed side-by-side with the production or beta builds.
We are using ktlint as our linter. You can run a check locally on your machine with:
./gradlew ktlintCheck
This command runs on our CI for every PR to check if it passes all tests. So we strongly recommend running it before committing.
To run a check with an auto-format:
./gradlew ktlintFormat
The project currently uses Lokalise to translate the application. If you are interested in helping translate go to the link and click start translating!
- Go to the latest Pre-release and edit it
- Uncheck the Pre-release box, check the Latest release box, and click Update release
- This should cause the
Play Publish Production
Workflow to execute and should handle the rest for Google Play - Some platforms, such as the Amazon App Store, need to be updated manually
- F-Droid uses the
version_code.txt
file of the latest release to detect a new production release and build it themselves, this may take some time
- This should cause the
What’s Changed
- Fix typo ‘archive’, replacing it with the correct ‘achieve’ by @NoRi2909 in #4861
- Bump io.sentry:sentry-android from 7.18.0 to 7.18.1 by @dependabot in #4863
- Bump androidPlugin from 8.7.2 to 8.7.3 by @dependabot in #4868
- Bump hilt from 2.52 to 2.53 by @dependabot in #4869
- Fix typo: security vulnerably -> security vulnerability by @jpelgrom in #4873
- String consistency: WiFi -> Wi-Fi by @jpelgrom in #4874
- Bump com.google.firebase:firebase-bom from 33.6.0 to 33.7.0 by @dependabot in #4884
- Handle two recent Compose deprecations by @jpelgrom in #4879
- Bump hilt from 2.53 to 2.53.1 by @dependabot in #4893
- Bump org.altbeacon:android-beacon-library from 2.20.6 to 2.20.7 by @dependabot in #4881
- Unlink saving crash stacktrace from Sentry by @jpelgrom in #4895
- Bump softprops/action-gh-release from 2.1.0 to 2.2.0 by @dependabot in #4896
- Bump com.github.AppDevNext:ChangeLog from 3.5 to 3.7.1 by @dependabot in #4901
- Bump paging from 3.3.4 to 3.3.5 by @dependabot in #4899
- Bump androidx.navigation:navigation-compose from 2.8.4 to 2.8.5 by @dependabot in #4900
- Bump io.sentry:sentry-android from 7.18.1 to 7.19.0 by @dependabot in #4903
- Bump androidx.compose:compose-bom from 2024.11.00 to 2024.12.01 by @dependabot in #4904
- Bump androidx.wear.compose:compose-material3 from 1.0.0-alpha29 to 1.0.0-alpha30 by @dependabot in #4902
- Bump androidx.wear:wear-remote-interactions from 1.0.0 to 1.1.0 by @dependabot in #4898
- Allow treating ethernet and VPN as home network/for internal URL by @jpelgrom in #4872
- Update change log week of 12/13 and re-enable health connect for approval by @dshokouhi in #4905
- Bump com.google.guava:guava from 33.3.1-android to 33.4.0-android by @dependabot in #4912
- Bump actions/setup-java from 4.5.0 to 4.6.0 by @dependabot in #4913
- Migrate from Picasso to Coil by @jpelgrom in #4911
- Bump media3 from 1.5.0 to 1.5.1 by @dependabot in #4920
- Add support for media players in device controls by @dshokouhi in #4917
- Update change log week of 12/20 and disable Health Connect by @dshokouhi in #4921
- Bump com.android.tools:desugar_jdk_libs from 2.1.3 to 2.1.4 by @dependabot in #4927
- Bump hilt from 2.53.1 to 2.54 by @dependabot in #4925
- Add more domains to device control support by @dshokouhi in #4922
- Update change log for 2024.12.5 by @dshokouhi in #4928
- Update Gradle to 8.12 by @jpelgrom in #4929
- Update text for go to first view in onStop setting by @jpelgrom in #4930
- Fix casting for Health Connect buildReadRecordsRequest result by @jpelgrom in #4931
- Bump io.sentry:sentry-android from 7.19.0 to 7.19.1 by @dependabot in #4932
- Revert ‘Bump softprops/action-gh-release from 2.1.0 to 2.2.0 (#4896)’ by @jpelgrom in #4938
- Update splash screen icon to match style/size of frontend by @jpelgrom in #4937
- Log action for external bus improv/scan command by @jpelgrom in #4942
- Update change log week of 12/27 by @dshokouhi in #4940
New Contributors
Full Changelog: 2024.12.1...2024.12.6