I’ve got several of the Xiaomi Aqara motion sensors dotted around (brilliant kit for the price!). These include a light level sensor.
They intergrated seamlessly into HA, I didn’t have to add anything other than the gateway config. They appear as 2 entities on the dash, the motion sensor and the Lx light level sensor.
Here’s where I hit a bit of a sumble - if the’ve not been activated for a little while, they take a good 5 seconds or so to trigger automations based of this light level. I have them turning on lights below a certain Lx theshold, but it seems the value only updates currently when the motion sensor is triggered.
Is there a way for me to set these to update say every 60 seconds? A script or option I could add if I added the sensors to my config individually?
Just curious, which Xiaomi motion sensors have a light level sensor? I’ve got a bunch of these Xiaomi body sensors but don’t think they measure light level.
Sure thing, here’s one of my examples. I have a 2nd automation that just turns the light off when the sensor goes to off (about 60 seconds, nothing you can do about shortening that, inherent flaw with the Xiaomi kit)
- id: Hallway Upstairs lighting on
alias: Hallway Upstairs Lighting Automation on
trigger:
platform: state
entity_id: binary_sensor.motion_sensor_158d00022369e3
from: 'off'
to: 'on'
for:
seconds: 0.1
condition:
condition: numeric_state
entity_id: sensor.illumination_158d00022369e3
below: 10
action:
- service: switch.turn_on
entity_id: switch.upstairs_hallway
I saw you found the answer but just for everyone else, its the Aqara branded ones that come with the stand and have the physical sync button on the side rather than the pin hole to push into to sync.
I didn’t realize you could set the for: value to seconds: 0.1. I thought HA only updates triggers every second. Are you sure that your value of 0.1 is any different than a 1 second value? That would be useful to me if it is.
Can You please make a video of this? I am new to HA and don’t really understand where to put this line of code and how to edit it. Would solve a lot for me!
Looking forward to hear from you. Hopefully I can take a dump soon without sitting in the dark for a minute or two