Aqara Motion Sensor Hack for 5 sec

The repository is already in HACS Automation Scripts: https://github.com/pmazz/ps_hassio_entities

I have experienced the same problem, sometimes they trigger false positives. I think they do it randomly but haven’t investigated if they do it on a fixed time. It’s a shame they don’t have an option to set the sensivity to fix this problem.

Doesn’t work for me at all any longer.

Initial trigger turn it on, then off after 5 seconds but then won’t trigger again for 2 minutes, even though the Xiaomi app triggering

You can use this AppDaemon app to reset the sensor state after 5 seconds.
Should be available on HACS in the next couple of days or you can install manually.

1 Like

Yes, but hardware mod is still needed? Setting state in HA is not enough, if no new trigger motion comes from hardware…

Yes, this works in conjunction with the hardware mod. The hardware mod makes the device report motion every 5s, but the state in HA remains on for up to 300s before resetting to off. The app resets it after 5s, so together the motion sensors in HA work great every 5s.

1 Like

Manually installed yesterday and it is working perfectly, thank you so much!

Is this working with deconz only because i use zha and it does not work?

This is maybe a bit unrelated, but:

I’ve just added the Aqara Motion Sensor via ZHA and I get (next to temperature and battery) two sensors:

  • IAS Zone
  • Occupancy.

IAS Zone clears after exactly two minutes (known, I read most of the above :wink: ). But occupancy then cleared after 10 minutes.

What is the difference between these two? I just can’t find it anywhere on the interwebbs… Thanks!

It’s working in ZHA, but you have to make the hardware mod and the software mod (that has been discussed in this thread)

The only difference is what you have seen, the time that takes to reset. I suppose in Aqara’s/Xiaomi’s closed ecosystem it makes sense because the automations are much simpler than what is achievable in Home Assistant

Ah, ok :slight_smile: Thanks! I’m now also just using the sensor directly with zha and the automation that has been posted above to reset the sensor every 5 seconds. No hardware hack! Works perfectly :slight_smile:

You need the hardware mod too. Without it it’s going to work fine just for some hours after pairing, after that the motion trigger will just trigger once each 2 minutes

Erm, it’s still working for me and I did this on Friday. Still triggering and then resetting after 5 seconds

But does it also trigger again after 5 seconds? That’s where the hardware mod is for. So you can actually trigger it after 5 seconds. The software hack is to reset it after 5 seconds.

Move in front of the sensor to trigger. Wait 5 seconds for it to reset. Then try trigger it again as soon as it’s off. Will that work, or will it not trigger for 2 minutes?

Yes, it does :slight_smile:

Maybe it will stop working again some day, but right now, it works :slight_smile:

I installed the addon in HACS but i think doesn’t work. Can you explain me briefly how to do a manual install?
Thanks!!!

I’m new to this so maybe it’s a basic question ;). Installed Appdaemon 4 within HASS and your appdaemon via HACS, but where do I place te apps.yaml?

Your appdaemon is in config/appdaemon/apps

You should have an apps.yaml in config/appdaemon/apps. That’s where you put all your app configurations. The default install should contain a hello world app.

1 Like

Is the AppDaemon app still working in 115.3? Just made the hwmod and installed app via HACS, but sensors state is resetted after 1min30s even though timeout is set to 5 in apps.yaml.

I did the hardware hack on 3 xiaomi/mijia sensors, and with the 3 sensors I’m getting false/ghost triggers after the initial motion trigger. The false triggering occurs at random delays after the first, real trigger… sometimes it is 7 secs later, other times even a minute later… the 3 sensors exhibit the same behavior… I’m connecting my HA to them via ZHA to Sonoff Zigbee Bridge flashed with Tasmota.

Anyone here with the same setup or issues?