Now in 0.110
Support for the BRP072C42 Daikin component is now available in Home Assistant core 0.110. Once the controller has been added to your WIFI network add to Home Assistant using the normal method providing the IP of the controller and Key from the sticker on the WIFI module. Leave the password blank.
–
Old custom_component detail
I have a couple of Daikin Heat Pumps installed which use the BRP072C42 WIFI controller, initially I thought this was supported by Home Assistant but it looks like there are some subtle differences between the BRP072A42 and the BRP072C42 which prevent it from working with the standard Daikin component mainly around a new authentication system and the use of https.
I have commited my changes as a custom_component for Home Assistant on my github here:
Note this is designed to be merged back to the the existing Daikin component so currently it will override the original, if you are using the original as well it will require some small changes to detect http vs https (assuming the older versions don’t work with https).
Steps to install
- Download the custom_component/daikin directory and place it into your custom_component folder
- Grab the 13-digit KEY from the sticker of the controller (Lists SSID, KEY, MAC and S/N)
- Register the hard coded UUID with the controllers using that key (each Controller has a unique key but can use the same UUID)
curl --insecure -H "X-Daikin-uuid: d53b108a0e5e4fb5ab94a343b7d4b74a" --head "https://[IP]/common/register_terminal?key=[KEY]"
eg. using a key of 0103056789012 and the IP 192.168.1.20
curl --insecure -H "X-Daikin-uuid: d53b108a0e5e4fb5ab94a343b7d4b74a" --head "https://192.168.1.20/common/register_terminal?key=0103056789012"
You should see output similar to this:
HTTP/1.0 200 OK
Content-Length: 6
Content-Type: text/plain
(if you have the wrong KEY you will get 403 HTTP_FORBIDDEN instead)
- Restart home-assistant and the climate devices should now show up (See Configuration -> Integrations), if not you may need to add:
Please let me know if this works or not.
TODO
These are a little out of my home-assistant knowledge at this time, suggestions welcome.
- Generate and store the UUID, using a hard coded one could be a security issue
- During discovery (config_flow) obtain the key from the user and then run the register_terminal automatically
- Obtain and store the self signed cert with the code to validate the SSL requests instead of ignoring SSL issues
–
Original post:
I have recently had a couple of Daikin Heat Pumps installed which use the BRP072C42 WIFI controller, initially I thought this was supported by Home Assistant but it looks like there are some subtle differences between the BRP072A42 and the BRP072C42 which prevent it from working with the standard Daikin component.
I have been looking at how to get this controller working however it requires a slight modification to the Home Assistant component code as well as pydaikin. I also can only test against my controllers so I would like someone who has a similar unit or more knowledge in this space to review what I have found in case I have made some incorrect assumptions.
But to break down what I have found to work:
- The controller operates on https rather than http and uses a Daikin signed certificate (ie. self signed, although I suspect they ship the CA cert with the Daikin Mobile Controller app for Android because the app wont talk to my apache server), attempting to connect via http gives a Connection Refused.
- When requesting the https end points in a browser you are given a 403 error, however when emulating a controller with a response to the DAIKIN_UDP/common/basic_info command the app connected to http and sends a header of X-Daikin-uuid with what appears to be an md5, I suspect this is a unique device ID which is granted access after initially authenticating with the SSID and Key as the same ID lets me access any controller and I get the standard 200 Daikin responses, however changing this ID returns the 403. This is not something I have added as my ID works, however the simple way to get this at the moment would be to open the app and emulate a response to the DAIKIN_UDP/common/basic_info command so that it calls back to the local http server
So the change I needed to make to pydaikin was this (I have kept secret a secret in case it is a unique identifier):
--- daikin.orig/pydaikin/appliance.py 2019-05-23 19:01:41.000000000 +1200
+++ daikin.new/pydaikin/appliance.py 2019-07-18 22:55:57.000000000 +1200
@@ -242,7 +242,7 @@
if self._airbase:
resource = 'skyfi/%s' % resource
async with self.session.get(
- 'http://%s/%s' % (self.ip, resource)) as resp:
+ 'https://%s/%s' % (self.ip, resource), headers={"X-Daikin-uuid": "*secret*"}, ssl=False) as resp:
if resp.status == 200:
return self.parse_response(await resp.text())
return {}
Obviously this will allow any Self-Signed SSL cert, but thats what my limited Python knowledge could work out for testing. I am also unsure if the older BRP072A42 units support https so the code may need to handle both http and https (the app seems to always try http first which is why the UDP trick worked).
Here is a response for common/basic_info with this change in place:
ret=OK,type=aircon,reg=th,dst=1,ver=1_12_8,rev=93E736A,pow=0,err=0,location=0,name=%4d%61%73%74%65%72%42%65%64%72%6f%6f%6d,icon=3,method=home only,lpw_flag=0,adp_kind=3,pv=2,cpv=2,cpv_minor=00,led=1,en_setzone=1,mac=D0C5D3******,ssid=DaikinAP****,adp_mode=ap_run,en_hol=0,enlver=1.00,grp_name=,en_grp=0,en_secure=1,port=30050,id=,pw=
In addition my units are really slow to respond (> 10 seconds) so the 10 second timeouts inside the Home Assistant component code will fail to detect them during auto-discovery or even when manually adding them. To fix this I increased the timeout from 10 seconds to 60 seconds and they appear in Home Assistant and I can control them without any issues.
--- daikin.orig/hass/components/daikin/config_flow.py 2019-07-18 23:33:20.000000000 +1200
+++ daikin.new/hass/components/daikin/config_flow.py 2019-07-18 23:28:22.000000000 +1200
@@ -43,7 +43,7 @@
host,
self.hass.helpers.aiohttp_client.async_get_clientsession(),
)
- with timeout(10):
+ with timeout(60):
await device.init()
except asyncio.TimeoutError:
return self.async_abort(reason='device_timeout')
diff -rub daikin.orig/hass/components/daikin/__init__.py daikin.new/hass/components/daikin/__init__.py
--- daikin.orig/hass/components/daikin/__init__.py 2019-07-18 23:33:30.000000000 +1200
+++ daikin.new/hass/components/daikin/__init__.py 2019-07-18 23:28:08.000000000 +1200
@@ -87,7 +87,7 @@
from pydaikin.appliance import Appliance
session = hass.helpers.aiohttp_client.async_get_clientsession()
try:
- with timeout(10):
+ with timeout(60):
device = Appliance(host, session)
await device.init()
except asyncio.TimeoutError:
Is someone able to test this and/or maybe rewrite this to ensure it is also compatible with the older controllers.
I am happy to post this as a bug/feature report once I know it works for other people.