• Stars
    star
    2,296
  • Rank 20,053 (Top 0.4 %)
  • Language
    Kotlin
  • License
    Apache License 2.0
  • Created over 5 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

📱 Home Assistant Companion for Android

📱 Home Assistant Companion for Android Beta Deploy

Documentation

If you are looking for documentation around the companion applications check out the Home Assistant Companion Documentation. This will provide you instructions on using the applications.

Setup App Development Environment

  1. Download and install Android Studio

  2. Download / clone this repository to a folder on your computer

  3. Create a Firebase project at Firebase Console

  4. Create four Android apps, with following package names

  • io.homeassistant.companion.android
  • io.homeassistant.companion.android.debug
  • io.homeassistant.companion.android.minimal
  • io.homeassistant.companion.android.minimal.debug
  1. Now download the google-services.json file and put it in the home-assistant-Android/app and home-assistant-Android/wear folder. 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)
  2. 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.
  3. Run gradlew assembleDebug to build all debug versions, this might take a while.
  4. If the build is successful, you can run the app by doing the following: click Run -> Run 'app'.
  5. Connect your phone or create a new virtual device following on screen instruction
  6. 🎉

If you get stuck while setting up your own environment, you can ask questions in the #devs_mobile_apps channel on Discord.

Push Notifications

If you want to work on push notifications or use a development build with push notifications, please go 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=https://mydomain.cloudfunctions.net/androidV1

You can also define the rate limit function URL, e.g.:

homeAssistantAndroidRateLimitUrl=https://mydomain.cloudfunctions.net/checkRateLimits

App Flavors

The Android app has both 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.

Building for publishing

To build the app for publishing, you will need to sign the app. To do this, do the following:

  1. Create keystore containing keypair for debug application signing. In Android Studio: Menu/Build/Generate signed APK, then use a button to create new keystore. Remember the passwords and 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.
  2. 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)
  1. Run gradlew build
  2. The signed APK is located in your build folder

Testing Dev Releases

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 the production or beta builds.

Quality

We are using ktlint as our linter. You can run a check locally on your machine with:

./gradlew ktlintCheck

This commands runs on our CI to check if your PR passes all tests. So we strongly recommend running it before committing.

To run a check with an auto-format:

./gradlew ktlintFormat

Translating

The project currently uses lokalise to translate the application. If you are interested in helping translate go to the link and click start translating!

Generating a release to production

  • Create a new release with the name and tag in the {MAJOR}.{MINOR}.{PATCH} format
  • Steal the release notes from the latest beta build
  • This will cause a tag to be added to the project and the Production Deploy Workflow will handle the rest
  • Note: Only the first 500 characters of the release notes get set in the Google Play release

More Repositories

1

core

🏡 Open source home automation that puts local control and privacy first.
Python
72,637
star
2

operating-system

🔰 Home Assistant Operating System
Python
4,890
star
3

home-assistant.io

📘 Home Assistant User documentation
HTML
4,873
star
4

frontend

🍭 Frontend for Home Assistant
TypeScript
4,014
star
5

supervisor

🏡 Home Assistant Supervisor
Python
1,745
star
6

supervised-installer

Installer for a generic Linux system
Shell
1,712
star
7

Iconic

🎨 Auto-generated icon font library for iOS, watchOS and tvOS
Swift
1,577
star
8

iOS

📱 Home Assistant for Apple platforms
Swift
1,567
star
9

addons

➕ Docker add-ons for Home Assistant
Shell
1,540
star
10

homebridge-homeassistant

DEPRECATED in favor of native HomeKit support. -  Homebridge plugin for Home Assistant
JavaScript
684
star
11

intents

Intents to be used with Home Assistant
Python
449
star
12

architecture

Repo to discuss Home Assistant architecture
317
star
13

developers.home-assistant

Developers website for Home Assistant.
JavaScript
302
star
14

home-assistant-js-websocket

🚡 JavaScript websocket client for Home Assistant
TypeScript
272
star
15

os-agent

Daemon allowing to control OS features through D-Bus
Go
271
star
16

brands

🎨 Brands for Home Assistant
Shell
252
star
17

hassio-build

🚜 Hass.io build tools
Python
223
star
18

example-custom-config

A collection of example custom components for Home Assistant
Python
206
star
19

hadashboard

🐠 Dashing dashboard for Home Assistant (deprecated)
JavaScript
199
star
20

docker

Home Assistant containers
Dockerfile
198
star
21

cli

🔳 Home Assistant command line interface
Go
195
star
22

addons-example

Example Home Assistant add-on repository
Dockerfile
123
star
23

hassbian-scripts

Scripts used in the Hassbian image.
Shell
123
star
24

ada

Hey Ada!
Python
103
star
25

fabric-home-assistant

📜 Deploy Home-Assistant easily with Fabric
Shell
100
star
26

companion.home-assistant

📖 Home Assistant Companion docs
JavaScript
89
star
27

addons-development

Add-on Repository for Development
Shell
86
star
28

hassil

Intent parsing for Home Assistant
Python
86
star
29

docker-base

Home Assistant base images
Dockerfile
71
star
30

builder

Home Assistant builder script
Shell
69
star
31

data.home-assistant

Data Science Portal for Home Assistant.
JavaScript
65
star
32

home-assistant-notebooks

📓 Sample Jupyter Notebooks to explore Home Assistant data
Jupyter Notebook
63
star
33

scenegen

🎆 Generate Scenes for Home Assistant
Python
62
star
34

home-assistant-js

🐝 JavaScript implementation of the Home Assistant API using NuclearJS
JavaScript
58
star
35

micropython-home-assistant

🐍 Home Assistant client for MicroPython
Python
56
star
36

version

Home Assistant versions data
Shell
56
star
37

assets

🎨 Assets for the Home Assistant project
HTML
48
star
38

ui-schema

A schema to define a user interface for Home Assistant.
41
star
39

alerts.home-assistant.io

Home Assistant Alerts
HTML
40
star
40

HAKit

Swift library for communicating with Home Assistant.
Swift
38
star
41

custom-panel-starter-kit-react

A starter kit to start developing a React based custom panel
JavaScript
35
star
42

my.home-assistant.io

The portal to your home.
TypeScript
34
star
43

buildroot

Buildroot fork with patches for Home Assistant OS
Makefile
32
star
44

services.home-assistant.io

Home Assistant web services
TypeScript
31
star
45

wheels-custom-integrations

Custom integration wheels hosted by Home Assistant
30
star
46

mobile-apps-fcm-push

Push Notification Sender for Home Assistant official mobile apps
JavaScript
29
star
47

wheels

Build wheels for Home Assistant
Python
29
star
48

actions

GitHub Actions for Home Assistant workflows
Python
28
star
49

devcontainer

Custom devcontainers for the home-assistant org
Shell
28
star
50

hubot-home-assistant

💬 Hubot module for interacting with Home Assistant via chat
CoffeeScript
28
star
51

plugin-audio

Pulseaudio implementation for Home Assistant
Shell
26
star
52

analytics.home-assistant.io

Home of the Home Assistant usage stats.
TypeScript
25
star
53

bthome.io

BTHome is a BLE API to broadcast data for your home.
HTML
25
star
54

yellow.home-assistant.io

HTML
24
star
55

plugin-observer

Supervisor plugin observare to monitor host part of Supervisor
Go
23
star
56

plugin-multicast

Multicast implementation for Home Assistant
Dockerfile
22
star
57

connectzbt1.home-assistant.io

HTML
22
star
58

plugin-dns

CoreDNS implementation for Home Assistant
Go
20
star
59

tempio

A template helper for config files
Go
19
star
60

hass-release

Home Assistant release helper scripts
Python
17
star
61

service-hub

Monorepo for NestJS services
TypeScript
15
star
62

probot-home-assistant

Probot to deal with PR/Issue automations for Home Assistant
TypeScript
13
star
63

.github

Default Community Health Files for GitHub Repos
13
star
64

landingpage

JavaScript
11
star
65

plugin-cli

CLI implementation for Home Assistant
Dockerfile
11
star
66

hassbot

HassBot is the chat assistant for the Home Assistant chatrooms on Gitter.
CoffeeScript
10
star
67

wheels-tensorflow

Build wheels for TensorFlow and Home Assistant
Dockerfile
10
star
68

wheels-opencv

Build opencv packages for Home Assistant
10
star
69

bot

Help with maintenance tasks.
TypeScript
9
star
70

lambda-home-assistant-github

:octocat: GitHub hook for the Home Assistant repository
Python
9
star
71

intents-package

Python package of the Home Assistant intents
Python
8
star
72

partner.home-assistant

HTML
8
star
73

deployments

HCL
8
star
74

private-demo

Repository for the private-demo image
Shell
8
star
75

devices

Collection of devices
Python
8
star
76

github-issue-maker

Create GitHub issues based on a template.
Python
7
star
77

hbmqtt-auth-home-assistant

HBMQTT Auth plugin to authenticate against Home Assistant auth
Python
7
star
78

LabelBot

A Lambda function that labels Home Assistant pull requests
JavaScript
7
star
79

green.home-assistant.io

HTML
7
star
80

ci-azure

Helper / Templates for Azure Pipelines
Roff
5
star
81

my-upnp

Go
5
star
82

people

An audit trail for who's meant to be in the Home Assistant GitHub organization - and a place to open issues for security-problem users
5
star
83

codeowners-mention

A Probot app to mention user(s) listed in CODEOWNERS on newly opened issues and PRs that have associated integration labels
JavaScript
4
star
84

operating-system-blobs

Shell
4
star
85

organization

💼 A repository for discussing the organizational matters of Home Assistant
4
star
86

wheels-scipy

wheels-scipy
4
star
87

voice.home-assistant

[Deprecated] Website for all Home Assistant Voice
JavaScript
4
star
88

cosign

Sigstore cosign repository for Home Assistant
4
star
89

login.home-assistant.io

The login to your home.
HTML
3
star