-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
motion is detected but never clear & messes up light #41
Comments
cc #36 I think that's reflected as a todo in the readme:
|
got it. thanks for all you are doing! |
That TODO appears to be for updating light status on motion detected. This issue is related to the fact that the motion status is never reset to "clear." Going through the code, while the internal motion flag itself is set to clear (0) each time through the status loop (and several other places), there are not times when setting the motion flag to 0 results in a "clear" MQTT message being published. A message is only published when the motion flag is set to 1 ("detected"). What's more, it is published as a retained message, so the status in the MQTT broker will always return "detected" if it is queried or on new subscriptions, whether there is motion or not. IMO, it should be either 1) managed like the other statuses with a previousMotionState and clear and detected messages posted each time it changes, or 2) should not be retained message with "detected" messages published only when motion is detected (and thus we would never expect a "clear" status). |
you likely know this one and are working on it but I just figured out (v2.56) that motion is detecting and updating mqtt it just never clears.
related, when you walk into garage and motion turns the light on, it ends up making mqtt the opposite of reality.
ie. off=on
The text was updated successfully, but these errors were encountered: