Aqara Motion Sensor Zigbee on Home Assistant

Aqara Motion Sensor Zigbee on Home Assistant.

When the sensor goes off it will not immediately sense and come on again.

Is there any way to make the sensor activate immediately after it has gone off?

https://nl.aliexpress.com/item/1005004724973017.html?spm=a2g0o.order_list.order_list_main.5.2c2579d2Hcb6HH&gatewayAdapt=glo2nld

Hi, battery powered devices like this usually have a re-trigger delay to help preserve battery life.

This question has cropped up before so the following post might be helpful:

Thanks for the quick reply and great information.

I’ll check it out tonight in a couple of hours but I just put in a new battery and having problems just getting it to work. It does not sense anything.

I’ll check out the instructions soon and let you know how I went.

Thanks again.

Aqara devices are tricky to get working after a battery change. I usually have to delete it and re-pair it.

I just re-paired it and I have it working. (Almost)

I’ll be right in a few minutes.

Thanks

Jonah1970 Mark

You mention " Aqara Motion Sensor Within one hour after it connects to the network (new network connection mode), the Aqara Motion Sensor is triggered once every 5 seconds."
Does that mean if the motion sensor is activated within the hour it will always be 5 seconds forever or just for the hour?

Anyway looks like I have another problem. The sensor activates a bulb in the toilet. I could make it 10 minutes for the light to be on but playing around with the bulb being on for 3 minutes and stay on longer if someone is still in the toilet.

It is probably just my bad programming of the Animation I have it set to activate by Motion Started Detecting Motion then turns on the bulb for 3 minutes. After 3 minutes the bulb is turned off.

But it will not activate again until motion is Clear. So if still in there the Motion is never clear so the bulb will not come on again while someone is in there.

I just need the bulb to come on immediately if someone is still in the room.

I’m looking at now something like:
When PIR Motion started detecting motion to Turn Bulb ON.
Then stay on while there is Occupancy.

I guess I’ll get it soon.

Having trouble getting the bulb to stay on when occupancy as there is only Became Occupied or Not Became Occupied.

Can not get the bulb to stay on when Occupied.

you haven’t posted the automation that you are using so it will be hard to give better advice but you need to trigger only on a general state change of the motion sensor and not “to detected”.

then in the actions perform a choose statement that if the motion is to detected then turn on the light. Or if the motion stops being detected then wait 3 minutes and then turn off the light.

I don’t use the Aqara sensor specifically but note that PIR sensors only detect movement so if someone sits still then they will not be detected. You therefore need to set the on time appropriately or else use a different technology such as microwave radar.

I have attached an example automation below which may help:

alias: "Bathroom LEDs Control "
description: ""
trigger:
  - entity_id:
      - binary_sensor.bathroom_motion
    platform: state
    to: "on"
    from: "off"
    id: motion
  - platform: state
    entity_id:
      - binary_sensor.bathroom_motion
    id: no_motion
    to: "off"
    for:
      hours: 0
      minutes: 6
      seconds: 30
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: motion
        sequence:
          - type: turn_on
            device_id: dbeb8a1785735122e0573a2da8823124
            entity_id: light.bathroom_leds
            domain: light
            brightness_pct: 100
      - conditions:
          - condition: trigger
            id: no_motion
        sequence:
          - type: turn_off
            device_id: dbeb8a1785735122e0573a2da8823124
            entity_id: light.bathroom_leds
            domain: light
    default: []
mode: restart
initial_state: true

finity
I have the statement in Home Assistant “choose statement that if the motion is to detected then turn on the light.”

But when light goes off I can not turn it on again immediately. There are only options of Started Detection Motion or Stopped Detecting Motion and not there currently is motion then turn on bulb.

Thanks for your comments.

When
PIR 03 Occupancy became occupied
Device
PIR 03
Trigger
PIR 03 Occupancy became occupied
Duration (optional)
hh
0
:
mm
00
:
ss
00
And if (optional)
Confirm the time is after 6:00 PM and before 7:00 AM
After

Fixed time

Value of a date/time helper or timestamp-class sensor
After
6
:
00
:
00
PM
Before

Fixed time

Value of a date/time helper or timestamp-class sensor
Before
7
:
00
:
00
AM
Weekdays
Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday, Monday
Then do
Disabled
Call a service ‘Notifications: Send a notification with colh’ on
Turn on BULB 03 DOWNSTAIRS TOILET Light
Device
BULB 03 DOWNSTAIRS TOILET
Action
Turn on BULB 03 DOWNSTAIRS TOILET Light
Brightness
Flash

short

long
Delay for 6:00
Duration
hh
0
:
mm
06
:
ss
00
:
ms
000
Turn off BULB 03 DOWNSTAIRS TOILET Light
Device
BULB 03 DOWNSTAIRS TOILET
Action
Turn off BULB 03 DOWNSTAIRS TOILET Light

Jonah1970 Mark
Thanks for the information.

Mine senser does sense Occupancy. The Occupancy shows Detected and Clear and seems to show Detected while someone stays in the room. But only items I can use are Became Occupied and Became not Occupied. There is no Still Occupied I can use that I know of.

At the very start of my Automation I have always had: “Motion started detecting motion” and have changed it back to that. Not as shown “Occupancy became occupied”.

I also meant to attach this photo showing my options which does not allow me to turn on bulb if Motion is already Detected only if Motion is Clear.

Have to wait a minute for it to become clear so have to be in the dark for a minute.

I am not sure I understand why you would want to turn on the bulb if motion was previously detected and motion is clear. Automations are generally event driven so for a simple one you would just need two triggers:

  • One to turn bulb the bulb on immediately motion is detected.
  • Another to turn the bulb off when no motion is detected for X minutes.

As someone else commented it would be useful if you pasted in the yaml code for your automation so others can check it for errors (you can do this from the three-dots menu which allows you to switch between editing in the UI and yaml).

I do not use the Aqara motion sensors so I am not familiar with the various device trigger options that are available, however the thread below relates to a problem with a similar automation using this sensor. In this case the problem was with the condition statement.

MARK

To answer your first line. If sitting on the toilet and as you are not moving, after movement is stopped being detected it goes dark and you have to throw your arms around madly to get the light to come on. Not good when visitors are here.

I thought that your first comment was the best I have heard all year including:

  • One to turn the bulb on immediately motion is detected.
  • Another to turn the bulb off when no motion is detected for X minutes.

But then it is like before I have to put a long wait in to make sure they are out of the room as it will go dark and have to wave hands around. I guess that is the best I can do.

I looked at changing the OFF to Occupancy became Not Occupied but when you leave the room it is still shows Occupied for 10 minutes after leaving the room.

Looks like there just has to be a timer as can not do it without a timer without the room going dark while someone is in it.

So I have gone back to basics on the Automations with two Automations one for the ON and one for OFF and I need to add a timer.

I am not sure what this means in the Automations: “This list of conditions needs to be satisfied for the automation to run”

Thanks for your help Mark.

NOTE: Automations Following

ON AUTOMATION

When

PIR 03 Motion started detecting motion

ADD TRIGGER

And if (optional)

This list of conditions needs to be satisfied for the automation to run. A condition can be satisfied or not at any given time, for example: ‘If Colin Hansen is home’. You can use building blocks to create more complex conditions.

ADD CONDITIONADD BUILDING BLOCK

Then do

Turn on BULB 03 DOWNSTAIRS TOILET Light

Device

ActionTurn on BULB 03 DOWNSTAIRS TOILET Light

Brightness

Flash

short

long

OFF AUTOMATION

When

PIR 03 Motion stopped detecting motion

type: no_motion

platform: device

device_id: 1cdf96ce5d144d76986c39b88e4d31ce

entity_id: 5d67a87b5dad55736a38cf96bcc2c1e0

domain: binary_sensor

ADD TRIGGER

And if (optional)

This list of conditions needs to be satisfied for the automation to run. A condition can be satisfied or not at any given time, for example: ‘If Colin Hansen is home’. You can use building blocks to create more complex conditions.

ADD CONDITIONADD BUILDING BLOCK

Then do

NOTE: I JUST EDITED THIS IN DELAY FOR 8 MINUTES AS I DID ON THE AUTOMATION

Delay for 8:00

delay:

hours: 0

minutes: 8

seconds: 0

milliseconds: 0

Turn off BULB 03 DOWNSTAIRS TOILET Light

type: turn_off
device_id: 37daefd8e5ce3f20a1fb78754da68550
entity_id: 1a8b19795d9539341037514bccd5865c
domain: light

Thanks Mark at Least I have the Automations simple now. I guess if I knew more it could be done in one animation but that is OK.

I’ll still look at improving them but have the bulb on for 6 minutes now