Alexa Message Board (now with Slack!)

Motivation

The Amazon Echo and the Alexa assistant are amazing innovations that enable many daily life interactions. Already incorporated in my morning routine, one of the first things I do when I wake up is ask Alexa about the current weather. Now that winter is coming, I usually do it from under my blankets. Before getting out of bed I also want to know what is the temperature in my apartment so I know how to face it.

motivation

I live in an older apartment building where smart thermostats are out of the question. My main baseboard heaters are controlled by old-school thermostats but I have an additional radiator connected to a smart plug (TP-Link) that I can turn on and off using Alexa. I still needed to know how cold is it before deciding whether I want to turn it on and stay a little longer in bed.

Solution

The solution to my problem was to plug a USB thermometer (TEMPer) to an extra Raspberry Pi I had lying around and have it talk to Alexa. I couldn’t find any general purpose projects so I decided to attempt mine. The idea is quite simple, an API receives messages (such as current temperature as recorded by the Raspberry Pi) and stores them. Then Alexa can access the stored messages and read them aloud. When I first heard about the daily briefing API I was really excited about being able to incorporate these as part of the daily briefing but currently that is not yet possible.

The API is already publicly available and I plan on extending it soon. Here is a demo console that can be used to interact with the API or to send yourself reminders and other personal messages:

https://s3.amazonaws.com/aws-website-textconsole-a3cnv/messages.html

You can enable the skill here:

https://www.amazon.com/dp/B01N8YM05O/ref=sr_1_1?ie=UTF8&qid=1480088446&sr=8-1&keywords=posted+messages+skill

Temperature Monitor

To replicate my setup:

  • Check the code repository for two examples in Python and Bash for scripts that poll the current temperature and post it to the API (both tested in the current Raspbian).
  • Replace the user identifier and secret in either script and add your scripts to crontab.

Slack Slash Commands

Someone asked me if it would be possible to integrate this with Slack. There are definitely multiple ways of doing so. I opted for an easy approach, all server side. To integrate with Slack, I choose to allow users in a team to add their Alexa accounts to the team (it could be in a per-channel basis as well, just not there yet). Then, anybody can post to all the registered message boards using a slack command from any channel in a team. To enable Slack integration:

temperature-monitor

  • First create two slash commands in Slack (this is needed only once per team). Click in the dropdown next to your team name and select “Apps & integrations”, then the “Manage” tab in the top, then “Custom Integrations” tab in the left, then “Slash Commands”.
  • Click “Add Configuration”. In the configuration screen, set the Command to /postmb , set the URL to https://l7kjk6dx49.execute-api.us-east-1.amazonaws.com/prod/postedmessage/slack and set the Method to POST . The rest of the settings are optional. Click “Save Integration”.
  • Click “Add Configuration” again. Use the same URL and Method but change the command to /setupmb . Click “Save Integration”.

Read More:  Alexa Message Board (now with Slack!)


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top