Aqara Motion Sensor Hack for 5 sec

Hi,

Do i need to change any values beside the entities?

Hi, I have to confirm post from krad23. It worked fine for me - add new automation to home assistant, then run it, then push the button on motion sensor once and shortly, and 5s interval is working well without any hardware hack. :wink:

So, the change is not permanent. In the evening, it worked well, but in the morning, it switched back to 60s. Anyway, 60s is still better than original 90s. And to be honest 60s is fully sufficient. For someone who needs less, HW hack is the only chance in combination with this SW fix working with deCONZ.

alias: Aquara motion sensor hack
description: ''
trigger:
  - platform: homeassistant
    event: start
condition: []
action:
  - service: deconz.configure
    data:
      entity: binary_sensor.motion_sensor_entrance_hall
      field: /config
      data:
        duration: 60
mode: single

This is a very late addition to this topic, but I thought, that my generic automation based on earlier comments might be helpful for some.
The advantage of this is that you can reset all motion sensors with a single automation, and each additional motion sensor is only 2 lines of code. (or one additional trigger in the UI):

- alias: Motion Generic Reset
  trigger:
  - platform: state
    entity_id: binary_sensor.motion_1
  - platform: state
    entity_id: binary_sensor.motion_2
  condition:
  - condition: template
    value_template: '{{ trigger.to_state.state == "on" }}'
  action:
  - delay:
      seconds: 5
  - service: zha.set_zigbee_cluster_attribute
    data:
      ieee: '{{ device_attr(trigger.entity_id, "identifiers") | first | last }}'
      endpoint_id: 1
      cluster_id: 1280
      attribute: 2
      value: '0'
  mode: parallel
  max: 10

So for each additional motion sensor, you just have to add these lines:

  - platform: state
    entity_id: binary_sensor.motion_x

The IEEE address is extracted using the new device template function introduced in release 2021.8.0

11 Likes

Thanks for this! I’m okay with the default behavior but this might be useful down the road.

Any chance you can share your flow to reset your sensor? Did you just add another call service node (after the events:state node that trigger when motion is detected) that resets the zha state as well?

1 Like

The best solution at the moment!

Danke!

Hi There,

I just picked up one of these sensors as I am in the process of setting up my home alarm system. I have created an automation based on your info and while the motions shows clear after 5 seconds it will not redetect motion until after 60 seconds.

Wondered if you could give me any pointers.

Did you do the Hardware modification on the sensor as described above in the thread?

indeed , by design they only detect after 60 sec, you need the hardware hack

I haven’t done the hardware hack yet,

The weird thing is that I did take the pcb out just too take a look out of curiosity, when I put it back and installed the battery the movement cleared after 5 seconds and then if there was new motion it re detected it and the state changes so now it appears to be working correctly with just the automation in place.

That‘s normal behavior. After you put in the battery, it‘s in the „5 second“ mode for a few minutes (10 min or so). After that it should go back to the 60s clearing time.

1 Like

Ah Ok I see,

I was monitoring it all night and it seemed to still be the same. I am going to be using this sensor to trigger the home alarm I am putting together so as long as it picks up motion properly which it seems to be very good at I am ok with the 60 seconds. I was more curious than anything.

This works for me without hw hack

Awesome.

My use case for resetting the cool down is related to motion that turns on lights. If the light is turned off and the person re-enters the room, I want the motion sensor to detect and turn the lights back on.

Originally, I was resetting the cool down 5 seconds after every motion detected. While this has not shown to have a significant impact on battery life, I have since changed my reset automation from ‘5 seconds after every motion’ to ‘immediately after light is turned off’ since I am only interested in turning the lights back on if they were turned off.

I’m using zigbee2mqtt with Aqara motion sensor. Can someone here show me how should I modify my zigbee2mqtt to use with the hacked motion sensor?

Thanks in advance.


You can set it at the Setting(Specific) tab

2 Likes

Thanks. May I know what zigbee2mqtt version are you running? I’m running v1.21.0-1 and it’s showing Under Constrution under the Setting(Specific) tab.

1.22.1-1 edge but the master works as well

You got this to work without the hw hack?

Using ZHA or Zigbee2MQTT or any?

Was it following the same suggestion as @tpc77?

Thanks in advance.

with the hardware mod