How to use Xiaomi Devices

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

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?

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:

1 Like

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?)

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)

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:

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?

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

What are the model numbers of the devices?

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

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?

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.

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.

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:

Toggle for the action

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

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

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

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.

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

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.