DDF for IKEA TRADFRI motion sensor #7243
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New DDF, in line with DDFs for other IKEA controllers (!).
The DDF handles both the gen-1 (E1525) and gen-2 (E1745) motion sensors. They use the same
modelid
; but theproductid
to tell them apart.Note that these are indeed controllers (not sensors), sending On with Timed Off on detecting motion. Light can be controlled directly (without deCONZ running) by adding them to the associated group.
The sensors won't detect next motion for the period from On Time, so we set
config.duration
based on that parameter. This is a change with respect to the C++ code, that usedconfig.delay
for that. However the DDF logic to resetstate/presence
only works forconfig/duration
, and it should be set to0
(so the C++ code usedconfig/delay
instead) or to theconfig/delay
value anyways.The duration can set between 60 and 600 seconds on the gen-1 model, using the dial on the device, and is fixed to 180 seconds on the gen-2 model. The day/night setting on the device needs to be on night, or
state/dark
will always be reported astrue
.Note that the C++ code will still add
config/delay
when motion is detected, but this is removed when deCONZ restarts.