Xiaomi Gateway Integration

very simple UPS for the Gateway?

@syssi: I download this https://github.com/syssi/philipslight, and put it in my config folder. Now i have config/custom_components/light/xiaomi_philipslight.py.

I got the token as well using a backup from itunes. But it keeps saying invalid config.

Can you tell me how to fix this?

I’m using hass.io. Do I have to use an addon?
https://home-assistant.io/hassio/installing_third_party_addons/

Or I can use custom_components like that? :slight_smile: Thank you.

Please provide your config. :slight_smile:

I don’t know how to use custom components with hass.io.

So are you using hassbian?

  • platform: xiaomi_philipslight
    name: ‘Xiaomi Philips Smart LED Ball’
    host: 192.168.31.196
    token: 789024a498839c9777380f12881271f5

May you add this component to the official component?

Yes. I’m using hassbian. I made a pull request and hope for acceptance:

So you can use the component some day without hassle. :wink:

1 Like

Hi guys.

https://www.gearbest.com/home-smart-improvements/pp_668897.html

Anyone is aware why this sensor is not supported by the Xiaomi component:

Is it a matter of gateway firmware/API support?

Thanks in advance.

1 Like

We are waiting for someone which owns the device to check it out. :slight_smile: If the device is supported by firmware and local networking protocol it can be easy added to the home assistant component.

I just bought the sensor for testing and will report in a few weeks.

1 Like

I was also going to do it, just waiting for AliExpress sale starting next Monday.

1 Like

This seems like good news, as it may mean it will work with the existing Yeelight component.

Hey guys,
I have the Mijia Smart LED Desk Lamp and confirm it works out of the box with the integrated Yeelight component, after enabling developer mode in the Yeelight app.
I have the yeelight component working with an rgb lightstrip, rgb e27 bulb, and now the desk lamp.
I don’t do any colour changes through home assistant, just on\off with transition time.

- platform: yeelight
  devices:
    192.168.1.206:
      name: Living Room Lamp
      transition: 2000
    192.168.1.205:
      name: Bedroom Light Strip
      transition: 1000
    192.168.1.217:
      name: Studio Desk Lamp
      transition: 1000
2 Likes

Perfect! My xiaomi_philipslight component was merged and will be an official component with release of HA 0.53.

1 Like

Good news: https://github.com/Danielhiversen/PyXiaomiGateway/issues/3

1 Like

Now, I just need to wait for a decent chinese price :wink:

(reposting, didn’t mean to answer to someone in particular)

Hello,

I’m having trouble discovering the gateway. Can someone help me?

Here is what I have so far:

On Mi Home
When I click on confirm in the screen to allow LAN control for the first time, it says “{“result”:[“ok”]}” but if I confirm again it says “{“error”:{“code”:-5010,“message”:“bind failed”},“id”:an incremented number}”.

I have to change the password for it to say “OK” again.

I don’t know if it’s normal or not.

On my Synology where HASS is installed with Docker
I can ping the gateway just fine.

My configuration.yaml

xiaomi:
  interface: <my nas ip>
  gateways:
    - mac: <xiaomi gateway mac address>
      key: <password>

I tried with and without the mac address, it doesn’t change anything. My NAS has 4 ethernet ports so I try to specify the interface, again, it doesn’t change anything.

Log file

2017-08-26 20:02:27 ERROR (SyncWorker_2) [homeassistant.components.xiaomi] No gateway discovered
2017-08-26 20:02:27 ERROR (MainThread) [homeassistant.setup] Setup failed for xiaomi: Component failed to initialize.

Router
It doesn’t seem to be a router problem. I tried some tools to send UDP packets from my PC (ethernet) to my phone (Wifi) and vice-versa and it worked.

1 Like

Can the alarm function be used now?

Anybody is using the cover? Received the motor (rails are still on the way).
Tried playing with the motor. All works within the mi home.
And the cover showed up nicely within HA. But the motor doesn’t react to commands from HA. Although if i move the position slider in MiHome it gets updated in HA.

Below is what i’ve found in the log

2017-08-27 18:06:03 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/core.py", line 1025, in _event_to_service_call
    yield from service_handler.func(service_call)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/cover/__init__.py", line 173, in async_handle_cover_service
    yield from getattr(cover, method['method'])(**params)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/cover/xiaomi.py", line 55, in stop_cover
    self._write_to_hub(self._sid, self._data_key['status'], 'stop')
TypeError: write_to_hub() takes 2 positional arguments but 4 were given
2017-08-27 18:06:04 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/core.py", line 1025, in _event_to_service_call
    yield from service_handler.func(service_call)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/cover/__init__.py", line 173, in async_handle_cover_service
    yield from getattr(cover, method['method'])(**params)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/cover/xiaomi.py", line 51, in open_cover
    self._write_to_hub(self._sid, self._data_key['status'], 'open')
TypeError: write_to_hub() takes 2 positional arguments but 4 were given
2017-08-27 18:06:05 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/core.py", line 1025, in _event_to_service_call
    yield from service_handler.func(service_call)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/cover/__init__.py", line 173, in async_handle_cover_service
    yield from getattr(cover, method['method'])(**params)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/cover/xiaomi.py", line 47, in close_cover
    self._write_to_hub(self._sid, self._data_key['status'], 'close')
TypeError: write_to_hub() takes 2 positional arguments but 4 were given

Which rails did you get? Lonk/specs?