Medicine Given Alert / Email Sender
-
https://github.com/gangstead/flic-meds-alert
We have a hard time coordinating / remembering a vital medicine for my kid. It's a liquid medicine so we can't just use one of those pill cases with tiny compartments. The button lives by the medicine to be pressed whenever a dose is given. The emails serve as a record that we can check to make sure no doses have been missed. I tried to document everything I came across getting this running. It should be easy to adapt example for anyone who wants to send an email when a Flic is pressed or run any arbitrary script on their local machine.I used to do this task with a wifi bt.tn to send an email, but I think the company is defunct. It's a shame that it requires their server to continue running because it was otherwise a great solution. Glad to be hosting this all on equipment I own and email server I already pay for so hopefully it will be a more stable solution.
My only complaints with the Flic Mac App so far are:
- I can't figure out where the console logs go when a script is run. In Console app I can see bluetooth logs and I think
kill() returned unexpected error 1
is the only thing I got when my script had an error. - Why do I need to sign in with a Flic account to use the app locally? I'm not using any built in actions. This makes me worried that some day my Flic actions will no longer be runnable because they can't reach the Flic mothership even though that is not necessary for their operation.
- A couple minor annoyances like not being able to detect symlinked plugin folders and needing to use absolute paths to reference other files.
Other than that I'm pleased with the build quality and the responsiveness of the button actions.
- I can't figure out where the console logs go when a script is run. In Console app I can see bluetooth logs and I think
-
Thank you for posting this! It is really nice for us to hear about good use-cases like this.
I think bt .tn closed down (or similar) about a year ago unfortunately.
To your questions:
-
I believe that the output from both stderr and stdout is consumed within the Flic app. This is if I recall correctly. If so, no output is available. This could be changed in a future release, but for now it is the case.
-
To be honest with you, this is largely a business decision rather than a technical requirement. Sure, some features, such as IFTTT, Zapier, Microsoft Flow, need a Flic account in order to work, but in reality the app does not really need a login for most features. What I can say though is that once you are logged in, the app will not rely on our backend in order to work locally (at all). If our backend goes down your app will continue to work fine, unless of course you log out (in which case you would not be able to log back in again). I do understand your concern and if you truly want to have an offline solution with full control, then I recommend that you take a look at our https://github.com/50ButtonsEach/fliclib-linux-hci. Using that you could yourself fully implement Flic into a Raspberry Pi, for example. If you feel really motivated and don't even want to use our SDK, then you can also take a look at the Flic 2 Open Protocol Specification, but maybe that would require a fair bit of work.
-
This is mostly due to Apple’s App Sandbox . Basically the Flic app can not access any folder on your computer other than exactly /Library/Application Scripts/com.shortcutlabs.FlicMac. The app also does not have write access, only read and execute, which is why you have to manually place the files there.
Anyhow, I think it is cool what you have implemented. However, I will say that if reliability is critical to your use-case, then a purposefully build Raspberry Pi server might be a better way to go. It is more difficult to guarantee uptime on a Mac since it can go to sleep mode, software updates, etc.. I mentioned the fliclib-linux-hci earlier and I don’t think it would be very difficult for you to set that up, judging by the code you have already written
-