How To Make Custom Wia Notification
Read moreA nifty trick that can be done if you have a smartphone and Wia account is a notification system. You have a lot of control to customise when you receive notifications on your devices.
Figure 1
Requirements- Account on Wia
- Smartphone and Computer or Tablet
- Account at WiaYou will need to be registered and /or logged in to your Wia account athttps://www.wia.io/.
- Set up your Dot OneYou will need to have a set up Dot One and you can find the tutorial on how to do that Here.
- Set up your code projectNow you will need to create a space and then a block project on your Wia Dashboard
- Now that you have an account and the app on your smartphone or tablet you need to make the flow that will trigger a notification to be sent to selected devices.
- Create a flow and drag a Timer node, found in the Trigger tab under Wia into the workspace
- Then in the settings of the Timer node you can select when you would like to receive the notification as seen in figure 2.
Figure 2
- Now that we have chosen the time of day or frequency that you will be receiving the notification we can also choose a day of the week using a run function node and some Javascript
- Now if you want to choose day of the week drag a Run Function node, found in the Logictab under Wia, into the workspace and paste the following code into the run function.
var d = new Date();
var sunday = 0;
var monday = 1;
var tuesday = 2;
var wednesday = 3;
var thursday = 4;
var friday = 5;
var saturday = 6;
if (d.getDay() == friday)
{
output.process = true;
}
else
{
output.process = false;
}
- This code uses the Date function in Javascript to get the day of the week and output.process determines if the flow continues or not.
- Next drag a Notification node, found in the Action tab under Wia, into the workspace and select who from your space you would like to receive the notification and what it says as seen in figure 3.
Figure 3
- Note: you have to make sure that notifications on your device are enabled in your settings otherwise you will not see these notifications
- If you would rather receive a text or some other form of message feel free to use any of the other nodes.
- Now connect the nodes as seen in figure 4 and you’re all set!.
Figure 4
Spivey
82 projects • 59 followers
Tourist in a Tutu || US Born || Melbourne/Mexico/California Raised || New Yorker at ❤️ || SF to Dublin to be COO of Wia the best IoT startup
Jack Duff
32 projects • 8 followers
Man of the people. Champion of the downtrodden. Marketing magic @ Wia.
Becoming a maker by learning, building, and exploring
Comments