Integration with Daikin Skyfi app (Air conditioning)

@robhuls

I just tried your code on a BRP069A41

Edit: I started with a working version of 0.58.1 and copied over discovery.py, climate/daikin.py and sensors/daikin.py from your git.

Here is my log. Is it communication with my adapter that is failing, or did I use a wrong version of Hass or something? When I look at https://github.com/Apollon77/daikin-controller it seems like BRP069A41 and BRP069A42 have a identical API

<2017-11-28 17:06:52 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.5/asyncio/tasks.py”, line 239, in _step
result = coro.send(None)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/discovery.py”, line 109, in new_service_found
discovery_hash = json.dumps([service, info], sort_keys=True)
File “/usr/lib/python3.5/json/init.py”, line 237, in dumps
**kw).encode(obj)
File “/usr/lib/python3.5/json/encoder.py”, line 198, in encode
chunks = self.iterencode(o, _one_shot=True)
File “/usr/lib/python3.5/json/encoder.py”, line 256, in iterencode
return _iterencode(o, 0)
File “/usr/lib/python3.5/json/encoder.py”, line 179, in default
raise TypeError(repr(o) + " is not JSON serializable")
TypeError: b’mydaikinappusername’ is not JSON serializable>

Just set up the Daikin component manually, it’s working great! It’s only Discovery that’s failing.

Good to hear it work. My co-author made the discovery part, I don’t understand how that works (yet). We plan to do a pull request for the main source. We still need a bit of documentation and I have to find out how I make that.

Sounds great. I will continue to test your code and new commits against my BRP069A41.

hi, the new update 0.59.1 broke the custom component;
I’ve this error into the log
Traceback (most recent call last):
File “/usr/lib/python3.5/asyncio/tasks.py”, line 239, in _step
result = coro.send(None)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py”, line 399, in async_process_entity
new_entity, self, update_before_add=update_before_add
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py”, line 247, in async_add_entity
yield from entity.async_update_ha_state()
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py”, line 231, in async_update_ha_state
attr)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py”, line 333, in _attr_setter
value = getattr(self, name)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/climate/init.py”, line 736, in supported_features
raise NotImplementedError()
NotImplementedError

I think that is related to the issue #10658 but I’ve not the skill to dig the solution

Yeah, they need to implement the supported_features method (new for any custom climate component)

Some useful links:

Home Assistant issue: 0.59 NotImplementedError for climate component · Issue #10928 · home-assistant/core · GitHub
Example from another custom climate control: Honeywell Lyric Thermostat - #304 by tinloaf
Diff from the Honeywell Lyric fix

Thanks for the links, should not be difficult to add that. If anyone feels the urge, feel free to do so, I will likely not get to it before the weekend.

Fixed the NotImplementedError that appeared in 0.59.1. You should grab the new components/climate/daikin.py from the github fork above and replace your custom component.

There is already a pull request for the daikin skyfi version, I will make a comment on that pull request how to go forward with the two different systems.

1 Like

Yeah, noticed that. Believe a quick comment about this needs to be added soon to that pull request (before it gets merged in), but I’m not really in a position to start the discussion on github for this. However, I’ll try to have a chat with some devs on Discord and get their view on how to proceed.

For anyone following this thread, this is the daikin skyfi pull request: Added new climate component from Daikin by rofrantz · Pull Request #10983 · home-assistant/core · GitHub

Had a chat, the way forward is to comment on that pull request, I’ll go ahead to get the discussion going.

Edit: Actually it looks like the pull request is not specific to the Skyfi system.

A big thanks for everyone’s input on this so far! Really looking forward to this being added as component to Home Assistant as it’s now summer here in Aus and my new Daikin split (with BRP072A42) is hopefully going in this weekend!

Everyone https://github.com/home-assistant/home-assistant/pull/10983 has merged into dev (NOT RELEASED YET). Docs not published yet for the configuration can be found here https://github.com/home-assistant/home-assistant.github.io/pull/4127/files.

I’m also willing to help to make sure that we’ll make it work also for the Skyfi version, but I’ll need someone that actually has Skyfi since I don’t have it. Does anyone offers for testing on Skyfi ?
Maybe @robhuls could also help.

It is submitted already, I’m just waiting for it to be released oficially on hass

I updated to the dev build last night and it’s working very well after a quick test. No errors at all and all controls seem to work as expected. Thank you for all the work!

I’m using an Australian Daikin Zena 3.5kW unit with BRP072A42 adapter so can’t help with SkyFi sorry.

I’ve slapped together a working SkyFi version here:

https://github.com/bircoe/HomeAssistant/blob/master/climate/skyfi.py

I need to spend some more time reworking how the fan speed and mode arrays are handled but it’s currently working.

1st thing I’ve noticed is that there are different api endpoints compared to the european version.
Are you sure password is a required parameter @bircoe ?

Yes, it appears that the password is required, if you don’t provide the password or provide the correct password the server answers with “500 Bad Password”:

# curl http://192.168.1.70:2000/ac.cgi?pass=XXXXX
opmode=1&units=.&settemp=21.0&fanspeed=1&fanflags=1&acmode=8&tonact=0&toffact=0&prog=0&time=16:18&day=0&roomtemp=19&outsidetemp=18&louvre=1&zone=0&flt=0&test=0&errdata=24&sensors=1
# curl http://192.168.1.70:2000/ac.cgi
500 Bad Password

Is anyone else seeing that if you call climate.set_temperature with e.g. temperature:30 (to test), wait 4 secs (I do it in a script) and then call climate.set_fan_mode, the target temperature will revert back to what it was before?

This is my script:

heatpump_on:
alias: "Heat: Pump on"
sequence:
  - service: climate.set_operation_mode
    data:
      operation_mode: 'hot'
  - delay: '00:00:04'
  - service: climate.set_temperature
    data:
      temperature: 24
  - delay: '00:00:04'
  - service: climate.set_fan_mode
    data:
      fan_mode: '3'

Thanks Bircoe. Saw the update on whirlpool. Appears to be working well. It would be nice to add the outside temp to the component, but its easy enough to pull it through curl.

Not sure if it helps, but I’ve finally updated my version on github.

Seems to be working reliably for me.

eithe,
You may want to try reversing the order you run the commands, try the fan mode before the set temp