element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Pi Chef Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Pi Chef Design Challenge
  • More
  • Cancel
Pi Chef Design Challenge
Blog Bake Mate - Pi Chef Blog #13 - Mobile notifications using IFTTT
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: avnrdf
  • Date Created: 24 Mar 2018 1:18 PM Date Created
  • Views 1488 views
  • Likes 7 likes
  • Comments 6 comments
  • pi_chef
  • bakemate
  • pi chef - bake mate
  • bake-mate
  • pi chef design challenge
  • pi chef
  • pi-chef
Related
Recommended

Bake Mate - Pi Chef Blog #13 - Mobile notifications using IFTTT

avnrdf
avnrdf
24 Mar 2018

Bake Mate - Pi Chef Blog #13 - Mobile notifications using IFTTT

 

With the first stretch goal complete (Bake Mate - Pi Chef Blog #12 - Stretch goal 1: A visual indicator using Sense HAT's RGB LED Matrix - Part 2 ), I decided to add mobile notifications.

 

 

I had proposed a system that lets Bake Mate generate an alert when the bake timer runs down to zero, but after Bake Mate - Pi Chef Blog #6 - Measuring Oven Temperature , I realised that the thermostat in my oven isn't very accurate. Hence, Bake Mate will send periodic 'timer' notifications which reminds the user how much time remains, and 'temperature' notifications when the temperature in the oven fluctuates too far from the temperature required by the recipe..

 

Configuring IFTTT:

image

 

The notification service I'm using is the IFTTT (https://ifttt.com/ ) Webhooks (https://ifttt.com/maker_webhooks ). IFTTT (If This Then That) is a service that lets you connect different web services together to perform actions that are performed based on configurable logic.  The Webhooks service is great for maker projects: as long as you've got a device that can make (in the case of Bake Mate) or receive a web request, you can use IFTTT to 'chain' it up to perform some action.

 

IFTTT supports many services: have a look at the list over here: https://ifttt.com/search/services. I could make it tweet something, send an email, turn off a fancy WiFi enabled oven or display a message on the dashboard of a Tesla (if I had one). In this case, I'll be using IFTTT simply to generate a notification on my phone when Bake Mate makes a request.

 

To get started, create an account and go to the Webhooks page to generate an API key.

 

The page lets you test it out too: enter the {event} - think of this a 'channel', and the values you want to pass as payloads.

But hold on, you first need something that will 'monitor' the webhooks channel and do something when the event is trigger.

 

 

These screenshots (L to R) show how I set up IFTTT to generate a notification when an event is triggered (though it looks like I've mixed up the screenshots - some show BakeMateTimer, and some show BakeMateOvenTemp.

 

imageimageimageimage

imageimageimageimageimageimage

 

The last screenshot shows how IFTTT lets you format the data received as a String that is displayed in the notification. I passed the Recipe name, actual temperature and required temperature as payloads (values 1,2,3) and typed out the message I wanted to be displayed. IFTTT inserts the values as configured.

 

I tested it out using the IFTTT page, and then integrated it with the Bake Mate Python application.

import requests
IFTTT_WEBHOOKS_URL = 'https://maker.ifttt.com/trigger/{}/with/key/

def post_ifttt_webhook(event, value):
    data = {'value1': value}  # The payload 
    ifttt_event_url = IFTTT_WEBHOOKS_URL.format(event)  # Inserts  event
    requests.post(ifttt_event_url, json=data)  # Sends a HTTP POST request to the webhook URL

post_ifttt_webhook('BakeMateTimer',75)

 

To make the web request, use Python's 'requests' to post the payload (formatted as json) to the URL provided.

Bake Mate will periodically generate a notification as the timer counts down, and when it nears zero. A function in 'BakePage' also generates a notification when the temperature deviates more than 20C from the temperature required by the recipe.

 

Here's what the notification looks like for BakeMateTimer and BakeMate OvenTemp:

imageimage

 

One issue I noticed was that the notifications get delayed from time to time, though I'm not sure whether IFTTT was enforcing a rate limit because I was sending too many while testing it out. Another potential problem is that this won't work if you suddenly lose internet connectivity. A local MQTT service is an alternative, or even using the NFC board and Tasker: BakeMate sends the bake time to the phone, and Tasker sets an alarm!

 

Next time on 'Bake Mate':

 

  • Watch Bake Mate in action in the kitchen, with a real recipe!
  • Sign in to reply

Top Comments

  • DAB
    DAB over 7 years ago +2
    Nice update. DAB
  • dixonselvan
    dixonselvan over 7 years ago +2
    Hi avnrdf A nice use case for IFTT. I've been introduced to IFTT as an application (not as a service) long back and was not sure on the purpose for which it can be used. With Amazon's Alexa and a lot of…
  • e14phil
    e14phil over 7 years ago +1
    Hey avnrdf , it looks like your images are hosted privately so we can't see them. Can you download and upload them to the community so we can see them?
  • e14phil
    e14phil over 7 years ago in reply to avnrdf

    Awesome, worth the wait

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • avnrdf
    avnrdf over 7 years ago in reply to dixonselvan

    IFTTT is very useful, and they keep adding more features and support for additional services.

    I've updated the post with screenshots (which were hidden by accident), so it should be easier to follow now.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • avnrdf
    avnrdf over 7 years ago in reply to e14phil

    e14phil, I've uploaded them using the editor. I checked it by visiting the site in a private window, and it seems to be working (there should be 13 screenshots).

    I got lazy the first time and tried copying them over directly from Google Photos, which is why they were showing up for me (since I was logged in to my Google account), but not for everybody else.

     

    Thanks a lot for letting me know!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • e14phil
    e14phil over 7 years ago

    Hey avnrdf, it looks like your images are hosted privately so we can't see them.

    Can you download and upload them to the community so we can see them?

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • dixonselvan
    dixonselvan over 7 years ago

    Hi avnrdf

     

    A nice use case for IFTT. I've been introduced to IFTT as an application (not as a service) long back and was not sure on the purpose for which it can be used. With Amazon's Alexa and a lot of home automation devices creeping in, I am hearing more about IFTT. Your stretch goal explains to me what and how I can play around with IFTT.

     

    Thanks

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube