Add DDF for Aqara P1 presence sensor RTCGQ14LM - #6069
Conversation
|
Do I understand this right, the sensor knows the distance to the triggering object? |
|
@manup You're a little ahead of the PR description, haven't had the time yet. Opened Pandorra's Box 🙂 Well, I wouldn't call it knowing the distance, but it apparently can distinguish between different ranges. Not sure how this is technically done precisely, maybe by adjusting measurement angles... However, they also describe it on their website, so nothing in terms of slow or hectic movement/number of movements (that's what I would understand on sensitivity). The FP1 presence sensor interestingly handles both, true sensitivity and distance. We probably want to expose it cooked? Here, I did it uncooked, but for the FP1, it is by setting |
|
Ah, since this is only a PIR I don't think it has anything to do with distance, at most sampling sensitivity (imho). I'd prefer to use
Yeah it's time we get this streamlined, normalized values here are much needed, the For docs, nice comparison between the former version and this p1: https://www.aqara.com/en/product/motion-sensor-p1 The FP1 is super interesting with the radar, we haven't managed to get one yet :/ |
This PR adds DDF support for the P1 presence sensor, depends on #6070 and vice versa.
It is remarkable that presence detection is derived purely from the fact that an attribute report from attribute 0x0112 is received. The value of that attribute, however, contains illumination data, so that it is a combined report and does not come seperated from each other.
It supports indication of presence through its internal LED via
config/ledindication. It also allows to set a period from 1 - 200 seconds (device internal) when a new presence event is detected, usingconfig/duration. Lastly, it exposesconfig/sensitivity, which Xiaomi itself describes with the distance from which detection is triggered (values 1 - 3, where 1 is low).Due to the above described device approach to send presence events, a workaround has been used to ensure presence is automatically set to false after the number of seconds set through
config/duration. In future, this should be solved by availability of timers.Apart from the device implementation, this PR also contains an important amendment when setting values on a device: the initial state of a state change is set from
StateWaitSynctoStateCallFunctionto speed up setting the target value while omitting reading the current state at the negligible cost of an unnecessary write.This PR also contains the resource item implementation for
config/triggerdistancerequired by the FP1 presence sensor.