Daikin cloud (Onecta) integration with Node-Red

Hi everyone,
I recently migrated from domoticz to Home-assistant. I’ve noticed there is no daikin cloud integration available, but only the old LAN adapter.
Since my perferra AC unit only supports the cloud app (onecta) im looking for a solution.

In my old domoticz setup i had a node-red flow which integrated the cloud perfectly in domoticz using MQTT. So im trying to re-use the domoticz code. Rather succesfully to this day. Most of the devices are being created and updated in home-assistant and interact both ways.

All but the temperature sensors are working (which were working in domoticz) at the moment.


So if anyone want to make use of this integration:
GitHub - ksacca/daikincloud-domoticz: Daikin Cloud support for Domoticz.

And if anyone has a solution for the indoor and outdoor temperature sensor not working, im all ears.

Copy-paste from the domoticz forum with some alterations to make it work in home assistant

Requirements:

Your daikin devices set up in the daikin/onecta app.
You will need to have a functioning daikin setup using the daikin onacte app, otherwise your devices will not be accessible through the cloud. The names of the devices you set up in the app will be used to name the devices in domoticz.

A recent domoticz version with MQTT autodiscovery support.
If using an old version of domoticz, you will need to update at least to at least the latest stable release (V2022.1). This node red flow creates and updates devices using MQTT autodiscovery. If you go to the hardware page of your domoticz and can select “MQTT Auto Discovery Client Gateway with LAN interface”, you should be fine.

A working MQTT broker
You will probably already use this, but if not you can always refer to the domoticz wiki page:

A working Node Red installation, version 2.1.0 or greater
Install node red. You nead at least version 2.1.0 of node red as this is the version where dynamic mqtt subscriptions were introduced. This is used to have custom discovery topics.

Daikin cloud and node red dashboard
I used the daikin cloud integration to communicate with the daikin cloud, and node red dashboard to have a visual interface for the setup. As those are not included in node red, you will have to install this separately.
In node red, go to “manage palette” and switch to the “install” tab. Search for each node and click on the install button.

Getting the flow to work:

  1. Open up node red, open the menu ad select Import
  2. Open and copy the flow.json file from the github page and paste this flow in the new window and
  3. Double click the “Configuration File” node. You will need to setup a location to store the configuration files (for domoticz, for mqtt autodiscovery and to store the power usage). Make sure node red can access this location. If this is done, you can click the deploy button. If the folder didn’t exist yet, it should now (hopefully) have been created. If you use node red in docker, make sure node red has access to the folder (by either using the nodered folder, or by adding a bind in your container settings).
  4. At the top of the flow you will see a start button (inject node). Click on the little square. This will start a part of the flow so you configuration files are created.
  5. Press CTRL+Shift+D to open the dashboard and fill in the general settings. If your mqtt broker is on the same machine, you can enter 127.0.0.1 as IP. The port number is 1883 if you didn’t change it. If you don’t need authentication for your mqtt broker, just leave the username and password empty. You can now set the discovery and state set prefix/topic. For the autodiscovery prefix, use Homeassistant, and for the state simply enter daikin (feel free to change this if you know what you are doing). Do not enable start flow yet, and click on “Save Settings”.
  6. On the same page, you can set up which devices should be created. If you don’t plan to use the econo function for example, do not check the box and this device will not be created. Don’t forget to save the settings here as well (it’s a separate save button).
  7. Go back to node red and double click the “Daikin Cloud” node. Enter your daikin username and password and make sure the save token option is disabled. Click on Deploy. Note: you can only login with a username (which should be your e-mail) and password. Facebook login is not supported. If using facebook login, you should create a daikin account using a regular username.
  8. Open the [create devices] node and search for the [kwh cool], [kwh heat] and [kwh total] in those 3 lines search for [“device_class”: “total”,] and change it to [“device_class”: “energy”,]
  9. Go back to the settings dashboard (CTRL+SHIFT+D) and enable “start flow”. Click on Save settings.
  10. Now it is time to set up domoticz. Go to setup → hardware and add a new line for your daikin AC’s. Give it a name (Daikin) and select the hardware type (MQTT Auto Discovery Client Gateway with LAN interface). Set the IP and port of your mqtt browser (and username and password if required). The autodiscovery prefix should be the one you set in the node red dashboard in Auto Discovery Prefix (daikinAD if you followed the example).
    In the log you should now see domoticz discovered your devices. It can take a few minutes for them to appear in your domoticz. For the kwh devices, those will only be available in domoticz once daikin reports a power change (which can take an entire day if your AC is not in use).