Aqara air conditioning controller (advanced) on HA

I downloaded a plugin from this website(https://github.com/mac-zhou/homeassistant-mi-acpartner)
and configure the info of air conditioning controller in configuration.yaml.

climate:
  • platform: mi_acpartner
    name: mi_acpartner
    host: 10.0.0.234
    token: 8171378a40b1a77ee7a8254b15c75cfc
    target_sensor: sensor.temperature_158d00015aefc4

then I can control air conditioning on HA, but I added some sub-devices like mention sensor on MI home app. It cannot be recognized automatically.

I saw the document, aqara air conditioning controller (advanced) supports LAN communication protocol v2.0: http://docs.opencloud.aqara.cn/development/en-gateway-LAN-communication/

How do I set the configuration so that air conditioning controller can be used as a gateway?

thanks

Use xiaomi_aqara, regard and set up it as gateway. Some sub-devices change to different model name. The relevant PR is here, you can modified it ahead or use custom components instead.

thanks.

I use xiaomi_aqara, set air conditioning controller as gateway. and modified xiaomi_aqara.py files based on that link.

but still get the error

2018-04-17 10:21:03 ERROR (Thread-11) [xiaomi_gateway] Response must be gateway model
2018-04-17 10:21:07 WARNING (MainThread) [homeassistant.setup] Setup of xiaomi_aqara is taking over 10 seconds.
2018-04-17 10:21:08 ERROR (Thread-11) [xiaomi_gateway] Response must be gateway model
2018-04-17 10:21:13 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up platform xiaomi_aqara
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 82, in async_setup
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
    return fut.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/binary_sensor/xiaomi_aqara.py", line 29, in setup_platform
    devices.append(XiaomiMotionSensor(device, hass, gateway))
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/binary_sensor/xiaomi_aqara.py", line 138, in __init__
    data_key, 'motion')
NameError: name 'data_key' is not defined
2018-04-17 10:21:13 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/helpers/entity_component.py", line 100, in component_platform_discovered
    await self._async_setup_platform(platform, {}, info)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py", line 125, in _async_setup_platform
    self.hass, self.config, self.domain, platform_type)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 196, in async_prepare_setup_platform
    platform = loader.get_platform(domain, platform_name)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/loader.py", line 104, in get_platform
    return get_component(PLATFORM_FORMAT.format(domain, platform))
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/loader.py", line 142, in get_component
    module = importlib.import_module(path)
  File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 669, in exec_module
  File "<frozen importlib._bootstrap_external>", line 775, in get_code
  File "<frozen importlib._bootstrap_external>", line 735, in source_to_code
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/switch/xiaomi_aqara.py", line 29
    if 'proto' not in device or int(device['proto'][0:1]) == 1:
                                                              ^
TabError: inconsistent use of tabs and spaces in indentation
2018-04-17 10:21:19 ERROR (Thread-22) [xiaomi_gateway] Unknown gateway ip 192.168.xxx.xxx
2018-04-17 10:21:29 ERROR (Thread-22) [xiaomi_gateway] Unknown gateway ip 192.168.xxx.xxx