There are four primary ways to trigger the treat machine

1) Email

The attached code has a separate config file so that you can put your dog's email account info. Note that this has only been tested for a gmail account. This email address will be polled every 10 minutes, looking for unread emails. Apparently, if you check much more frequently, you run the risk of getting shut down by Google.

2) Adafruit IO interface

Of course, waiting for 10 minutes to see a video of your dog eating treats is, to many, an unacceptable delay so I implemented an MQTT based trigger. This gets you a real time response. Adafruit's implementation of MQTT is called Adafruit IO and I used that. Go to Adafruit IO and follow the instructions to set up an account and feed. In the config file, make sure the feed name matchs the name of the feed you created. I called mine TreatMachine.

On the Adafruit IO interface, go to the feed you created and select the Action of Add Data. Add an email address and the treat machine will then send the response content to that email address.

3) The IFTTT (If This Then That) Do App

Adafruit IO is connected to IFTTT so it was really easy to set up the IFTTT Do App to trigger the treat machine.

a) Register for IFTTT Account if you don't have one yet

b) Set up applet. IF is the Button app and THEN is Adafruit IO. If you haven't already done so, you'll need to create an Adafruit IO feed on io.adafruit.com and then select that feed on IFTTT. The data you send to Adafruit IO should be your email address

c) To use the Button app, you'll need to download it to your smartphone from IFTTT.

This gets you a real time response as well and is a lot cleaner than using the Adafruit IO interface, at least for the non programmers amongst us.

4) Alexa

The last trigger I have currently in place is Alexa. Really, it can be any Alexa in the world as long as you have control of it. For example, my nieces love Pickles but they live 3,000 miles away. I set up their Alexa to trigger the treat machine at our house. It took 5 minutes because both Alexa and Adafruit IO are on IFTTT

a) Register for IFTTT if you don't have one yet

b) Create applet. IF is Alexa and THEN is Adafruit IO. For Alexa, select something like "treat machine" or "Give [dog name] a treat". THEN is the same as Option 3 above.

Side note - If you are setting up the Alexa for multiple people, you can easily program this into IFTTT. For example, a trigger phrase for Alexa is "Give Pickles a treat from Emily" and, in IFTTT, when that phrase is received, it sends Emily's email address to Adafruit IO.

This is surprisingly real time as well.

Note: the Alexa triggering method can also be used to distract the dog if, for example, you and your significant other need some alone time.