Replies: 1 comment
-
You could use a custom quirk like this: (Credit for that code goes to puddly) from zhaquirks.const import ENDPOINTS, INPUT_CLUSTERS
from zhaquirks.xiaomi import MotionCluster, OccupancyCluster
from zhaquirks.xiaomi.aqara.motion_aq2 import MotionAQ2
class FastMotionCluster(MotionCluster):
reset_s: int = 10
class FastOccupancyCluster(OccupancyCluster):
reset_s: int = 2 * 60
class FastMotionAQ2(MotionAQ2):
replacement = MotionAQ2.replacement.copy()
replacement[ENDPOINTS][1][INPUT_CLUSTERS] = [
{
MotionCluster: FastMotionCluster,
OccupancyCluster: FastOccupancyCluster,
}.get(c, c)
for c in replacement[ENDPOINTS][1][INPUT_CLUSTERS]
] This will override the motion cluster to a 10 second delay (for all "AQ2" sensors). You should be able to leave that at default 70 (or just remove the line IMO, I'd recommend just creating a template/helper entity for occupancy that's updated from the motion entity (in HA) if that's what you want to do. (So goal of decreasing occupancy timeout, leave motion timeout the same.) |
Beta Was this translation helpful? Give feedback.
-
Hi,
Somone could me guide how can I write MotionAQ2 OccupancyCluster to be able to update occupancy timeout?
Or maybe someone have it ready and can share the code
Best regards
Krzysztof
Beta Was this translation helpful? Give feedback.
All reactions