This is one of my favorite projects because it just seems so…. unnecessary. But cool! And cool counts for something around here.
It seems that today there is a gadget that will do just about anything. One of the exceptions to this seems to be pool thermometers that can send data to another system. There are thousands of dummy pool thermometers and not one smart one. I did some more searching on the internet and there were people that did parts of what I wanted to do. Over the course of a few weeks I was able to piece together several different areas of discovery to get a working solution. I’ll try to provide more code in the coming days.
Step 1: The Pi
Being an avid movie watcher I had been using Raspberry Pi devices to stream movies for many years using Kodi. Installing a fresh linux OS on the device was something that was already in my wheelhouse and unfortunately that’s where my comfort zone ended. How would I attach a thermometer to a pi? Hours and hours of youtube videos and a few Radio Shack runs (when there was such a thing) helped a lot. There was also this guide on the raspberry pi breadboard.
Step 2: The Data
Now that I had a working thermometer I had to be able to get the value from the pool and put it somewhere that I could get it. It turns out that there was a python library in a gitub repo that was meant for this kind of utility. After a little bit of playing I was able to get it to work. The tricky part was finding the device name of the thermometer. I’ll provide code when the pi comes out of winter storage.
There were several people that were posting the data to initialstate.com for easy viewing. I did this as well (I love to have historical data!) but that wasn’t enough for me. The problem is that initialstate.com only allows you to POST and I wanted to GET if I was going to get this working with Alexa. The solution? io.adafrauit.com allows for both POST and GET. As you can see in the endpoint below the temperature of the pool was 73 degrees on August 30th.
Step 3: AWS
I had some knowledge in this area as I had already done something similar with the my backyward weather station (a blog for another day) and my smartthings devices. I could query Alexa to find out anything from the wind speed outside to the thermostat temperature inside (see this demo to pull back live data from my PWS). I already had an AWS node.js lambda function set up with the trigger word of “backyard” (e.g. “Alexa, ask backyard for ____”). I should probably clean this up so it would pass code review but for now here is a quick snapshot of what I did. Note that the data endpoint is the adafruit URL listed in the previous step.