Skip to content

Now you will not forget about next infusion set or CGM sensor change! This app remembers for you!

License

Notifications You must be signed in to change notification settings

simon-the-shark/BetterMemorySugarBot

Repository files navigation

BetterMemorySugarBot

forthebadge made-with-python Open Source Love svg1 Deploy Build Status Coverage Status

Now you will not forget about next infusion set or CGM sensor change! This app remembers for you!

do it yourself project

Table of contents

How does it work?

  1. every day at given time - atrigger.com automatically triggers your website
  2. BetterMemorySugarBot automatically reads last change data from your nightscout website
  3. BetterMemorySugarBot calculates your next change date
  4. BetterMemorySugarBot notifies you via IFTTT or SMS about remaing hours to approaching change. Read more about notifications here

Bugs new features or questions

You discovered some bug ?? Need some new feature? Have a question? Or maybe, you just need little help during instalation process or further usage ? Feel free to create a new issue

Instalation

  1. Fork project on Github
  2. Deploy app to heroku
  3. Configurate

Fork project on Github

  1. Create Github account or log in if you had already one.
  2. Go to this project page. (you are probably already here)
  3. Click Fork button. (picture below) doc5
  4. Click F5 on your keyboard to refresh website.
  5. You have your own fork of repository now. Since now, do all instructions there.

Creating Github account

  1. Go to this link
  2. Fill in the form and verify your humanity. Click Create an account button. (example picture below) doc1
  3. Choose free plan (default) and click Continue button. (picture below) doc2
  4. Click skip this step button. (picture below) doc3
  5. Verify your email addres (example picture below) doc4

Deploy app to Heroku

  1. Make sure you are in YOUR forked repositorium (not in original one). Read about forking here

  2. Click

    Deploy

  3. Create Heroku account. New account is highly recomended by me, because of heroku`s free dynos(read more here).

    • Fill in registration form (example picture below) doc6
    • Confirm your email addres. (example picture below) doc7
    • Set your password and click SET PASSWORD AND LOG IN button.
    • Click CLICK HERE TO PROCEED button.
  4. Fill in configuration form

  5. Click Deploy app button.

  6. Watch building logs

  7. Now you should see view like this: doc13

  8. Your app is properly deployed. Instalation process is over. Now time for configuration.

Filling in configuration form on Heroku

example picture on bottom of this tab FIELDS:

  • required:
    • App name and app_name - first of all, I apologize for duplication, but it is necessary. It`s unique name of your app. It will be used in website URL (https://<app_name>.herokuapp.com). Please make sure, that this two fields are equal.
    • heroku_token - your unique token on heroku. Go to this intructions in order to find out how to get it.
    • LANGUAGE_CODE - language of your app. Only accepted vaues are en (english)(default) or pl (polish).
    • SECRET_KEY - secret password for your app. Keep it in secret!! It will be used for authorization.
  • settable later:
    • ATRIGGER_KEY and ATRIGGER_SECRET - read more in atrigger section
    • INFUSION_SET_ALERT_FREQUENCY - amount of time beetwen infusion set changes. [in hours]
    • NIGHTSCOUT_LINK - http link to your nightscout website
    • SENSOR_ALERT_FREQUENCY - amount of time beetwen CGM sensor changes. [in hours] doc11 doc12

heroku token

heroku token is your unique API key. getting instructions:

  1. Go to this link
  2. Scroll down to API Key section (picture below)
  3. Click Reveal button
  4. Now you know your heroku token. COPY it and PASTE it to heroku_token field doc10

Configuration

  1. Configurate atrigger
  2. Configurate your notifications

atrigger configuration

  1. go to this link
  2. Fill in registration form and click Create My Account button (if had not already done this). (example picture below) doc14
  3. Now you should see page like below. (if you are not just go to this link) doc15
  4. On the picture above, I have marked API Key and API Secret. You can copy and paste them into configuration form in instalation process or set it when your app had been already deployed. (see this instructions)
  5. Verify atrigger with ATriggerVerify.txt
  6. Now you can go back to configuration instructions.
ATRIGGER_KEY and ATRIGGER_SECRET setting
  1. In order to find out how to get them, go here
  2. If you already had them, time for logging in to your website
  3. Now you should see a page like below. Now you can paste your ATRIGGER_KEY in right field and click CHANGE button. doc18
  4. You should see a green confirmation like below doc19
  5. Now you can paste your ATRIGGER_SECRET in right field and click CHANGE button. You should see similar green message. (example picture below) doc20
  6. Now your ATRIGGER_KEY and ATRIGGER_SECRET are set. Go back to atrigger configuration.

ATriggerVerify.txt

  1. Go to atrigger setup website and download verification file. (picture below) doc21
  2. Now log in to your website
  3. You should see page like below. Click gray Upload verification file button. doc22
  4. Click Choose file button and choose your ATriggerVerify.txt from your computer. (picture below) doc23
  5. Click UPLOAD button. (picture below) doc24
  6. You should see green sucess message like below. doc25

Logging in to your website

  1. Go to your website (https://<app_name>.herokuapp.com). You should see page like below. Now click IT IS MYWEBSITE buttton. doc16

  2. Now type your SECRET_KEY (it has been set during instalation process) and click LOG IN button. (example picture below) doc17

  3. You are logged in !

Notifications

BetterMemorySugarBot has two ways of notifying. I recomend notifying via IFTTT. It`s completly free, easier to set up and it is flexible. You can choose notifying via facebook messenger, push notifications from mobile app or email. Of course, you can explore this platform and combine BetterMemorySugarBot with other services on your own.Second options is SMS via Twilio API. I have to warn you, that when free credits are run out, you will have to pay for text messages. To use your free credits you do not have to give them any credit card or any other billing info. It is also a little more complicated to configurate than IFTTT. If you had decided, you can go to notifications configuration instruction

Notifications configuration instruction

  1. Log in to your website and go to menu view.
  2. Choose your notification time (custom time when notification occures). PLEASE TYPE UTC TIME. Click CHANGE. Default value is 16 (UTC). doc67
  3. Go to notifications center. doc26
  4. Choose your notifications way (you can choose both) and click CHANGE button. (picture below) doc27
  5. Now go to IFTTT configuration or to SMS configuration

IFTTT configuration

  1. If you are here, I assume you had already followed notifications configuration instruction

  2. Create account on IFTTT or if you already done this, you can log in

    • Go to this link
    • You can sign up with your social media account or just type your email and click Get started button.
    • If you had choose email registration, now type your password and click Sign up button.
  3. Now go to this link

  4. Click Connect button (picture below) doc29

  5. Click Documentation button (picture below) doc30

  6. Copy your key. (picture below) doc31

  7. Now log in to your website and go to notifications center. You should see page like below. doc32

  8. Click MANAGE IFTTT MAKERS button (picture above)

  9. Now paste your IFTTT key and click ADD button. (picture below) doc33

  10. Now you should see green message. (picture below) doc34

  11. Of course, you can add more IFTTT accounts and BetterMemorySugarBot will trigger all of them.

  12. Finally, time for creating your own notifying applet:

IFTTT Applets tutorials

Facebook Messenger

  1. Go to this link

  2. Click +this button. (picture below) doc35

  3. Search for webhooks and click it. (picture below) doc36

  4. Click Receive web request (picture below) doc37

  5. Type

    sugarbot-notification

    and click Create trigger button. (picture below) doc38

  6. Click +that button. (picture below) doc39

  7. Search for

    messenger

    and click Facebook Messenger button. (picture below) doc40

  8. Click connect button. (picture below) doc41

  9. Log in to your Facebook account

doc42

  1. Click Get Started button. (picture below) doc43

  2. You should see something like below

doc44

  1. Confirm your connection via link in your email box.(example picture below) doc45
  2. Now get back to your applet creation site.
  3. Click Send message button. (picture below)
    • if do not see the same, just click back and repeat 7th step from this instruction doc46
  4. In Message text field paste:

    {{Value1}}

  5. Click Create action button. (picture below) doc47
  6. Click Finish button and now your applet is ready.
  7. If you had done all the steps from instalation and configuration instructions, you are ready to turn this app on !!!

Push Notifications

  1. Go to this link

  2. Click +this button. (picture below) doc35

  3. Search for webhooks and click it. (picture below) doc36

  4. Click Receive web request (picture below) doc37

  5. Type

    sugarbot-notification

  6. click Create trigger button. (picture below) doc38

  7. Click +that button. (picture below) doc39

  8. Search for

    notifications

    and click Notifications button. (picture below) doc48

  9. Click connect button. (picture below) doc49

  10. Click Send notifications from the IFTTT app button. (picture below) doc50

  11. In Message field paste:

    {{Value1}}

  12. Click `Create action`` button. (picture below) doc58

  13. Click Finish button and now your applet is ready.

  14. Now you just have to download IFTTT app and log in to your account. IFTTT asks you for your number. You can give it them and they will send you a link or just download it from Google Play or App Store

  15. If you had done all the steps from instalation and configuration instructions, you are ready to turn this app on !!!

Email notifications

  1. Go to this link

  2. Click +this button. (picture below) doc35

  3. Search for webhooks and click it. (picture below) doc36

  4. Click Receive web request (picture below) doc37

  5. Type

    sugarbot-notification

  6. click Create trigger button. (picture below) doc38

  7. Click +that button. (picture below) doc39

  8. Search for

    email

    and click email button. (picture below) doc51

  9. Click connect button. (picture below) doc52

  10. Type your email and click Send PIN button. (picture below) doc53

  11. Go to your email box and copy your PIN. Paste it in PIN field. (picture below) doc54

  12. Click Connect button.

  13. Now get back to your applet creation site.

  14. Click Send me an email button. (picture below) doc55

  15. In Subject field, type your custom message subject e.g. "BetterMemorySugarBot Notification"

  16. In Body field paste:

    {{Value1}}

  17. Click Create action button. (picture below) doc59

  18. Click Finish button and now your applet is ready.

  19. If you had done all the steps from instalation and configuration instructions, you are ready to turn this app on !!!

SMS configuration

This tutorial will be avaible soon. Do you really need it?? Let me know!

Turn it on

If you had done all the steps from instalation and configuration instructions, your app is fully prepared for this final step.

  1. Log in to your website
  2. Click SEND NOTIFICATION NOW green button. (picture below) doc56
  3. You should see page similar to below one doc57
  4. Congratulations !!! Your app is working. Your first notifications has been sended ! Now every day at give time, BetterMemorySugarBot will send you a notification with remaing time. If you wants to check remaing time without notification, just click QUIET CHECKUP button in menu.

Update my site

To check, if your site is up-to-date or not you should go to your forked repo.

  1. Now look for message

    This branch is <some number> commits behind Simon-the-Shark:master. (picture below) doc60

  2. If there is no message like this, your website is up-to-date
  3. If you can see the message, your website needs to be updated. Follow the instructions below.
  4. Click Compare button doc61
  5. Click switching the base if you see that link. Otherwise, manually set the base fork drop down to your fork, and the head fork to the upstream. doc62
  6. You should see page similar to below. Click Create new pull request button doc632
  7. Type short description and click Create pull request (example picture below) doc642
  8. Click Merge pull request doc652
  9. Click Confirm merge doc68
  10. Now message in your repository should contain ahead word doc66