Daikin AC Integration BRP069C4x

Thanks, just tried it but when using the binary files your command doesn’t work.

I might lack the right knowledge, but this is how it worked for me.

So when people use for example the Windows version you open a command prompt and you CD to your folder where the .exe file is stored (for example ‘cd C:\Daikin’ assuming that’s where tokensaver-win.exe is stored).

Then use the command tokensaver-win.exe "daikin-login" "daikin-password". It will then give a success output in the command prompt and have stored our token.

Nice that it works this way. Just have to find a nice way to automate it on my server, so it will just update every month or so through a cron job.

Great work!

@rospogrigio do you think the custom component would be able to implement the username/password method, for those of us that don’t login to Daikin via Google/Facebook?

I don’t know how much of the token saver code you have ported to Python already.

1 Like

Hi guys, again thanks for all the work, recently the integration stopped functioning. I am wondering whether I’m doing something wrong or this is known already…

I’ve pasted the logs of Home Assistant;

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/config/custom_components/daikin_residential/__init__.py", line 56, in async_setup_entry
    await daikin_api.getCloudDeviceDetails()
  File "/config/custom_components/daikin_residential/daikin_api.py", line 147, in getCloudDeviceDetails
    return await self.doBearerRequest("/v1/gateway-devices")
  File "/config/custom_components/daikin_residential/daikin_api.py", line 88, in doBearerRequest
    await self.refreshAccessToken()
  File "/config/custom_components/daikin_residential/daikin_api.py", line 119, in refreshAccessToken
    res_json["AuthenticationResult"] is not None
KeyError: 'AuthenticationResult'

If I can do anything I would love to hear it :slight_smile:

Did you create a new token and upload to your HA?

is there any way for the token not to expire?

You could ask Daikin about that :wink:

1 Like

I could test this one of these days. Is it correct to say that the echonet lite protocol allows for direct (local) communication with the units? Could you also share some config you made for your units?

Great! Yes, it looks like the Echonet Lite protocol is completely handled locally within the LAN network. I followed the instructions for the custom component linked below. It says its for Mitsubishi systems, but the underlying protocol is shared so I guess it works for any Echonet Lite enabled systems. Instructions state that for Mitsubishi systems, Echonet Lite had to be manually enabled, but it seems that it is on by default for Daikin (at least for the model I tried). The only thing you’ll need to test it out besides the custom component is the IP address of your specific aircon.

climate:
  - platform: mitsubishi
    ip_address: 1.2.3.4
    name: "friendly_name"

Also, it looks like someone reverse engineered the Echonet Lite protocol for a bunch of other types of appliances as well, although I’m not sure how prevalent these are outside of the Japanese market. GitHub - futomi/node-echonet-lite: A Node.js module which allows you to communicate with home applianc

1 Like

this Echonet seemed the quickest solution so I tried this one first. Too bad, it didn’t work. I’ll try the method of @rospogrigio and @Apollon77.

maybe one sidenote, the custom-component can be found and installed in HACS via this repo: rospogrigio/daikin_residential: Daikin Residential (github.com)
while the MITM proxy is the following repo: daikin-controller-cloud/PROXY.md · Apollon77/daikin-controller-cloud (github.com)
I got confused. Besides that, I got it u pand running in 5mins. :muscle:

Guys, I have big news. I have ported @Apollon77 's tokensaver code into python, and now the integration is able to login autonomously and retrieve the access TokenSet. Moreover, it retrieves a new TokenSet when it expires. Finally, I made it so that you just have to provide Daikin Cloud credentials in the integration, so the tokenset.json is no longer used and can be removed (all data is stored in in HA config_entries structure).
It should be ready for prime time but before I release it publicly I would like some people to test it and provide feedbacks, just in case something goes wrong. For anybody who would like to try, here is the PR:

Before you install it, remember to delete the integration, it has to be added again (with YAML or config flow, as desired).
@intrinseca and @jorgeelima , you might be interested in trying this PR, I think.
Let me have your feedbacks, bye!

6 Likes

Then lets hope the “direct login logic” works for a longer time … I see a risk there because Daikin can “break” that anytime … but in fact the tokensaver with Proxy method will stay in my lib at least :slight_smile:

1 Like

Yep, and in case we need to update manually the TokenSet it’s possible to edit the .storage/core.config_entries file and replace it, very easily so the approach is not broken, but using config_entries is a much cleaner way to proceed for storing the integration data.
Let’s see how long this will last!

I downloaded https://github.com/rospogrigio/daikin_residential/archive/refs/heads/login_and_retrieve_tokenset.zip but now the following error:

Invalid config for [daikin_residential]: [email] is an invalid option for [daikin_residential]. Check: daikin_residential->daikin_residential->email. (See ?, line ?).

There was some struggle, but in the end it WORKS!!!

The part of understanding how to get node js working and how to get the token was the most struggle.

I used the method:
“node tokensaver.js “[email protected]” “my-daikin-password””

Thank you everyone for your effort and commitment in getting the Daikin machines up and running at home assistant (with the BRP069C4x)!

Ok but with that method the token will eventually expire once per month and you’ll need to retrieve it again. Why don’t you try the PR I was referring to earlier?

1 Like

You are doing something wrong in your YAML configuration file. Why don’t you use the config flow?

I just wonder if this integration might work for the BRP069A62 controller?

I was able to add the integration and it logs in as it should however I get a warning saying “custom_components.daikin_residential.daikin_api] Device ‘None’ is filtered out”

I can confirm the PR is working fine.
Awsome job @rospogrigio.

1 Like

Thank you @mihsu81 , when I’ll receive 5 positive feedbacks I’ll release the PR officially. :wink:

1 Like