The aim of this project is to create a simple button that adds products to your Tesco shopping cart using the Wia Dot One Module. With the help of a simple button press, a product of your choice will be added to your shopping cart so that you will not forget to purchase this particular item on your next shop.
List of items required to create this project:
- Wia Dot One (Buy Yours Here)
- Dot One Button Module (Buy Yours Here)
- IFTTT Account
- Tesco UK Account
- Micro USB Cable
- Phone
- Computer
Create a Wia account with the Dot One connected. If you haven’t done so yet, you can follow this tutorial over here.
Create your account on Tesco UK by clicking this link or login using this link this link if you already have an account.
Find a product of your choice using the search bar on Tesco. In this tutorial we will search for tea.
Once the product of your choice was found. Locate the URL of the product (in our case it was https://www.tesco.com/groceries/en-GB/products/267685989)
Copy the last digits in the URL and save this number for later. This is the product ID of the tea. In our case it was “267685989”.
Login or Register for an account on IFTTT. Follow the link below
Once logged in, you should see a screen similar to this one:
Click on the “My Applets” Button on the top left corner. Once a new screen loads, you should be able to create a new Applet by clicking the black button "New Applet" on the right hand side of the screen.
Once a new page loads up, you will be able to click on the blue text “+this” as shown below.
You will be greeted with a webpage similar to this :
Proceed by typing into the search bar for "Webhooks". Once an icon similar to this one appears, click on it.
Click on the blue "Receive a web request" table as shown below :
Create an event name that will trigger. I called my event “buttonpress.”
Click on the blue txt “+that”, as shown below.
Choose the Tesco Icon
Connect your Tesco Account with IFTTT by pressing the “Connect” button. A new window should appear prompting you to login with your tesco account. Enter your login credentials.
Click on the “Add products to your basket” box.
Paste your Product ID you retrieved from the URL previously and paste it into the provided box. Once pasted, click on the “Create action” button.
A new box should appear, click on the “Finish” Icon to confirm your applet.
Click on this URL: https://ifttt.com/maker_webhooks and click on the Documentation button as shown below.
You will be greeted with a page similar to this one:
Copy the first url while replacing the “{event}” in it with “buttonpress.'
Open up Wia Dashboard: https://dashboard.wia.io/spaces and select your space
Create a new code Blocks Project. Give your project a name and press “Create Code Project.'
Configure your blocks similar to this and once completed save it and upload it to the Dot One using the Rocket Icon on the top right corner.
Press the button to the left of the Dot One to put it into Download mode once the code has been compiled successfully.
Create a New flow from the flows tab on the left hand side of the screen
Drag the “Event Created” node onto the flow canvas.
Name your event “my-event” and select your device from the box below.
Under the “Action” tab, drag the “Webhook” Node and paste your URL into the box provided from Step 20. Press the update button to save your changes.
Connect the Two nodes like this:
Open up this URL: https://www.tesco.com/groceries/en-GB/orders
If all done right your shopping cart should update with your selected product once the button on your Dot One Is pressed.
Comments