Skip to content
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

Closed
sejgit opened this issue Dec 22, 2023 · 3 comments
Closed

motion is detected but never clear & messes up light #41

sejgit opened this issue Dec 22, 2023 · 3 comments

Comments

@sejgit
Copy link

sejgit commented Dec 22, 2023

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

@joshjohanning
Copy link

cc #36

I think that's reflected as a todo in the readme:

  • Flip light status on when motion detected packet is sent

@sejgit
Copy link
Author

sejgit commented Dec 25, 2023

got it. thanks for all you are doing!

@sejgit sejgit closed this as completed Dec 25, 2023
@Goose66
Copy link

Goose66 commented Jan 10, 2024

I think that's reflected as a todo in the readme:

  • Flip light status on when motion detected packet is sent

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants