[OBSOLETE] Mi Connector (Xiaomi and Yeelight)

Hi
You need a Xiaomi Gateway and Raspberry pi any version.

Buy this Xiaomi Gateway
image

X. AC Partner (Can’t enable a Local area network communication protocol)
image

X. Homekit Aqara Gateway (This is for only homekit)
image

1 Like

So is anyone savvy enough to install this on a rooted Roborock instead of a Raspberry Pi?

I wonder if its possible on a Rooted galaxy phone

i just got an error on Mitookit

it shown like this .after backup was succesful
mitool1

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
   at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at MiToolkit.modFunctions.extractBackup()
   at MiToolkit.frmToken.cmdGetToken_Click(Object sender, EventArgs e)
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3221.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
MiToolkit
    Assembly Version: 1.6.0.0
    Win32 Version: 1.6.0.0
    CodeBase: file:///C:/Users/Jame/Downloads/MiToolkit.1.6/MiToolkit%201.6/MiToolkit.exe
----------------------------------------
Microsoft.VisualBasic
    Assembly Version: 10.0.0.0
    Win32 Version: 14.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Microsoft.VisualBasic/v4.0_10.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3190.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3221.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3221.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Runtime.Remoting
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Remoting/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Remoting.dll
----------------------------------------
MiToolkit.resources
    Assembly Version: 1.6.0.0
    Win32 Version: 1.6.0.0
    CodeBase: file:///C:/Users/Jame/Downloads/MiToolkit.1.6/MiToolkit%201.6/en/MiToolkit.resources.DLL
----------------------------------------
System.Data.SQLite
    Assembly Version: 1.0.105.2
    Win32 Version: 1.0.105.2
    CodeBase: file:///C:/Users/Jame/Downloads/MiToolkit.1.6/MiToolkit%201.6/System.Data.SQLite.DLL
----------------------------------------
System.Data
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3160.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
System.Transactions
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3221.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_32/System.Transactions/v4.0_4.0.0.0__b77a5c561934e089/System.Transactions.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

anyone know how to solve this problem?

Thank you :slight_smile:

Hi. First of all great work. I’m running Mi-Connector in a docker container (Synology Nas). I selected “latest” image. However I have a few problems:

  • Gateway was added manually and it is working.
  • every time I add a new device it is not added automatically. I have to change Mi connector setting to Manual and add them. What could be wrong?
  • All devices I register I have a message “undefined”
  • I was not able to add smoke detector and vibration. They appear listed but I can’t register them

Thanks for the help

BTW I get this error on the log

Get Device State TypeError: deviceMap[id].target.state is not a function Error at Object.module.exports.getDeviceState (/usr/src/app/miio/miio.js:1267:53) at /usr/src/app/routes/registerST.js:19:10 at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5) at next (/usr/src/app/node_modules/express/lib/router/route.js:137:13) at Route.dispatch (/usr/src/app/node_modules/express/lib/router/route.js:112:3) at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5) at /usr/src/app/node_modules/express/lib/router/index.js:281:22 at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:335:12) at next (/usr/src/app/node_modules/express/lib/router/index.js:275:10) at Function.handle (/usr/src/app/node_modules/express/lib/router/index.js:174:3) at router (/usr/src/app/node_modules/express/lib/router/index.js:47:12) at Layer.handle [as handle_request] (/usr/src/app/node_modules/express/lib/router/layer.js:95:5) at trim_prefix (/usr/src/app/node_modules/express/lib/router/index.js:317:13) at /usr/src/app/node_modules/express/lib/router/index.js:284:7 at Function.process_params (/usr/src/app/node_modules/express/lib/router/index.js:335:12) at next (/usr/src/app/node_modules/express/lib/router/index.js:275:10)

Hey.

I have followed your manual on github. I’m running docker on rpi 3 b+ with hassbian.
I have no idea what i’m doing so please be gentle.

Nothing was happening so after reading this post i tried to fix it and executed the following:

docker run -it -v /docker/mi-connector:/config --net=host fison67/mi-connector:0.0.1 bash
npm start (bash: npm: command not found)

docker run -it -v /docker/mi-connector:/config --net=host fison67/mi-connector-arm:0.0.1 bash
npm start

after this my terminal keept running something and i was able to acess webpage interface. Still in there no devices appear, tho i have some added to the xiaomi gateway.

i rebooted the rpi just in case and i wasnt able to acess again the webpage interface, so im guessing it’s not auto running…

when i do sudo docker ps -a it shows:

It’s a lost case???

Gateway might not be connected automatically. If then you have to add with token.

Devices will be added to ST automatically step by step.
It takes a little time per one device.

“undefined” message is just bug.

Read a support devices.
[ Only Beta Version ] <---- Beta version is test2. not latest.

sudo mkdir /docker
sudo mkdir /docker/mi-connector
sudo chown -R pi:pi /docker
docker pull fison67/mi-connector-arm:test3
docker run -d --restart=always -v /docker/mi-connector:/config --name=mi-connector-arm --net=host fison67/mi-connector-arm:test3

auto run
-> docker run -d --restart=always

docker image
-> test3

Thanks! Do you have any plans to move the support for those devices into “latest”?

Is this the answer to my question?

Hi. Testings Beta version test2. However cannot add smoke sensor

2018-11-22 08:34:16 [Mi-Connector] warn: ST Smartapps couldn’t add this id=158d00028f6238, type=lumi.smoke!!!

The handler is published and I have the sensor only in Mi-Home app. Help please?

Update a smartapp and add smoke DTH to ST IDE.

@Paulo_Nobrega
Yes.
If you want that docker start automatically when raspberry pi is rebooted, add command ‘–restart=always’

Version 0.0.1is first version. use test3 image.

Just try to search device on web page.
If you find a gateway without red backhround color on web add it. Or go to device list menu. Add a device with ip address and token which is getting from phone.

When gateway is added zigbee devices are also added automatically to mi connector.

Maybe In a few months…

Hi. Thanks for your patience but it still does not work. Mi Connector smart app is updated to v.0.0.13. Also smoke device handler is up-to-date and published. BTW the smoke alarm I have is this https://github.com/fison67/mi_connector/blob/master/imgs/product/smoke.jpg

The device appears listed in mi-connector but for some reason it is not registered in ST

ST Smartapps couldn’t add this id=158d00028f6238, type=lumi.smoke!!!

It’s just a smartapp or dth problem.
If you do update, restart docker

I must go wrong badly

Added the code in smartthings IDE Smart Apps.
Trying to add it in my Andorid device, but all that shows up in the things is ; missing tiles.
And I can see the app under MyApps, givibg it it’s local IP address.

Where did I go wrong?

Thi is my log;
ee009f84-58dd-4f3c-8caa-e756dd9cd834 21:57:49: info switch is OFF

ee009f84-58dd-4f3c-8caa-e756dd9cd834 21:57:49: debug sendCommand(Status:null) to device at 192.168.2.5:80

ee009f84-58dd-4f3c-8caa-e756dd9cd834 21:57:49: debug POLL

f5b59363-8d03-4a8c-be17-ab7cb41aa118 21:57:35: trace getPhrases(), state.welcomeIssue = null

f177be5a-72a9-4a92-adf6-ffedfa6b0f97 21:57:34: debug getChildDevices(false), children=0

f177be5a-72a9-4a92-adf6-ffedfa6b0f97 21:57:34: debug External Network >> null

f177be5a-72a9-4a92-adf6-ffedfa6b0f97 21:57:34: debug getChildDevices(false), children=0

f177be5a-72a9-4a92-adf6-ffedfa6b0f97 21:57:34: debug Languge >> English

f177be5a-72a9-4a92-adf6-ffedfa6b0f97 21:57:34: debug [method:POST, path:/settings/smartthings, headers:[HOST:192.168.2.40:30000, Content-Type:application/json], body:[app_url:https://graph.api.smartthings.com:443/api/smartapps/installations/, app_id:f177be5a-72a9-4a92-adf6-ffedfa6b0f97, access_token:005f8252-dc9f-43c2-8252-f0919cc3ff56]]

f177be5a-72a9-4a92-adf6-ffedfa6b0f97 21:57:34: debug initialize

f177be5a-72a9-4a92-adf6-ffedfa6b0f97 21:57:34: debug Updated with settings: [address:192.168.2.40:30000, selectedLang:English]

f177be5a-72a9-4a92-adf6-ffedfa6b0f97 21:57:34: debug getChildDevices(false), children=0

f177be5a-72a9-4a92-adf6-ffedfa6b0f97 21:57:34: debug External Network >> null

f177be5a-72a9-4a92-adf6-ffedfa6b0f97 21:57:34: debug getChildDevices(false), children=0

f177be5a-72a9-4a92-adf6-ffedfa6b0f97 21:57:34: debug Languge >> English

f177be5a-72a9-4a92-adf6-ffedfa6b0f97 21:57:34: debug [method:POST, path:/settings/smartthings, headers:[HOST:192.168.2.40:30000, Content-Type:application/json], body:[app_url:https://graph.api.smartthings.com:443/api/smartapps/installations/, app_id:f177be5a-72a9-4a92-adf6-ffedfa6b0f97, access_token:005f8252-dc9f-43c2-8252-f0919cc3ff56]]

f177be5a-72a9-4a92-adf6-ffedfa6b0f97 21:57:34: debug initialize

f177be5a-72a9-4a92-adf6-ffedfa6b0f97 21:57:34: debug Installed with settings: [address:192.168.2.40:30000, selectedLang:English]

f5b59363-8d03-4a8c-be17-ab7cb41aa118 21:56:47: trace getPhrases(), state.welcomeIssue = null

I have no idea what you’re saying.
What do you mean exactly?

Hi fison67

Thanks for your work. Appreciate.

Can I check with you. What is the local server address that I need to input when configuring the smartapp on my phone? Where can I get my server address info? Many thanks.

192.168.11.22.30000