Raspberry Pi + MQTT + ThingSpeak + IFTTT

  • Raspberry Pi Zero WH (Pi Zero).
  • MQTT as a bi-directional lightweight messaging protocol.
  • ThingSpeak to collect the temperature readings (via MQTT).
  • ThingSpeak’s ‘React’ to analyse if those readings go out of bound or no data is received and what action to trigger.
  • ThingHTTP to forward events to other websites (IFTTT in this tutorial).
  • IFTTT to send push messages to the phone and to send widget actions from the phone back to the Pi Zero (bi-directional).
Pi Zero-> ThingSpeak-> React-> ThingHTTP-> IFTTT-> Push-> Phone
Phone Widget-> IFTTT-> ThingSpeak-> Pi Zero
Raspberry Pi 4 Model B works as well
DS18B20 + 4.7kOhm under white heatshrink on a waterproof DS18B20 cable
$ curl https://api.thingspeak.com/update?api_key=#APIKEY#&field1=-10
$ curl https://maker.ifttt.com/trigger/FreezerGoneOffline/with/key/#WEBHOOK-KEY#&value1=-4
Trigger an alarm if power outage for 60 minutes
Trigger an alarm if temperature rises above -5ºC
$ curl https://api.thingspeak.com/update?api_key=#APIKEY#&field1=-4
python3 /home/pi/thc-freezer-monitor.py 

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
The Hacker's Choice

The Hacker's Choice

The oldest and still active security research group - The Hacker's Choice. (Founded 1995)