Xiaomi motion sensor hack

I feel so dumb sometimes, I changed the setting and works great. Thanks

1 Like

Wow! This works incredibly well. I just setup an IFTTT trigger. It will keep queuing up the clips in Wyze. So you can essentially have free constant recording of events if you want. I'm going to limit it to 20 seconds. It seems to average around that amount of time before the clip is available in the Wyze app following detection. So I don't want to fill my events queue with more clips than are necessary per event.

This is exciting. I'm really looking forward to picking up my Google Home Hub now. So I'll implement this to also automatically show me the front door as soon as motion is detected by using Google Assistant Relay. This is awesome. I'm essentially getting the benefits of a Ring Doorbell, at the cost of a Wyze cam, a Xiaomi motion sensor, and a little bit of modification.

Maybe these sensors are different, but my understanding with motion sensors is that they are always testing for motion. The change is how often they turn on the radio to report motion. Once motion is detected, the radio is turned on, the motion event is reported, the radio is turned off and a countdown timer is set. If no further motion is detected and the countdown timer reaches zero, the radio is turned on. lack of motion is reported, and the radio is turned off. If motion is continually detected, the internal countdown timeout will keep getting reset and the radio remains off until motion stops and the countdown time reaches zero.

Sounds plausible. I don't really know what's going on with the radio. What I do know is it's either active or inactive in the driver. Thankfully @veeceeoh added the capability to manually force the driver to reset motion to inactive with a custom value.

Since the factory hardware of these motion sensors doesn't allow anything less than 60 seconds, it would have made sense for him to set a default timeout in the driver of 60 seconds. So if you mod the motion sensor and don't enter anything to override the timeout in the device details, then you will get 60 seconds to inactive. You obviously cannot get less than a five second timeout, even with the hardware hack, but you can get the driver to reset to inactive in 5 seconds by simply entering that in the device details.

If you don't hack the sensor and you enter 5 seconds in the device details, the driver will return to inactive in 5 seconds, but the hardware will not be able to report anything for another 55 seconds. So this is an incredibly useful hack thanks to @veeceeoh adding that capability. My hat's off to him once again!

1 Like

As long as it does something useful and battery life isn't obnoxious it can't be bad. I have Zwave motion sensors that have a test mode that set the countdown timer to 10 seconds. I made use of that for a while. Some of my motion sensors have had the batteries last almost 4 years. The one on test mode lasted for just about 1 year. I didn't think that was too bad.

1 Like

All depends on cost of the battery I suppose. From an ecological point of view, less battery consumption is a good thing. As the author of the hack said, he had it running for a year with no noticeble effect, so that's encouraging.

The one at my front door will have a 3 volt supply anyway because of our cold Winter temperatures in Toronto. The others in my house are going to need to last at least a year to satisfy me. I don't really need faster than 60 seconds for the other sensors, or at least I have not thought of a scenario yet where it would be useful. However, this is proving to be so useful for my intentions with the front door camera, that I'm going move forward with that setup.

Since the mod is so simple to install and remove, I'll mod one more and use it as my benchmark for the battery life testing.

So I am a few hundred miles north of you in Minneapolis, Minnesota. Cold here too. My motion sensors use the CR123 3-volt battery and one of them is in an unheated shed. That one has a 3-year-old battery.
I was born in Toronto so please say hello for me.

1 Like

LOL. To whom should I say hello? Doug Ford? :wink:

Yes, he's my father. Perhaps some flowers on his grave if that is OK.

1 Like

All kidding aside, you're in one of my favorite cold places, if there's is such a thing. I grew up in California :flushed:

I used to work for a Danish company just down the road from 3M and I really loved Minnesotans. Awesome people. Never did get me out ice fishing, but they kindly always offered to take me.

When did the premier of Ontario die? That sucks. Now Rob Ford, the former mayor of Toronto and his brother Doug are both deceased? :wink:

Never let anyone take you ice fishing unless you know them well. Disreputable folks might use you for bait.
So you have had an interesting life journey. Warm to cold. I was Toronto, Ottawa,Toronto, Vancouver, Minneapolis. I really want to go warm. Vancouver beckons occasionally.

1 Like

You'd never get me back from BC I'm afraid. That's a place I've really enjoyed having the opportunity to visit for work and pleasure. I've got one to go and then we're going back to the warmth. I'm not going to retire in a cold environment, shoveling snow, and killing myself on stairs.

Life is tough on the elderly here I've noticed. Lots of serious injuries every year from those two things alone.

This is all still "on topic" isn't it?
Although I am past that age, I still have some business here so until that fades away I am tied to the cold.

1 Like

:thinking: I'm the OP. I'll give myself a pass on diverting the topic. I think you get to steal your own threads, don't you? :grin:

1 Like

Is anyone using motion lighting with a sensor that has had the hack? If so, have you noticed the lights going on when there is no physical motion? I did the hack late last night (with a silver conductive pen) and noticed after the lights coming on when they shouldn’t. The rule I’m using is:

If you put this into a simple lighting rule, what happens? Are you certain the motion sensor is working properly? Maybe pull it apart again, and examine it with a magnifying glass to ensure you didn't accidentally bridge any connections. What do you see if you watch the device details, does it show false motion?

Remove the motion sensor from any rule and just have a looked at the log for it while it's in a room with no motion. Don't use a drawer to test. I think you want to have light so you can make sure there's no trigger from the lux, if that's even possible. I don't think it is, but my understanding is this hack is putting the motion sensor in a test mode, so I'm not sure what might be possible in that mode. This is Xiaomi after all. They don't do things the same as everyone else.

I have this rule in motion lighting and it works great with the modified motion

@vjv when you look at the device page, do you see activity changing to Active by itself with no actual motion going on for the sensor to pickup?

I've applied the mod to one of my motion sensors with a 2B pencil and it's working as expected, thank you!

1 Like