Search Icon, Magnifying Glass

Marmanold.com

Graduation CapHeartQuestion MarkMagnifying Glass

Daddy Status Page

Mon, Jul 31, 2017

A common problem for my wife and daughter since I started working from home more and more was knowing when I was on a conference call. My office has a glass door and the hallway behind it leads upstairs and to the master bedroom, so my family — understandably — likes to know if they’ll be on camera or not when they walk past. It’s also handy for them to know when they can ask me a question verbally rather than having to send me a text message from the room next door.

Back in December, my brother-in-law got me an AWS IoT button for Christmas. Over the months I’ve been pondering what to use it for and my recent “glass door status” issues gave me the perfect usecase.

Using the very friendly Serverless framework, I was able to quickly whip up a function to connect to my IoT button that would toggle the status displayed on a simple webpage my family could access from all of their devices. I’ve posted the code to do all of this on GitHub.

The currStat endpoint serves up a simple HTML page that displays a full-screen status of either “busy” or “free” with a corresponding red or green background that updates every 60 seconds to pull the most recent status. toggleStat is the AWS Lambda triggered by my IoT button. It’ll check a little JSON file stored in S3 to determine what the last status was and flip it, persisting the change back into S3.


An additional bonus to my “Daddy status page” has been its usefulness at the office. I often have folk pop into my office and start talking to me assuming I’m listening to music on my headphones, when I’m actually on a call. With my new status page, I can load the currStat endpoint on my iPhone and place that facing the door. Anyone who walks by my office can now see I’m busy!

To further simplify this process — since I don’t have an IoT button at work — I’ve created a simple Alfred workflow that allows me to update my current status even if my handy button is out of reach.

At the end of the day, Alfred is just calling my AWS Labmda using curl and passing a simple argument…

curl -X POST https://-.execute-api.us-west-2.amazonaws.com/dev/updateStat --data '{"status":"{query}"}'

I’m very happy with my little status page setup and use it daily. Hop on to GitHub and fork it for yourself. For only a few dollars, you, too, can have a quick and simple way of sharing your status with your family and co-workers.

Tags: #automation #alfred #iot #serverless #lambda #javascript #html