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

make the motion sensor dynamic. #85

Merged
merged 1 commit into from
Jan 27, 2024
Merged

Conversation

jgstroud
Copy link
Collaborator

@jgstroud jgstroud commented Jan 5, 2024

Only enable the service if a motion sensor is detected. By default the service will be disabled. On the first motion detect message, set a flag to enable the service and reboot to trigger the addition of the new service in HK. Will be permanently enabled after.

@jgstroud
Copy link
Collaborator Author

jgstroud commented Jan 5, 2024

Note, this change will almost certainly require you to repair after loading this for the first time.

@jgstroud
Copy link
Collaborator Author

jgstroud commented Jan 5, 2024

Fixes #64

@jgstroud
Copy link
Collaborator Author

jgstroud commented Jan 5, 2024

After you load this firmware, your device will show up with no motion sensor. If you have a motion sensor, then after pairing your device with HK, trigger the motion sensor. A short time later (it can take a minute), the motion device will show up in HK.

@dkerr64
Copy link
Contributor

dkerr64 commented Jan 5, 2024

Given that the Arduino HomeKit stack is buggy (It regularly and randomly un-pairs for me), I think it wise to hold off merging this until we have the Espressif HomeKit stack... which will hopefully be more reliable.

My concern is the need to go and activate the motion detector every re-pair (which for me is too often).

Also, Apple Home deletes any automations attached to an accessory if that accessory is removed. So we want this to be a once-and-done thing.

Or maybe I'm missing something... once a motion detector is found, is that saved for good in EEPROM (like WiFi SSID/PW) or filesystem such that un-pair and re-pair will not require a new discovery of the motion detector?

@donavanbecker
Copy link
Contributor

@dkerr64 Why not merge and release updates until that point?

@dkerr64
Copy link
Contributor

dkerr64 commented Jan 5, 2024

@dkerr64 Why not merge and release updates until that point?

I'm not against merging updates. I'm concerned that I will have to manually trigger motion to re-discover the motion detector every time I have to re-pair. If it is a once-and-done then I'm happy.

@jgstroud
Copy link
Collaborator Author

jgstroud commented Jan 5, 2024

It's saved in flash. So it's a one time activation. Don't have to reenabled after repairing.

#include "LittleFS.h"


void sync_and_restart() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function calls the GDO Security+ 2.0 "sync" operation to mind. maybe "graceful_restart"?

Only enable the service if a motion sensor is detected.
By default the service will be disabled.  On the first motion detect
message, set a flag to enable the service and reboot to trigger the
addition of the new service in HK.  Will be permanently enabled after.
@jgstroud jgstroud merged commit 8db0c5e into ratgdo:main Jan 27, 2024
@jgstroud jgstroud deleted the dynamic_motion branch March 26, 2024 21:54
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

Successfully merging this pull request may close these issues.

None yet

4 participants