Xiaomi Gateway Integration

Yep, i have my own integration over mqtt (based on rave’s old code), but if it supported in api - it will be soon in HA component =)

It didn’t support playing files by url - only uploaded via mi home (when you upload this file it takes an internal ID and you can play sounds by id only - not url).

you can also add volumes in Docker UI, but if you will create docker container via putty (or other terminal) - you will not able to manage it via UI.

I’m not familiar with synology DSM capabilities, but you might be able to create the dir and copy files via the GUI.
Or maybe if you mount the homeassistant dir via SMB?
Then you could download the ZIP of raves github and copy the files like that?

https://github.com/lazcad/homeassistant/archive/master.zip

That’s what I did.
Mounting the directory

and copying the files from the repo into the mounted folder.

But there must be something missing - the component cannot be found.

You need to map it to docker’s user home directory (usually root):
destination path must be: /root/.homeassistant/custom_components/

Also you can mount whole directory to preserve your configuration and database on docker container update:
mount /docker/hass to /root/.homeassistant

For me the custom_components dir is in same dir as configuration.yaml and home-assistant_v2.db
I guess that is your /docker/hass/config/ dir

Just tried both what @monster1025 suggested: mapped /root/.homeassistant/custom_components/ and put the files into mapped directory.
Didn’t work.

Then I copied the files to my config folder.
still the component is not found.

Sorry not sure what the problem is.
can you post your config yaml and the errors you are seeing in the log?

Wow - I was just tinkering the install with this, I was sure I was going to fluff it up.

Worked first go. Very chuffed!

I have 1x gateway, 3x motion sensors, 4x temp sensors, 5x door sensors.

Things I would love to see:

  • Door/window sensors - they should report as open/closed - not on/off :slight_smile:
  • Motion sensors:
  • would be great to see the time of motion last detected
  • it’s a confusing label to say a sensor is “off” - I would love to come up with a more accurate term
  • Battery usage - awesome! I can’t even find that in the Mi home UI!
  • I think a killer item would be to estimate battery life - how many sensor hours per 1% of battery charge?
  • I would love to see some idea on how to integrate the gateway and sensors into an alarm panel - perhaps the “Manual Alarm” example in the components gallery?

I do see some funny things - nothing concrete - just delays or dropouts - nothing serious mind - but they might cause a pickle in the event of creating an alarm system.

I can see myself using more of the motion and door sensors - so ridiculously easy! Battery usage - has anyone had their sensors go flat yet? How long is the life of these babies?

Thanks again to the devs on this one - bloody great work.

1 Like

Hi everybody! I follow you and this topic is great.
I’m such a beginner but I learn about you day by day. I’m quite interested in Xiaomi Gateway integration.

I updated custom_components folders with @Danielhiversen modified folder but I can’t see battery atribute in HA. Anyone knows why?

Thanks!

Can I do anything useful with a V1 gateway?
I mistakenly purchased a V1 gateway in the GW+Sensor pack.
I subsequently bought a V2 gw and and using all the sensors from the pack, leaving me with a redundant V1 GW.
I’d like to do something with it, but as far as I can tell there is no way to enable any form of API on the V1 - e.g. to use the light/sensor/audio (currently light and audio only supported in the API)

I expect I will ebay it, but just checking before I do…

Did you restart HA?

Yes by ssh the whole server and by command reload_core_config… nothing

Sorry not sure. I’m using rave’s repo not daniels.

BTW, what is the benefit to keep two active repos?

Did you also update the firmware trough the app? So that you have the latest firmware which is needed to make it work in HA.

Strange, any errors in the log?
You need the latest firmware 1.4.1_144.xxxx

Should be fixed here: https://github.com/Danielhiversen/homeassistant/pull/4/files

1 Like

Okay we should definitly get a plan here as to which repo we should use. @Danielhiversen are you planning on integrating your repo into ha at some point? I am currently on raves repo but I am not sure if I should switch to yours and I think this is unnecessary ground for confusion at the moment.

~Cheers

1 Like

My forks is mostly the same as the original one, but I have fixed some issues to make it work for me.
Anyone are welcome to make a pr to push the changes back to the original repo:
https://github.com/lazcad/homeassistant/compare/master...Danielhiversen:master

You are right! solved! I updated and I can see battery level now. Thanks!