Mi Connector and Xiaomi

:pleading_face:

2 Likes

Ok. I left things alone last night and I'm going to crack on with this today.
Any advice on getting these in docker before I start.
Thanks.

Did you already enable the dev settings on the hub?

Sorry Roy but can you be more specific.
I've connected up a motion sensor to the hub and I can see it in the Mi Home app and via Mi Connector management.
image
I'm assuming I select and then register the devices. When I do I get this.

image

Also, what do you get when you click on the 'Management' button in the app.
This takes me to my pi but I get this.
image
Just doesn't seem right to me.

Yeah the same on that, I think certain things are only for ST (like the DB for instance, I cleared my settings on that).

Ok, so you have the Hub and a Motion sensor in Mi Connector.
Do you have the drivers already installed in HE? if not thats the next step.

Now ST, would pick these devices up automatically reading the ST forum, but I havent found this with HE. As long as the required drivers are in HE, I would reboot your Mi Connector RPi in docker. I have found that once rebooted, the devices will be sent across to HE and useable.

Up above too :stuck_out_tongue:

Cracked it.
My OCD had kicked in and when I defined the device drivers code I altered the title of them. I prefixed them with Mi Connector.
So Xiaomi Motion became Mi Connector-Xiaomi Motion.
Reverted them back to the correct title and now the devices have been defined OK on my HE hub. I can see motion going active/inactive on the sensor.
Phew!!!!! Got there in the end.
I'll now re-parent a few on to the MI Home hub and see how things go.

Thank again for all your guidance and support. Much appreciated.

(That's not to say I won't be bothering you again though. :wink: )

1 Like

Haha, not a problem at all and so glad its got there!

I've updated some of my drivers to not log so much, that and changed to Info when really (to me at least) some entries arent really debug. I'm really happy with this set up at the minute, switches and motion works great, and to boot you get another alarm to use in the Hub :smiley: Shame you cant use TTS lol.

All my contacts have stayed connected since installing, just to make sure I do a walk through and open them all with the dash on my phone, all been good :+1:

I have found though, that my double paddled switches, although added to HE no problem, they give an error on sending acros from the Docker, but they all work. I need to also figure out how they can work as buttons too (when I have the time).

The switches in the list of devices on Mi Connector, appear as if they havent been sent to HE, when they have, just so you're aware.

1 Like

Over the past month I've been having so many issues with these devices when they had been rock solid for ages.
All other types of zigbee devices have been OK so I don't thnk it's my mesh but who knows.
Anyway, now the task starts. I'll go room by room with a gap in between and start to compare reliability.
Thanks again.

Yup, exactly the same happened here, solid for over a year, and then installed 3 Xbees, and still no better. Their own hub seems to have solved it for me, and still keeping them local.

3 Likes

Just thought I would give an update of my situation.
I have put all my ground floor Xiaomi devices through Mi Connector. Re-paired all my 1st floor Xiaomi sensors to the HE hub.
Me and the missus went to our local pub, came home and all the ground floor stuff was working 1st floor devices were not.
I have to say ALL my Xiaomi/Aqara devices have been great for months, but the last 2 months have been a nightmare.
I will see how things go but at the moment I'm feeling really positive that the Mi Connector app through an RPi is the way to go if you have the Xiaomi devices.
Time will tell. :slight_smile:

2 Likes

My Xiaomi hub is upstairs, and most of my Xiaomi devices are down, not missed a heartbeat as yet :+1: Fingers crossed for you :crossed_fingers:

2 Likes

H @fison67
Firstly thanks so much for publishing this. It's great and I've been moving all my Xiaomi/Aqara devices using this app.
I have come across a problem though.
I'm trying to connect a wall switch of type "lumi.ctrl_neutral2". Unfortunately it wont define it on the HE hub.
When I try to register it I'm seeing an error in the HE logs as follows.

image

I have defined the driver type "Xiaomi Wall Switch" which I believe should be the one that this device should use.

image

Any thoughts on what could be causing this?
Many thanks.

Just an update on the above issue.
Tried again this morning and I'm still getting the same issue.
Then I noticed in the logs that it had defined the device OK even though it was failing still.
In Mi Connector the device still would not register but it had defined it on the HE hub and it is working OK.
Paired another 2 devices and these also failed and had not registered but were defined OK and working on the HE hub.
Not sure what is happening but I've got them on the HE hub and that is all that matters.
I now have all my Xiaomi/Aqara zigbee devices paired to the Mi Home hub which in turn is connected to my HE hub.
Since the devices have been on their own hub they have stayed connected and are working well. For me this is definitely the way to go.
Another thing to note is that the battery reporting is showing a lower value than when connected directly to the HE hub.
I was using a range of 2.9 to 3.055.

1 Like

Just a bit more information on this integration.
I have a Ring doorbell and as the Xiaomi hub has a siren I thought I would integrate the 2 together.
I defined a virtual switch with an auto off after 500ms and using IFTTT, when the doorbell is pressed the switch turns on. I defined a rule that when the switch is turned on it sounds the siren on the Xiaomi hub. I now have a doorbell upstairs as well.
Happy days...... :smile:

1 Like

I'm using this and it is working quite well.
Not a single drop off the network.
One issue I am having though is battery reporting from the original buttons.
The battery level is being reported by the device but the driver for it is throwing an error when it sees the battery level.
Here is the error.
image

Here is the line of code that it is referring to.
I am not a coder by any stretch of the imagination and was wondering if any body could throw some light on what could be wrong.

 case "batteryLevel":
    	sendEvent(name:"battery", value: params.data as int)
    	break;

Thanks

EDIT: Fixed. Just deleted the 'as int'.

1 Like

Just checked mine, and I dont have the "as int" in my drivers, yet I haven't changed them. Odd.

That was how I found it. I thought I would compare the code of the Xiaomi Button Ori driver with a motion sensor driver and noticed that the "as int" was missing in the driver that worked.
Deleted it and it started to report OK.
I cannot code but I can compare and copy and then start poking and hoping. :grinning: :grinning: :grinning:

2 Likes

I'm wih you on that, but then I'm an excellent coder. Ahem, sorry copy and paster :joy:

1 Like