Hello, I have a motion sensor that I would like to use for turning on two lights when it detects motion.
This is the device, as you can see it is working and have just been detecting motion recently:
I have tried to use it as trigger like this:
But without luck, it doesn’t seem to trigger even though it reports that it detected motion.
Can you share the whole automation? Go to the 3 dots in the top right of the screen, click on ‘Edit with YAML’ and copy in and paste in. Remember to highlight the code and click on the ‘</>’ button to preserve the indentations.
Yea I already tried make a new one even more simple with no sun and just 1 light. But it doesn’t trigger, I can confirm that the light however does turn on when I press the “execute” button. If I change the device to my door contact sensor and opens the door, the light also turns on. So I’m left to think its a problem with the motion sensor, but since I can see in the HA entity history that it does in fact report motion, I’m thinking that my trigger configuration must be wrong for this type of device. I tried experimenting with state change, but that also did not work, maybe because I am doing it wrong.
This is what I tries:
alias: New Automation
description: ''
trigger:
- platform: state
entity_id: binary_sensor.xiaomi_aqara_motion_sensor_motion_2
from: 'off'
to: 'on'
condition: []
action:
- scene: scene.all_lights_on
mode: single
But this also didn’t trigger when the sensor detects motion
Thanks, the Dev tool was a good idea.
I reloaded the integration and renamed the device, I that created the same automation from scratch and this time it is working
Still confuses my why I could see history of motion detection when looking at the device before, and it even said “motion detected 2 seconds ago” when it still wouldn’t trigger the automation.