-
Notifications
You must be signed in to change notification settings - Fork 18
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
Conversation
Note, this change will almost certainly require you to repair after loading this for the first time. |
Fixes #64 |
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. |
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? |
@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. |
It's saved in flash. So it's a one time activation. Don't have to reenabled after repairing. |
bb26bd1
to
c447b3b
Compare
c447b3b
to
c14907b
Compare
#include "LittleFS.h" | ||
|
||
|
||
void sync_and_restart() { |
There was a problem hiding this comment.
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.
c14907b
to
32d3cb5
Compare
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.