Xiaomi Gateway Integration

I have. Twice now.

Hmm, strange.

@DuckY1987, @abmantis
I just added some more debug info to this code: https://github.com/lazcad/homeassistant/pull/15
So if you use that version and enable debug info for the xiaomi component.
Then try to find the message in the log that corresponds to the “ghost” movement. Probably a good idea to disable most other logs.

1 Like

Today I had same issue. Door sensor switched to open state and stuck.

Could you try what I suggested in previous post?
I would need some debug info to work on.

Hello Daniel. I’ve just installed you component. I’ll test and update you with logs.

1 Like

Nope don’t have this issue, running for a few weeks with multiple sensors.

@Danielhiversen pretty cool you’re into this component now!
Code is looking good will test for a few days.

Hello together,
thanks a lot for the massive work and I am almost there somehow I believe.
Ending up with this winerror I saw before in one of jmvermeulen’s replies on a windows installation.
but couldn’t figure out how to solve it…

Any help?

Cheers,

Oliver

17-01-27 18:04:26 homeassistant.bootstrap: Error during setup of component xiaomi

Traceback (most recent call last):

File “C:\Users\olive_000\AppData\Local\Programs\Python\Python35\lib\site-packages\homeassistant\bootstrap.py”, line 151, in _async_setup_component

None, component.setup, hass, config)

File “C:\Users\olive_000\AppData\Local\Programs\Python\Python35\lib\asyncio\futures.py”, line 380, in iter

yield self  # This tells Task to wait for completion.

File “C:\Users\olive_000\AppData\Local\Programs\Python\Python35\lib\asyncio\tasks.py”, line 304, in _wakeup

future.result()

File “C:\Users\olive_000\AppData\Local\Programs\Python\Python35\lib\asyncio\futures.py”, line 293, in result

raise self._exception

File “C:\Users\olive_000\AppData\Local\Programs\Python\Python35\lib\concurrent\futures\thread.py”, line 55, in run

result = self.fn(*self.args, **self.kwargs)

File “C:\Users\olive_000\AppData\Roaming.homeassistant\custom_components\xiaomi.py”, line 60, in setup

if comp.listen():

File “C:\Users\olive_000\AppData\Roaming.homeassistant\custom_components\xiaomi.py”, line 160, in listen

self._mcastsocket = self._create_mcast_socket()

File “C:\Users\olive_000\AppData\Roaming.homeassistant\custom_components\xiaomi.py”, line 151, in _create_mcast_socket

sock.bind((self.MULTICAST_ADDRESS, self.MULTICAST_PORT))

OSError: [WinError 10049] Die angeforderte Adresse ist in diesem Kontext ung�ltig

Trying to set up logger.

logger:
   default: warn
   logs:
      homeassistant.components.xiaomi: debug

But nothing appears in logs. I’m I wrong with component name?

Set your interface in the config

xiaomi:
 gateways:  
     key: xxxxxxxxxxxxxxxx
  interface: xx.xx.xx.xx -- The IP of the network card you want to use.

Have you installed it as a custom component?
Then you have to use
custom_components.xiaomi: debug

Changing to custom_components do not bring new entities in the log. Only setting default to info writes to log.
I guess the reason is that sensor change state is going from core component.

I just wanted to throw out there that I’m still running commit ce2dd77 from Jan. 15, 2017 and hass 0.35.3. I’m using 4 PIR sensors, 3 buttons, 2 plugs, 2 temp/humidity sensors, and 1 gateway. Everything has been rock solid and I’m very happy with it. Updates are timely, action happens within 1s after button press, temp/humidity seem accurate.

I’m holding off until 0.36.2 or 0.36.3 before updating hass, at which point I will update to the latest commit of this.

With that in mind, is there any chance we could see this component merge with hass in 0.37.0? Assuming everyone feels it’s ready at that time.

1 Like

sweet it worked just had to play a little with the intents… but now it looks great after 4 days if playing around. Thanks a lot!

I think so. I’m already working on the code but since I’m on a vacation for 2 weeks so i won’t have access to my Pi.

I’ve finally got my pi3 setup with HASS, so trying to get this working again… seems I am struggling.

17-01-28 15:14:17 custom_components.xiaomi: No gateway discovered
17-01-28 15:14:17 homeassistant.bootstrap: component xiaomi failed to initialize

I’ve just got the one gateaway but doesn’t seem to like me anymore.

# xiaomi hub #
xiaomi:
 gateways:
   - sid: F0-B4-29-AA-2A-C1
     key: quxrlqi2gv6ah480

Do you use the newest version from https://github.com/lazcad/homeassistant ?
Have tried with a blank sid ?

Try to write sid without dash and lower case.

1 Like

do like this (empty sid)

xiaomi:
  gateways:
    - sid:
      key: REDACTED

@Danielhiversen - yep latest version :slight_smile:

Started with a blank sid that didn’t work, so attempted to add it.

I’ve given it another shot with it removed.

# xiaomi hub #
xiaomi:
  gateways:
    - sid:
      key: h8lfwhm7hw0szqq1

I have also regenerated a new key off my spare andriod phone.

17-01-29 07:58:02 custom_components.xiaomi: No gateway discovered
17-01-29 07:58:02 homeassistant.bootstrap: component xiaomi failed to initialize

I got it working before on my mac with the earlier version (same hub / kit etc.) what should I try next… ?

I noticed this on the home screen with a link to https://home-assistant.io/components/xiaomi/ (404)