Daikin BRP072C42 WIFI custom component

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

Iā€™ve increased the timeout too.

Edit: And it is pushed and merged into the 0.108.6 release. Would be really great if we could push the fixes for BRP072C too.

Hi. Iā€™ve tried the config as described. Did everything as described. When I request hte basic_info, it seems to come back with all the correct response.

However when I select hte Daikin A/C integration and put in the IP, I get ā€œTimeout connecting to deviceā€ and if I use the config.yaml entry, I get nothing in my entity list. Iā€™m at a bit of a loss.

Any advice?

Described by whom?

My integration is pending verification on a Daikin unit so unless you manually have changed the files that I linked to it will not work.

If you do a pip install pydaikin=2.0.0.dev1 you should be able to run the pydaikin command to test the connection. (pydaikin - h gives you usage instructions).

Apologies Fredrike. I meant as described in the original post. It took a while to get the correct basic_info response, but I still got the timeout.

I can give your beta version a try if you think itā€™ll help?

Edit: I tried the pip install pydaikin=2.0.0.dev1 command and it said bash: pip: command not found. Not sure if I can help. Iā€™m a bit of a noob with linux, Iā€™m afraid.

1 Like

Yes that would be much appreciated!

Where did you try the pip command (which environment are you running)? I think pip and python is part of most major distributions.

Iā€™m running HASS.OS with the terminal plug in.

Iā€™ve actually got it working now though, and as much as I would like to help out, Iā€™m hesitant to stuff around with something thatā€™s working now. Perhaps someone with more experience with linux may be of more help anyway.

1 Like