Integration with Daikin Skyfi app (Air conditioning)

Hi and thanks for creating this, it works great! Got it up and running in just a few minutes, and replaced my old ifttt setup with this instead.

I’m getting an error from home assistant regarding sensor.daikin not being defined, but I can use the component fine and the climate.daikin entity reports correct states for my heat pump.

A persistant error message is shown on the web interface:

Invalid config
The following components and platforms could not be set up:
sensor.daikin

Logs:

2017-11-24 10:18:31 INFO (MainThread) [homeassistant.core] Bus:Handling <Event platform_discovered[L]: service=load_platform.sensor, platform=daikin, discovered=[{'name': 'Daikin indoor', 'state': 21.0}]>
2017-11-24 10:18:31 INFO (MainThread) [homeassistant.core] Bus:Handling <Event platform_discovered[L]: service=load_platform.sensor, platform=daikin, discovered=[{'name': 'Daikin outdoor', 'state': 5.5}]>
2017-11-24 10:18:31 ERROR (MainThread) [homeassistant.loader] Unable to find component sensor.daikin
2017-11-24 10:18:31 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform sensor.daikin: Platform not found.

Let me know if there’s something I can provide to help you debug this further.

PS: I don’t have any “sensor.daikin” setup myself.

If you picked up the latest version of the daikin component, then you also need homeassistant/components/discovery.py (because we now also have discovery) and homeassistant/components/sensor/daikin.py, so three files in total. The last file is used to read the inside and outside temperature and feed that into home assistant (credits to @fredrike for adding that).

Before we can launch a pull request, we will at least need a bit of documentation and possibly have to put the system specific code in a separate library (though I don’t really see the point of wrapping an API like this into a library).

Thanks, robhuls, that explains it!

Great work here… this gives me options for new aircon with WiFi that is a split system…

Excellent!!

Are you planning on submitting as an official component?

Does anybody know if the BRP069A41 is much different from BRP069A42? Is this gonna work on BRP069A41

Yes, if you read some of the earlier posts in this thread I’m guessing it’s just a matter of getting the time to finalize:

1 Like

@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.