Skip to content

Repository files navigation

Homebridge Daikin Cloud

npm version Build and Lint codecov

A Homebridge plugin that integrates Daikin air conditioning units via the Daikin Cloud (Onecta) API, allowing you to control your devices through Apple HomeKit.

Originally based on homebridge-daikin-cloud by Jeroen Van den Berghe, licensed under the Apache License 2.0. This fork has been substantially rewritten by MP Consulting.

HomeKit Controls HomeKit Settings

Features

  • Temperature Control: View current room temperature and set target temperature
  • Operation Modes: Cooling, heating, and auto modes
  • Fan Control: Adjust fan speed from the accessory settings
  • Swing Mode: Enable/disable swing (if supported by your device)
  • Real-time Updates: WebSocket support for instant device state changes (Mobile App mode)
  • Extra Features (individually configurable):
    • Powerful mode (showPowerfulMode)
    • Econo mode (showEconoMode)
    • Streamer mode (showStreamerMode)
    • Outdoor silent mode (showOutdoorSilentMode)
    • Indoor quiet mode (showIndoorSilentMode)
    • Auto fan mode (showAutoFanMode)
    • Oscillation switch (showOscillationSwitch)
    • Dry mode (showDryMode)
    • Fan only mode (showFanOnlyMode)
  • Separate Fan Tile (showSeparateFanControl): Expose fan speed and oscillation as a standalone Fan tile, so both stay visible even when the accessory is grouped into a single tile in the Home app
  • Firmware Updates (showFirmwareUpdateSwitch): Manage gateway firmware updates from HomeKit instead of the Onecta app. The plugin logs when Daikin stages an update for your unit and exposes a "Firmware Update" switch — turn it on to install; it stays on while the update runs and the plugin logs the outcome. Not part of showExtraFeatures: it must be enabled explicitly, so an "all switches on" scene can never trigger an install. The unit is unavailable (and rejects commands) while it updates. The current firmware version is also shown in each accessory's HomeKit details.

Note: HomeKit doesn't natively support all Daikin operation modes. Extra features appear as switches in the Home app. Enable them individually in the plugin settings UI.

Grouped tiles: When you group the air conditioner into a single tile in the Home app, Apple hides the built-in fan speed slider and swing toggle (they're still reachable by opening the device directly). The Oscillation switch and Separate Fan Tile options work around this by exposing those controls as their own tiles, which remain visible when grouped.

Authentication Methods

This plugin supports two authentication methods:

Method API Calls/Day WebSocket Setup
Mobile App 3000 Yes Email/password (same as Onecta app)
Developer Portal 200 No OAuth with developer credentials

Recommended: Mobile App authentication provides more API calls and real-time WebSocket updates.

Requirements

  • Node.js >= 18.15.0
  • Homebridge >= 1.5.0
  • A Daikin account with devices registered in the Onecta app

Installation

Install via the Homebridge UI or manually:

npm install -g @mp-consulting/homebridge-daikin-cloud

Setup

Option 1: Mobile App Authentication (Recommended)

  1. Open the Homebridge UI and go to the plugin settings
  2. Go to the Authentication tab
  3. Select Mobile App from the authentication method dropdown
  4. Click Configure Credentials
  5. Enter your Daikin Onecta account email and password
  6. Click Test & Save Credentials
  7. Restart Homebridge

If you edit config.json by hand instead, the credential keys are daikinEmail and daikinPassword:

{
  "platforms": [
    {
      "platform": "DaikinCloud",
      "name": "Daikin Cloud",
      "authMode": "mobile_app",
      "daikinEmail": "<your-onecta-email>",
      "daikinPassword": "<your-onecta-password>"
    }
  ]
}

Option 2: Developer Portal Authentication

1. Create a Daikin Developer App

  1. Go to the Daikin Developer Portal
  2. Sign in and navigate to My Apps (top-right menu)
  3. Click + New App
  4. Fill in:
    • Application name: Any name (e.g., "Homebridge")
    • Auth strategy: Onecta OIDC
    • Redirect URI: https://<your-homebridge-ip>:<callback-port> (e.g., https://192.168.1.100:8582)
  5. Save and note your Client ID and Client Secret

2. Configure the Plugin

Add the platform to your Homebridge config.json:

{
  "platforms": [
    {
      "platform": "DaikinCloud",
      "name": "Daikin Cloud",
      "authMode": "developer_portal",
      "clientId": "<your-client-id>",
      "clientSecret": "<your-client-secret>",
      "oidcCallbackServerBindAddr": "0.0.0.0",
      "callbackServerExternalAddress": "<your-homebridge-ip>",
      "callbackServerPort": 8582
    }
  ]
}

3. Authenticate

  1. Restart Homebridge
  2. Open the Homebridge UI and go to the plugin settings
  3. Click Authenticate and follow the OAuth flow
  4. After successful authentication, restart Homebridge

Configuration Options

Option Type Default Description
authMode string developer_portal Authentication method: developer_portal or mobile_app
daikinEmail string - Daikin account email (Mobile App mode)
daikinPassword string - Daikin account password (Mobile App mode)
clientId string - Daikin Developer App Client ID (Developer Portal mode)
clientSecret string - Daikin Developer App Client Secret (Developer Portal mode)
callbackServerExternalAddress string auto-detected External IP/hostname for OAuth callback
callbackServerPort number 8582 Port for OAuth callback server (1-65535)
oidcCallbackServerBindAddr string 0.0.0.0 Address to bind callback server (valid IPv4)
updateIntervalInMinutes number 15 Polling interval (Developer Portal: 15+ min, Mobile App: 1-5 min)
forceUpdateDelay number 60000 Delay (ms) before refreshing after a change
enableWebSocket boolean true Enable real-time updates (Mobile App mode only)
httpTransport string node node or curl. Use curl only if authentication times out on your network while curl works — some WAFs drop Node's TLS fingerprint (#6). Requires the curl binary; WebSocket still uses Node TLS. Env override: DAIKIN_HTTP_TRANSPORT
excludedDevicesByDeviceId string[] [] Device IDs to exclude from HomeKit
showPowerfulMode boolean false Show Powerful mode switch
showEconoMode boolean false Show Econo mode switch
showStreamerMode boolean false Show Streamer mode switch
showOutdoorSilentMode boolean false Show Outdoor Silent mode switch
showIndoorSilentMode boolean false Show Indoor Silent mode switch
showAutoFanMode boolean false Show Auto fan mode switch (toggles fan speed between auto and manual)
showOscillationSwitch boolean false Show fan oscillation (swing) as a separate switch (stays visible when the accessory is grouped into a single tile)
showSeparateFanControl boolean false Expose fan speed and oscillation as a standalone Fan tile (stays visible when the accessory is grouped into a single tile)
showDryMode boolean false Show Dry mode switch
showFanOnlyMode boolean false Show Fan Only mode switch
showFirmwareUpdateSwitch boolean false Show a Firmware Update switch that installs staged gateway firmware updates (never enabled implicitly by showExtraFeatures)

API Rate Limits

Mode Daily Limit Recommended Polling
Developer Portal 200 calls/day 15+ minutes
Mobile App 3000 calls/day 1-5 minutes

The plugin manages rate limits by:

  • Polling at configurable intervals
  • Triggering immediate updates after changes
  • Blocking requests when the rate limit is reached
  • Using WebSocket for real-time updates (Mobile App mode)

Fan Speed

Fan speed in HomeKit uses percentages (0-100%). Map these to your device's fan levels:

Daikin Levels HomeKit %
5 levels 20%, 40%, 60%, 80%, 100%
3 levels 33%, 66%, 100%

Fan Speed

Swing Mode

Toggle swing mode from the accessory settings. Both horizontal and vertical swing are activated together if supported.

Swing Mode

Troubleshooting

Token Expired or Invalid

Delete the token file and restart Homebridge:

rm ~/.homebridge/.daikin-controller-cloud-tokenset
# or in your custom storage path

Authentication Flow Issues

  • Ensure your redirect URI in the Daikin Developer Portal matches exactly: https://<callbackServerExternalAddress>:<callbackServerPort>
  • Try setting oidcCallbackServerBindAddr to 0.0.0.0
  • Check firewall rules for the callback port

Device Not Appearing

  • Check the Homebridge logs for device discovery
  • Verify the device is registered in the Daikin Onecta app
  • Check if the device ID is in excludedDevicesByDeviceId

WebSocket Not Connecting (Mobile App Mode)

  • Ensure enableWebSocket is set to true
  • Check Homebridge logs for WebSocket connection errors
  • Verify your credentials are valid by testing the connection in the UI

API Gateway Timeout Errors (502, 503, 504)

These errors indicate temporary issues with the Daikin Cloud servers:

  • The plugin automatically retries failed requests up to 3 times with exponential backoff
  • If errors persist, the Daikin API may be experiencing extended downtime
  • Check Daikin's status page or try again later

Supported Devices

Any device compatible with the Daikin Onecta app, including:

  • BRP069C4x
  • BRP069A8x
  • BRP069A78 (Altherma heat pump)

Development

# Install dependencies
npm install

# Build
npm run build

# Run with watch mode
npm run watch

# Run tests
npm test

# Check for Daikin API schema drift (fetches live devices, diffs raw vs Zod-parsed,
# reports any silently-stripped fields). Add --dump-fixtures to also write per-device
# fixtures to test/fixtures/live/ for offline debugging.
npm run schema:check

Code Quality

This plugin uses:

  • TypeScript strict mode for enhanced type safety
  • Zod validation for runtime type checking
  • ESLint for code quality enforcement
  • Jest with 60%+ test coverage

Documentation

Comprehensive developer documentation is available in the docs/ folder:

For development workflows and coding conventions, see CLAUDE.md.

License

The original work by Jeroen Van den Berghe is licensed under the Apache License 2.0. Modifications and new code by MP Consulting are licensed under the MIT License. See the LICENSE file for full details.

About

Homebridge plugin to control Daikin devices via the Daikin Cloud/Onecta API

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages