How to use Xiaomi Devices


#1

Hey noob to HA here. I bought a bunch of Xiaomi devices that have custom drivers and manage to hook them up. Im having troubles working out how to use them in rule machine/motion-senor lighting/ button.. etc.

For example:

  • I bought the AQ button but its only command is to resetBattery.
  • The motion sensor doesnt seem to have any activity despite being connected to the Hub

What Im trying to do:

  • Use the button to turn off the lights
  • Motion sensor to turn on the lights

Any help would be awesome :slight_smile: thanks


#2

Hey,

Were the devices picked up and show the correct driver in each?
And do they show in the "Events" tab when you hit a button?


#3

yes they both do show events when i hit the button and when there is motion. The driver does seem to be correct as they are showing the right names.

thanks for the help :slight_smile:


#4

Cool :slight_smile:

You might want to try the Motion Lights app, or the Simple Lighting app to get started with testing them? Its easier than RM for lighting. RM is a little bit of a learning curve. A great read here (if you haven't already?)


#5

I did try the Motion lights app which didnt work. I also tried to use the simple lighting app and that didnt work too. Any idea why its not working ?

side-note: im using Yeelights (lan-option)


#6

Not familiar with Yeelights, although if you can operate them from within the Device in HE, then they should be fine.

I'd open the Logs page, and check that you see the Xiaomi devices logging when using, and showing what you did correctly. At least you know they are communicating properly (if you haven't already that is) :+1:


#7

Just to clarify, when you say they are "compatible" what do you mean?

Officially Xiaomi devices aren't supported by Hubitat but they can be made to work using the custom drivers here

Have you loaded the appropriate driver for each device type and assigned the driver to the respective device?


#8

I mean Xiaomi devices that have custom drivers for hubitat. Yes i have loaded them to with the right driver codes and assigned them. My button commands have only one option which is to resetbattery (it doesnt have the push command) not sure if thats an issue


#9

What are the model numbers of the devices?

Do they match with the list at the top of other thread?


#10

Yes the model numbers are the same as the ones on the thread. Am i suppose to have a push command for the button? Does anyone else own a AQ button?


#11

What do you mean by "push command"?

I would start simple so that we can try and understand where the issue is - you mentioned

"The motion sensor doesnt seem to have any activity despite being connected to the Hub"

But then said:

"yes they both do show events when i hit the button and when there is motion."

So start with the basics, put the motion sensor in a drawer for a few minutes, open the Logs link in the Hubitat UI and then open the drawer - do you see activity from the device in the Logs?

Then go into the device itself on the Devices page in the Hubitat UI and click on "Events" at the top. Do you see events for motion, lux, battery, etc in there?

Then do the same for the button and make sure you see activity in the Logs and in the Events.

For all devices you can also enable "debug message logging" for each device to see more information in the Logs.

If both of those are working then the device itself and the driver are working.


#12

I have the Xiaomi button and there is no option to push a button in the driver page. Then again I do not need it.
I have rules that do things when the button is pressed.
EDIT. Like this.


#13

Great!! I got it working! how do you turn the light off with a push again? so push to turn on/off.

Thanks :slight_smile:


#14

Toggle for the action


#15

Awesome thanks that worked for me. The motion sensor doesnt work with Hubitat simple lighting. Ill try it with rule machine to see if that works


#16

You’re sure your motion sensor is working? I use two different Motion sensors with simple lighting.


#17

I think its working. Im see logs in events. How do i know for sure? Im using the Aqara ms


#18

Me too. Hallway motion sensor is a Centralite, and Hallway motion sensor 2 is a Xiaomi Aqara

When you trigger the motion sensor in the device details page, it will show active. Don’t forget that Aqara have a 60 second hardware time out unless you modify the hardware.


#19

Can you post your rules?
From the way you are describing things your devices are working but your rules are not.


#20

In this use case it turns off all my downstairs lights when we go to bed.
As has been said above you can select toggle so if the light is off and the button is pressed the light turns on. When pressed again it turns of.
I.e. It toggles the light condition.