Aqara Motion Sensor Hack for 5 sec

Hey all,

I’ve been trying to get the pencil mod to work across 2 different sensors but in both instances, there is no cool down, it’s just constantly stuck on ‘detected’ in Phoscon.

Has this happened to anyone else?

I’m using the appdaemon app which is working fine; it changes the binary sensor to ‘clear’ in HA after 5 seconds but a couple of seconds later it goes back to detected because that’s what Phoscon is stuck on.

Is it just cause I’m not soldering the two point? Not enough pencil? Others seem to have done this easier method fine

Cheers

Linton

Hi @fabianschaefer
Just copied your code in a new automation, but I can’t save cause of “Message malformed: expected dictionary”
What am I doing wrong?
Thanks in advanced
image

There is something wrong with your trigger/condition part, there are indentations where they shouldn‘t be. I changed mine a bit again to have it even simpler:

trigger:
  - platform: state
    entity_id:
      - binary_sensor.bathroom_motion
      - binary_sensor.bedroom_motion
      - binary_sensor.corridor_motion
    from: 'off'
    to: 'on'
condition: null

Thank you. It’s up and running now. Best solution for this annoying topic.

I’ve soldered two sensors. One works fine but the other one flashes three times and then nothing happens. It’s not talking with Zigbee2MQTT also if i want to re-join it.

Hey,

it seems like the hw hack is no longer working on newer devices. I have 2 devices, one old one 2 years old or so and a new one bought January 22. Both with hw hack.
My research brought me to this thread Making Xiaomi Motion Sensor a Super Motion Sensor - #38 by dnz - Connected Things - SmartThings Community and I have the same behaviour.

The old one behaves like it is expected with the hw hack and necessary reset in ZHA.

The new on behaves like described in the link. After the initialzation phase it changes to a cool down time of 60 sec even with hw hack.
I don’t remeber what the old ones default cool down time was, but I think it was longer.

Maybe someone knows how to fix this?

At least if someone is looking for an error on their side like me, it could also be an issue with newer device.

Hello @googlehupf .
Did you managed to get temperature_precision working?
I modified the devices.yaml for for the Zigbee2MQTT as follow:

'0x00158d0006a0aae7':
  friendly_name: downstairs_motion_sensor
  temperature_calibration: 10
  temperature_precision: 1
  occupancy_timeout: 5

the only setting which seems to take effect is the

occupancy_timeout: 5

The remaining ones are ignored.
BTW.
I did modify the hardware.

My motion sensor doesn’t provide temperature, but for other sensors the precision is working fine.

Thanks for all information, I have around 9 Aqara Motion sensors in use with ConBeeII stick through ZHA.

I hacked 2 of these sensor with soldering method and used the Appdeamon method like @Sebastian_Lotz mentioned here, everything works fine except the ghost triggers, both sensors have ghost triggers, once short after motion detection and once a minute later (this one does not happen always)

I am not sure why I get ghost motion detection, since the solution Sebastian has posted above should solve that problem. Does the Appdeamon solution still work without ghost detection’s for everyone?

The thing is, if the sensors where only for a lights or similar applications, I wouldn’t mind the ghost detection’s, but I am using the sensor for counting people in a room, sensors are mounted on either side of the door for that room, with automations and counter I can see how many people are in that room, this way I can make different automation based on counter.

The automation and the counter works perfectly. but because of the ghost detection counting goes totally wrong, it counts most of the time 2 or 3 times more.

I have 3D printed a cap for both sensors to narrow the field of view, this way the sensors only get triggered if someone is front of the door and not if someone walks near the door.

This is the cap:
aqara_motion_narrow_cap

2 Likes

You can maybe also use a door sensor for that?

That wont work, I have two of these motion sensors on both side of the door, and with automation I can see which one is triggered first and which one second, with that the counter see what direction someone walks and count up if they walk inside and count down if they walk out the room.

Beside in the summer the door stays mostly open.

This may be a stupid question…
I got my order with 20 of these sensors this week. My plan was to do this hack for 5s cooldown.

While working through disconnection issues and testing placement, I set the occupancy timeout setting in zigbee2mqtt to 5s. It detects, goes back to clear 5s later and then detects again right away. I did not do any sort of hardware modification and they appear to be working just fine with a 5s timeout. I tried lowering it to 2s just for testing and it detects, clears in 2s but then will not detect for another 3s. So it appears 5s is the minimum.

So stupid question time… do I really need to do the hardware mod if it’s working with a 5s timeout setting?

Yes you need it , you are only resetting the software, not the hardware

Can’t really comment on that, but can share a similar experience: I’m using a sensor in the same way that you’re doing, with a “limiter” around the sensor. Specifically in this situation, I’m getting ghost triggers, also after about a minute. I have the same sensors all around the house acting as regular motion sensors, all hacked, and they work fine, no ghost triggers.

So my guess is that restricting the sensor may be causing the problem.

My motion sensors where ghosting before the “limiter” but you might be right they where turned to the wall thus it was already limiting before the 3D printed caps, I have to remove and put the sensor somewhere else to check. The caps I use shouldn’t be problem if they reach same ambient temperature as the sensors, but these sensors might be little sensitieve.

Thanks for heads up!

Okay this is bit embarrassing but I found out what the problem was, the Appdeamon fix was just not working and the reason for that was HACS, I installed the app through HACS like mentioned here : Aqara Motion Sensors App later I configured the apps.yaml and aqara.py files with Sebastian_Lotz’s method.

I took of the printed caps first for testing, and ghost detection’s where still there while the motion sensor was directed to a empty space.

So I start to check everything back again just half hour ago and saw the problem, HACS did not put the aqara.py in same directory as apps.yaml, there was a directory called “appdaemon_aqara_motion_sensors” created by HACS and all app files where created in there, thus I copy/pasted everything from that directory to same directory as apps.yaml restarted the HA and everything works as it should last 30 minutes.

I also put back the 3D printed limiters back on, and it is still working good, I have to wait and see couple days how it works now, just to be sure if this is a reliable way to presence count in a room.

If the hardware were not being reset as well how is it redetecting motion right away after the 5s? It’s working exactly as if the hardware mod were done but I haven’t opened them up at all.

No hardware changes I thought around 90 sec… So if you do only software after 5 sec , then you don’t have 85 seconds any new trigger

But that’s what I’m saying. I do! After the 5s it triggers right away again, over and over and over again. The only time there’s a delay is if I set the timeout below 5s. If I set it to 2s, it will clear after 2s but then it will only trigger again at the 5s mark. But any number I set it to that’s 5s or higher it will clear and re-trigger right away.

I see above @Mark_Pellicano also says “This works for me without hw hack”.

I can’t help to wonder if maybe there’s a hardware or firmware revision that allows this to work without the hw mod now?

No idea, if I don’t the pencil hack, it doesn’t trigger any motion anymore after the 5 sec software setting