Friday fun with the coffee machine

While at the office today my most important mission (according to me, maybe not my boss) was to get our coffee machine hooked up to a Belkin Wemo Switch, so we didn't have to turn it on manually each day. In other words, get the damn thing on a schedule so it's ready when we meet in at the office. This monster takes about 20 minutes to get ready...

I got the machine hooked up to the Wemo Switch as a starter and got it connected to our wifi and then set the schedule - easy...After doing that an idea came to my head "what if I could start the thing from PowerShell?"...hell yes! - why not!

I then hooked up the Wemo app with IFTTT and set a incoming webhook event for "coffee_on" and "coffee_off" on IFTTT, that will trigger the switch on/off. Quickly wrote a few line of PowerShell to trigger the events - my goal was reached...but wait, there's more...

I then thought, "why not throw a notification to our MS Teams company channel, so the rest of the team can see that the machine has been turned on when arriving at work?" - hell yes, let's do that!

Wrapped it all in a function you can find below, pretty simple stuff but I did not have that much time to write it - feel free to grab the code and add some more logic to it.