Send ThingSpeak Notifications to Mi Band 4

by tulliomf in Circuits > Mobile

1560 Views, 1 Favorites, 0 Comments

Send ThingSpeak Notifications to Mi Band 4

IMG_20200824_222325.jpg
thingS - Copia.jpg

Since I bought my Xiaomi Mi Band 4, I thought about the possibility of tracking some data from my Weather Station that are available on ThingSpeak through my Mi Band 4. However, after some research, I discovered that the capabilities of Mi Band 4 are very limited and since I didn't want to develop any apps, I thought about the possibility of using notifications as a way to send data from ThingSpeak.

In this tutorial I will teach you how to use notifications in two ways:

  • Inform values within a predetermined period;
  • Inform values when the data exceeds predefined values;


It is important to remember:

That this project was carried out on a smartphone with Android OS, but it shouldn't be difficult to adapt for an Iphone;

You already need to have a project on a Weather Station's ThingSpeak or any other project. If you haven't created it yet, we recommend that you see this example ESP8266 NodeMCU With BME280 from optio50.

In practice it is very easy to carry out this project, do not be alarmed by the apparent size of the tutorial, I am doing it step by step to make everything as clear as possible!

Supplies

  • Smartphone with Android SO;
  • Xiaomi Mi Band 4;
  • Mi Fit App;
  • ThingShow App;
  • Your Meteorological Station project or any other information / data that is hosted on ThingSpeak;

Download ThingShow - ThingSpeak Visualizer

Screenshot_2020-08-24-21-51-31-172_com.android.vending - Copia.jpg
Screenshot_2020-08-25-01-46-05-900_com.miui.home.jpg
  1. First, you need to go to Google Play to download the ThingShow application (developed by devinterestdev). The app is lightweight (≅2.9 MB) and works on any Android 4.1 and up.
  2. Check that the application was installed correctly and that everything is ok

Add ThingSpeak Data to ThingShow

Screenshot_2020-08-25-01-47-37-332_com.devinterestdev.thingshow - Copia - Copia.jpg
Screenshot_2020-08-25-01-47-42-048_com.devinterestdev.thingshow - Copia.jpg
Screenshot_2020-08-25-01-47-53-747_com.devinterestdev.thingshow.jpg
Screenshot_2020-08-25-01-48-21-352_com.devinterestdev.thingshow - Copia.jpg
Screenshot_2020-08-25-01-47-37-332_com.devinterestdev.thingshow - Copia (2).jpg
Screenshot_2020-08-25-01-48-44-685_com.devinterestdev.thingshow - Copia.jpg
  1. Open the ThingShow app;
  2. Click on the + symbol (green) to add your ThingSpeak channel data;
  3. Select type (In my case I'm using a public channel);
  4. Enter your ThingSpeak channel ID and click "Open" - If the ID is correct, your basic channel information will appear below;
  5. Click the check symbol in the upper right corner.

Create a Widgets

Screenshot_2020-08-25-01-49-00-168_com.miui.home - Copia.jpg
Screenshot_2020-08-25-01-49-18-351_com.miui.home - Copia.jpg
Screenshot_2020-08-25-01-49-26-441_com.devinterestdev.thingshow - Copia.jpg
Screenshot_2020-08-25-01-50-52-246_com.devinterestdev.thingshow - Copia.jpg
Screenshot_2020-08-25-01-50-57-031_com.devinterestdev.thingshow.jpg
Screenshot_2020-08-25-01-51-57-093_com.devinterestdev.thingshow - Copia.jpg
  1. Go back to your smatphone's desktop / home screen and click on a clean area and hold until Widget options are available. If this step is different on your phone, look for Widgets options in the settings.
  2. Search for ThingShow Widgets;
  3. Click on the "+" symbol to add your ThingSpeak channel data;
  4. Choose a channel;
  5. Choose field:
  • To receive information for each time period, choose only one field;
  • If you want to receive an alert whenever any of the analyzed values exceeds any parameter, then you can choose as many fields as you like;

Notify Values Within a Predetermined Period

Screenshot_2020-08-25-01-51-05-445_com.devinterestdev.thingshow - Copia (2).jpg
Screenshot_2020-08-25-01-51-05-445_com.devinterestdev.thingshow - Copia.jpg
Screenshot_2020-08-25-01-52-05-119_com.devinterestdev.thingshow.jpg
Screenshot_2020-08-25-01-51-57-093_com.devinterestdev.thingshow.jpg
Screenshot_2020-08-25-01-53-15-325_com.miui.home - Copia.jpg

In this configuration, you will receive a notification every time you choose, which can be between 1 to 60 minutes. In my case, I chose to be informed every 60 minutes about the temperature at the Meteorological Station

  1. In "Refresh, min" choose a value of up to 60 min;
  2. Just below the channel, click on the bell symbol;
  3. Choose a value below or above to be notified - This is the "big secret" to be notified every time: you need to choose a value that you know will always be above or below. As I live in a region where the local temperature is always above 5ºC, I chose the value above 0, so every hour, the app will understand that the temperature value is above what I established and will send me a notification. Change according to your interest;
  4. Click "save";
  5. Go back to your smatphone's desktop / home screen and see that the widget has already been created and shows the temperature value and you should have received a notification on your smartphone.

Do not worry about not having received the notification on your Mi band 4 yet, we will make this configuration in the last step.

Notification When Data Exceeds Predefined Values

Screenshot_2020-08-25-01-52-42-346_com.devinterestdev.thingshow - Copia.jpg
Screenshot_2020-08-25-01-52-52-225_com.devinterestdev.thingshow.jpg
Screenshot_2020-08-25-01-53-15-325_com.miui.home - Copia (2).jpg

This configuration is similar to the previous step, with the difference that it is recommended to choose the maximum and minimum parameters and I recommend that the "Refresh, min" be of a lower value.

This way, every time one of the values exceeds the pre-established parameters, you will receive a notification.

Widgets information can also be seen on your smarthphone screen.

Set Up Mi Fit

Screenshot_2020-08-25-23-34-39-284_com.xiaomi.hm.health.jpg
Screenshot_2020-08-25-23-34-44-618_com.xiaomi.hm.health - Copia.jpg
Screenshot_2020-08-25-23-35-16-375_com.xiaomi.hm.health - Copia.jpg
Screenshot_2020-08-25-23-35-02-762_com.xiaomi.hm.health - Copia.jpg
Screenshot_2020-08-25-23-35-02-762_com.xiaomi.hm.health - Copia (2).jpg
Screenshot_2020-08-25-23-35-48-522_com.miui.home.jpg
IMG_20200824_222705.jpg

First of all remember to turn on your smartphone's bluetooth with your Mi Band 4 close by (preferably it has been previously paired).

  1. Open the Mi Fit app; Click Profile;
  2. Under "Your devices", click on your Mi Smart Band 4 bracelet;
  3. Go to "App Alerts";
  4. Activate alerts (1st) and click on "Manage apps" (2nd);
  5. Search for and check the ThingShow application;
  6. Go back and see that the app will already be activated for alerts;

If everything went smoothly, you will soon receive your notifications on your cell phone and on your Mi Band.