Daikin BRP072C42 WIFI custom component

Hi all. I’ve followed along all these instructions on a new unit I’ve just installed, but i can’t for the life of me get HA to recognise it.

If i add it to configuration.yaml, it does sort of show up as an integration to be configured, but when you click on the link to do it, it just pops up and ‘loads’ but goes nowhere.

Going back to basics, when I do:
curl --insecure -H "X-Daikin-uuid: d53b108a0e5e4fb5ab94a343b7d4b74a" --head "https://[IP]/common/basic_info"

The response I get is : HTTP/1.0 200 OK
Content-Length: 328
Content-Type: text/plain

I can only assume that the original UUID registration worked, but the response is completely different to what people have described previously.

Am I missing something?

What you describe as happening is what you would see with the original component installed (as the unit responds to the discovery broadcast from HA, but when attempting to connect it fails to connect). Can you double check the custom component is installed correctly.

If it is can you run that same command without the --head and post the response. ( curl --insecure -H “X-Daikin-uuid: d53b108a0e5e4fb5ab94a343b7d4b74a” “https://[IP]/common/basic_info” )

Thanks for that, I hadn’t noticed the extra flag between the ‘Basic Info’ command and the ‘UUID Registration’.

I am getting the expected data from the ‘Basic Info’ now:

ret:OK,type=aircon,reg=th,dst=1,ver=1_13_7,rev=4335040,pow=0,err=o,location=0,name=%4c%6f%75%6e%67%65%20%52%6f%6f%6d,icon=0,method=home only,lpw_flag=0,adp_kind=3,pv=0,cpv=0,cpv_minor=00,led=1,en_setzone=1,
mac=############,ssid=DaikinAP#####,adp_mode=ap_run,en_hol=0,enlver=1.00,
grp_name=,en_grp=0,en_secure=1,port=30050,id=,pw=#

You say that the behaviour I’m describing is what you’d expect from the original component. I have followed the instructions laid out in your Github to create the Custom Component, so I can only assume that it’s installed correctly, I’m not sure, forgive me, I’m still a bit new to HA, so still muddling through.

Is there anything else I can check? I have noticed some odd error’s in the Log:

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/discovery/__init__.py", line 205, in scan_devices
    results = await hass.async_add_job(_discover, netdisco)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/discovery/__init__.py", line 230, in _discover
    netdisco.scan()
  File "/usr/local/lib/python3.7/site-packages/netdisco/discovery.py", line 72, in scan
    self.daikin.scan()
  File "/usr/local/lib/python3.7/site-packages/netdisco/daikin.py", line 26, in scan
    self.update()
  File "/usr/local/lib/python3.7/site-packages/netdisco/daikin.py", line 77, in update
    'id': entry['id'],
KeyError: 'id'

I’m not sure if that tells you anything? Thanks very much for your assistance, I really appreciate it.

After much fiddling around, I figured out what I was doing wrong, sort of.
I’m on the latest Firmware for the Daikin Controller, and the latest version of Hassio.

I verified that I had the right files, in the right place, but also verified the permissions on those files.
I also have the integration working without putting daikin: in my config.yaml

The part that I think I was getting tripped up on mostly is that when you go to configure the integration, it wasn’t showing any text. So I searched Daikin, and a blank line appeared, so, out of pure ‘what the hell else to do’ I clicked the line and it started loading, then asked for an IP, and voila.

Thanks again for your help!

Hi , im quite new to this,

how do i add
curl --insecure -H "X-Daikin-uuid: d53b108a0e5e4fb5ab94a343b7d4b74a" --head "https://192.168.100.6/common/register_terminal?key=0307222213344” into home assistant.

i got thru the 1st step of adding the files into custom_components

You just need to run the command from the command line (ssh/console/terminal), once you have run it once you should not need to run it again.

hi ,

is this correct?

Hi,

im getting this warning
2020-02-11 20:24:01 ERROR (MainThread) [custom_components.daikin.config_flow] Unexpected error creating device
Traceback (most recent call last):
File “/config/custom_components/daikin/config_flow.py”, line 42, in _create_device
await device.init()
File “/config/custom_components/daikin/appliance.py”, line 200, in init
if self.values[‘frate_steps’] == ‘2’:
KeyError: ‘frate_steps’

what seems to be the issue?

regards Mike

Well after much effort again I think I am so close but it still doesn’t seem to work. The hassio is now showing Daikin AC discovered in the intergrations but when i click configure nothing happens. I have confirmed the device is responding to the uuid as it comes back with a 200 OK message but i am not sure why i cant click configure in intergrations. Any ideas?

HTTP/1.0 200 OK
Content-Length: 337
Content-Type: text/plain

Hey @nzhook, can I do more than one unit?

Thank you

Linton

Linton,

I have two Daikin Alira running with @nzhook 's component for three weeks now with no issues.

Wonderful :slight_smile: do I just have to run the command multiple times to register them? (Haven’t started at all yet)

Boom! 3 of them working :smiley:
Incredibly happy, thanks @nzhook

Btw all, where do presets get configured?

Sorry moorey81 for taking so long to respond and my answer may not be much help, someone else was having this issue (earlier in the post) but it is not something I can replicate. Since what you are descibing is what the original component does (as the units respond to the UDP query but then dont respond on http) my assumption would be the name of the device is confusing the pyDaikin code or the IP address cant be reached/timesout during discovery. I know in my case I had to increase the timeouts to get it to show up but assuming you have the component installed correctly the timeouts will match mine…

I hope that gives a hint for where the issue may be, but as I cant replicate it with my units I cant be of more help.

To answer the original question LintHart I have 4 running on this code and as each run on different IP addresses you need to register each unit separately, I dont think there would be a limit except for how long you want to wait during startup since each unit is probed and the startup process has to wait for them to respond which can be 20-30 seconds for each.

As far as I am aware there are no presents on the units or even the app, you would need to do something with automatons or scripts in Home Assistant, eg. I use this to cool the room down to help me wake up.

- alias: Climate Masterbedroom cooldown in morning
  trigger:
    platform: time
    at: 08:00:00
  condition:
    - condition: state
      entity_id: group.all_devices
      state: 'home'
  action:
    - service: climate.set_temperature
      entity_id: climate.daikin_masterbedroom
      data_template:
        temperature: 18
    - service: climate.set_hvac_mode
      entity_id: climate.daikin_masterbedroom
      data_template:
        hvac_mode: "heat_cool"

Hey @nzhook,

I’m getting some nasty little error logs, wondering if they’re to be expected?

ServerDisconnectedError 3

Prior to this my system was just being annihilated with aiohttp (iirc) failures but of course I can’t Reproduce those when needed :stuck_out_tongue:

Now granted for the next good while I have a cellular home broadband connection that pretty much doesn’t allow for any outbound communication/ports and I’m quite certain it has a lot to do with that.

Is it possible to I guess, have the component to be more offline/local? I assume it’s trying to communicate with Daikin https servers, hence the point of your components. The units do behave when needed so far :slight_smile:

Cheers :slight_smile:

Linton

The component code is all internal, it doesn’t connect to any external Daikin servers just the WIFI modules connected to the units directly. For that reason make sure that the internal IPs against the controllers has not changed.

Interesting thank you. Everything is static at a router level and the component has the IPs specified so that’s not it then. Just a mystery. Do you know what the server disconnection error is typically trying to say? Perhaps it’s Wi-Fi stability. Router is in the middle of the house, right under 1 unit. Other 2 units just upstairs less than 10m away with just a wood floor Between and overall a small place.

Hey @nzhook!
I’m the maintainer of pydaikin and the Daikin integration. It would be great if we could integrate your changes into the main Daikin integration.
Please send a pr on https://bitbucket.org/mustang51/pydaikin/ and I’ll try to merge it as soon as possible. (I believe that we only need minor changes in the Daikin integration after that.)

Edit:
I’ve started a branch with support for the BRP072C42 controller:
https://bitbucket.org/mustang51/pydaikin/branch/BRP072C42#diff

The idea is that we generate an UUID at HA side and pass that together with the KEY during init. Something like this: https://github.com/home-assistant/core/compare/dev...fredrike:daikin-BRP072C42

The changes are untested so beaware :slight_smile:.

The new config is:

daikin:
  hosts:
  - host: 192.168.1.123
    key: ABCD  # only used by BRP072Cxx
  - host: 192.168.1.12

That would be great to get it merged in, I wanted to try and get config flow added for the key and SSID since most of the people commenting here are expecting it to work when it shows up in discovery. But even having the basic changes would be good.

One thing I did find at least with my units is they are really slow to respond, hence the increase in timeout from 10 seconds to 30. Without that change the units dont respond fast enough and Home Assistant ignores them.

I am currently unable to test any code changes but as soon as I can Ill give the code and test and confirm if the timeouts need to be there.

1 Like