Skip to content

jwillemsen/daikin_onecta

Repository files navigation

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

Sponsor Releases Maintainer Coverage

Daikin Onecta

Home Assistant Integration for Daikin devices using the Daikin Onecta API.

Important

In order to use this integration you need to create an account on the Daikin Developer Portal at https://developer.cloud.daikineurope.com/login. The status of the Daikin Cloud can be found online at https://daikincloudsolutions.statuspage.io.

Warning

Sharing, selling, or distribution access and refresh tokens is strictly prohibited according to the Daikin developer terms of use. Sharing them could case serious issues for you as user!

Installation

When using HACS, select HACS, search for the daikin_onecta integration, select it, and press the Download button to install to download the integration.. Now continue the installation as described at Using config flow

You can install the code manually by copying the daikin_onecta folder and all of its contents into your Home Assistant's custom_components folder. This is often located inside of your /config folder. If you are running Hass.io, use SAMBA to copy the folder over. If you are running Home Assistant Supervised, the custom_components folder might be located at /usr/share/hassio/homeassistant. It is possible that your custom_components folder does not exist. If that is the case, create the folder in the proper location, and then copy the daikin_onecta folder and all of its contents inside the newly created custom_components folder. Then you have to restart Home Assistant for the component to be loaded properly.

Prerequisites

Visit https://developer.cloud.daikineurope.com and sign up for a developer account. Use the same login method and email address as you use with the Onecta app. Using a different login method and/or email address will result in no devices shown in Home Assistant.

Using config flow

First create an account at https://developer.cloud.daikineurope.com, after that create an application at the Daikin Developer website, see the Getting started page at the Daikin Developer portal for more information. As redirect uri always first use https://my.home-assistant.io/redirect/oauth. Copy and save the provided client id and secret, you need to enter these in the next step.

Now within Home Assistant go to Settings - Devices & Services and pressing the ADD INTEGRATION button to create a new Integration, select Daikin Onecta in the drop-down menu. In the Add credentials form enter a user defined name (for example daikin_onecta), and enter the OAuth Client ID and OAuth Client Secret as you obtained from the Daikin website, and finish by pressing the ADD button.

You will be redirected to the Daikin website where you have to authorize the application. First check the checkbox in the permission form that you give this 3rd party integration information and control for your devices, after that select the I agree button to give the application permissions, after that you will be redirected back to the redirect uri as you provided as part of the application on the Daikin website, there you have to link Home Assistant by pressing the Link account button. In case the provided instance URL is not correct you can edit it by pressing the pencil behind the URL. When you have pressed Link account the integration will be added and the Daikin devices connected to your Daikin cloud account should now be visible within Home Assistant.

Only when the redirect back to your Home Assistant doesn't work first try to install/enable My Home Assistant. When that also doesn't work you can try <HOME_ASSISTANT_URL>/auth/external/callback as the redirect URI instead. The <HOME_ASSISTANT_URL> must be the same as used during the configuration/authentication process. Internal examples: http://192.168.0.2:8123/auth/external/callback, http://homeassistant.local:8123/auth/external/callback.

This integration supports the following configuration settings to reduce the amount of polling to Daikin

  • High frequency period update interval (minutes)
  • Low frequency period update interval (minutes)
  • High frequency period start time
  • Low frequency period start time
  • Number of seconds that a data refresh is ignored after a command

Reinstall

When you try to reinstall this integration check if you don't have an old client id and secret configured within Home Assistant, see Application Credentials for more information.

Setting the log level

If you'd like to see more granular logs, to investigate the communication or for other debugging purposes, you can set the log level in the Home Assistant config. The following lines can be added to set the overall log level for the component and the oauth2 helper which this integration uses:

logger:
  logs:
    custom_components.daikin_onecta: debug
    homeassistant.helpers.config_entry_oauth2_flow: debug

If you only want to change log level on a per module basis, you can do that as well, for example if you only want debug logs for the climate:

logger:
  logs:
    custom_components.daikin_onecta.climate: debug

Thanks to:

This code is based on @rospogrigio and @speleolontra work which is based on @Apollon77 work.