ekutner / home-connect-hass

Alternative (and improved) Home Connect integration for Home Assistant
MIT License
491 stars 53 forks source link
home-assistant-component home-assistant-integration home-connect homeconnect

Alternative Home Connect Integration for Home Assistant

This project is an alternative integration for Home Connect enabled home appliances manufactured by BSH under the Bosch, Siemens, Constructa and Neff brands.

If you're using this integration please star it on Github


Table of contents

Main features

Home Assistant already has a built-in integration for Home Connect, however, it is quite basic, generates entities that are not always supported by the connected appliances and tends to stop getting status updates after a while. This integration attempts to address those issues and has the following features:


Installation instructions

Creating a Home Connect developer app

Before installing the integration you need to create an "application" in the Home Connect developers website. Note that if you have an existing appliacation, that was created before July 2022 you will most likely have to update the redirect URI to the one specified below. It can take a few hours for the changes to existing applications to apply, so be patiant.

  1. Navigate to the "Applications" page on the Home Connect developers website. You'll be prompted to create an account or sign in if you already have one.
    ➠ NOTE: You MUST use ONLY lowercase letters in the email addresses of both your regular user account and developer account or the integration won't work!
  2. Click the "Register Application" link.
  3. Fill in the application creation form:
    Application ID: A unique ID for the application, can be home-connect-alt, or whatever you like.
    OAuth Flow: Authorization Code Grant Flow
    Home Connect User Account for Testing: Leave blank
    Redirect URI: https://my.home-assistant.io/redirect/oauth
    Add additional redirect URIs: Leave unchecked
    Enable One Time Token Mode: Leave unchecked
  4. Click "Save" then copy the Client ID and Client Secret and save them for use in the next step.

Installing the integration

Pre-installation steps

  1. Navigate to https://my.home-assistant.io/ and make sure the Home Assistant Instance is configured correctly to point to your local Home Assistant instance.
  2. Power on all your appliances.
  3. Turn OFF the wifi on your phone and make sure all the appliances are operational in the Home Connect mobile app.
  4. If this is not the first time you are installing the integration and anything changed with your credentials you should go the the Settings -> Devices & Services page on Home Assistant, then click the three-dot-menu on the top righthand corner and select "Application credentials". Locate the previous credentials row for this integration and delete it.

Installation

  1. The esiest way to install the integration is using HACS. Just click the button bellow and follow the instructions: Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.
    Alternatively, go to Settings -> Devices & Services in Home Assistance and click the "Add Integration" button. Search for "Home Connect Alt" and install it.

  2. A dialog box will popup asking you to select your preferred Home Connect server. Select "China" if you are located in China and "Default" for any other location. api_host dialog

  3. Next you will be asked to provide the Home Connect developer app credentials you created erlier. Give these credetials set a name that will make it easy for you to reference them in the Home Assistant credentials manager : api_host dialog

  4. Finnaly, a new window will popup where you will be asked to login to to your Home Connect account and allow Home Assistant to access your appliances. After you approve that you will be redirected back to Home Assistant, continue as instructed.

  5. Congratulations, you're done!
    Home Connect Alt will now start downloading the data for your appliances and will add the entities for them to Home Assistant.
    Note that the integration dynamically discoveres entities as they are made available by the API, so expect new entities to be added in the first few uses of the appliances.

Configuration options

Starting with version 0.7.0 the integration supports the UI configuration flow for most configuration options. Existing config values will be read however, once the options are saved in the UI they will override the values from the config file.

Options settable in the UI

Regular options

These options will show up for all users.

Advanced options

These options will only show up when the user has enablde "Advanced mode" in the user profile.

The following very advanced options can only be defined using YAML. Generally you should not change them unless you really know what you're doing.

After the integration is configured READ THE FAQ then add it from the Home-Assistant UI.


Automation Notes

Integration state

Services

The following services are available for use with automations:
select_program - Selects a program and optionally set its options
start_program - Starts a program and optionally set its options
stop_program - Stops the active program
pause_program - Pauses the active program (if and when supported by the appliance)
resume_program - Resumes a paused program (if and when supported by the appliance)
set_program_option - Sets an option on the active program if one exists or on the selected program otherwise
apply_setting - Applies the sepecified setting on an appliance
run_command - Runs the specified command on an appliance

Events

The integration exposes the events fired by the service as Home Assistant events under the name: "home_connect_alt_event"
The published events values are:

Triggers

The integration exposes two triggers for easy automation:

Local vs. Server translation

The default behavior of this integration is to use "local" value translation. That means that all string sensors keep their internal value in a raw, language independant format. Those values are "translated" in the UI to a human friendly text by using local translation files.
This method is different than most other Home Assistant integration but it has three important benefits:

  1. It makes automation code language independent. As a developer I strongly believe that code shouldn't relay on the specific human language currently selected by the user.
  2. It allows users to look up possible values in the Home Connect developer documentation. So you can know in advance which values to epxect for a given sensor.
  3. It allows add translation for languages which are not supported by the Home COnnect API.

In contrast, setting sensor_value_translation: server will override this behavior and use translations provided by the Home Connect API. This is limited to languages supported by the API but it does make sensor have the actual textual values displayed in the UI. So you can use that if you prefer,


Troubleshooting and FAQ


Dealing with API rate limits

If you have more than 5 appliances you may occasionaly hit the Home Connect API rate limit which only allows up to 1000 daily API calls, regardless of how many appliances you own. This limit ends up hurting their best customers and it doesn't make any sense, it should be adjusted based on the number of appliances in the account. If you hit that limit then I strongly enourage you to reach out to Home Connect and protest. Until hey listen there is an annoying workaround:

  1. Create a second developer app in the Home COnnect developers portal with exactly the same settings you used for the first one.
  2. In Home Assistant go to Settings -> Devices & services then click the three dot menu at the top right and select "Application credentials" and then click the "Add Application Credential" button at the button right corner.
  3. In the popup dialog select "Home Connect Alt" as the integration, give your credentials some useful name, like "Home Connect 2" and then copy and paste the client ID and client secret for the second app you created in step 1.
  4. Go back to the Integrations page and click on "Home Connect Alt". Under "Integrations entries" click on "ADD ENTRY".
  5. This will start a new login flow to Home Connect. Complete the flow and you should now have two instances of the integration running in parallel.
  6. Now you must use the "CONFIGURE" button of each entry to change the Application settings advanced options so that half of your appliances are disabled in each entry. See details above how to do that.
  7. If you've reached this far then you should now have two instances running, using different Home Connect apps and each one responsible for half of your appliances. If it still getting rate limit then just add a third one.


Known Issues

See the FAQ above.

Reporting Issues and Bugs

CAREFULLY Read the FAQ before submitting a bug report or opening a feature request, a lot of common issues are already covered there.

DO NOT open bugs or feature requests on missing data, controls or events, unless you can show, either in the logs or in the API documentation that the missing item is actually available. Read the FAQ section for more details on this.

Bug report requirements

All non trivial issues require:

Enabling debug logging

Use one of these two methods enable debug logging:

Setting Log Mode

If while analyzing an issue you reported you are requested to set a specific Log Mode:

  1. Make sure that "Advanced mode" is enabled in your Home Assistant profile.
  2. In Home Assistant navigate to Settings → Devices & Services → Home Connect Alt
  3. Press the "CONFIGURE" button and set the required log mode.


Beta Releases

Major changes will be released in beta versions to reduce the impact on existing users. It is strongly advised not to install the beta version unless you are a part of an issue that specifically calls for installing one and when you are, you should only install the specified version (as there may be several issues handled in separate beta versions at the same time). To install a beta version go to the HACS dashboard in the Home Assistant UI:


Contributing Translations

You are welcome to create PRs for new language translations or updates to existing ones however please note the following requirements:


Legal Notice

This integration is not built, maintained, provided or associated with BSH in any way.