Wake-On-LAN Server for Home Automation

Wake-On-LAN Server for Home Automation

This project builds a simple docker container that runs a webserver that allows you to send a wake-on-lan magic packet to the local network where the server is running by making an API call. Credit to https://github.com/sabhiram/go-wol for the magic packet code!

The intent of this service is that you have it running locally on a server in your home network as a docker container, and that it's exposed to the outside world. You can then use a webhook from a service like IFTTT or something similar to set up a voice command from a home automation assistant.

Diagram

Running The Server

I run this in kubernetes, the manifests can be found in kubernetes/ and have a few values in < brackets > that you need to configure.

No matter where you run it, the container or process needs to be running in the same network as the computer you want to send the Wake-On-LAN packet to. In kubernetes, that means the cluster has to be in the same network and you have to configure the pod with hostNetwork: true.

A docker image is published to https://hub.docker.com/repository/docker/geezyx/wolserver that can be used.

You can also build the server by cloning this repository and running go build main.go -o wolserver and then running ./wolserver or wolserver.exe if you are on windows.

Configuration

To run the server, you must provide two configuration values. If you use the manifests in the kubernetes/ folder you'll see the secret and configmap that inject these values to the deployment.

  • --api-key flag or the WOL_API_KEY env var: A value that must be passed as a query parameter apikey to the server for authorization.
  • --mac flag or WOL_MAC_ADDRESS env var: The MAC address of the network interface you want to send the magic packet to.

Triggering the Wake-On-LAN event

Make a call to /wol?apikey= and the server will attempt to send a magic packet to the configured MAC address.

I use IFTTT to automate this with google assistant. I have a voice command configured with "Turn on my computer" that sends a webhook to the /wol endpoint with the api key I configured.

Owner
Mike Gee
❤️ puzzles, code and coffee https://geezyx.keybase.pub/
Mike Gee
Similar Resources

Steam's protocol in Go to allow automation of different actions on the Steam network without running an actual Steam client

Steam's protocol in Go to allow automation of different actions on the Steam network without running an actual Steam client. Includes APIs for friends, chatting, trading, trade offers and TF2 crafting.

Jan 4, 2023

A Language Server Protocol (LSP) server for Jsonnet

Jsonnet Language Server Warning: This project is in active development and is likely very buggy. A Language Server Protocol (LSP) server for Jsonnet.

Nov 22, 2022

The server-pubsub is the main backend of DATAVOC project that manages all the other web-server modules of the same project such as the processor

server-pubsub The server-pubsub is the main backend of DATAVOC project that manages all the other web-server modules of the same project such as the p

Dec 3, 2021

server-to-server sync application, written in go/golang.

svcpy: server to server copy a basic server-to-server copy application. on a single binary, it can be a server or a client. example usage: on the serv

Nov 4, 2021

Server and client implementation of the grpc go libraries to perform unary, client streaming, server streaming and full duplex RPCs from gRPC go introduction

Description This is an implementation of a gRPC client and server that provides route guidance from gRPC Basics: Go tutorial. It demonstrates how to u

Nov 24, 2021

Pape-server - A small server written in golang to serve a random wallpaper.

pape-server I like to inject custom CSS themes into a lot of websites and electron apps, however browsers don't let websites access local disk through

Dec 31, 2021

Cert bound sts server - Certificate Bound Tokens using Security Token Exchange Server (STS)

Cert bound sts server - Certificate Bound Tokens using Security Token Exchange Server (STS)

Certificate Bound Tokens using Security Token Exchange Server (STS) Sample demonstration of Certificate Bound Tokens acquired from a Security Token Ex

Jan 2, 2022

Echo-server - An HTTP echo server designed for testing applications and proxies

echo-server An HTTP echo server designed for testing applications and proxies. R

Dec 20, 2022

Broadcast-server - A simple Go server that broadcasts any data/stream

broadcast A simple Go server that broadcasts any data/stream usage data You can

Oct 21, 2022
Related tags
A little web on the LAN
A little web on the LAN

lannet Lannet creates a little web on the LAN. It runs a fileserver daemon in the background, and hosts a homepage that links to other lannet servers

Jan 16, 2022
Connect to SagerNet in the LAN

SagerConnect Connect to SagerNet in the LAN (no configuration required) Usage Upgrade SagerNet to 0.4-rc02 or later Enable "Allow Connections from LAN

Jan 6, 2023
Quickly find all IPv6 and IPv4 hosts in a LAN.

invaentory Quickly find all IPv6 and IPv4 hosts in a LAN. Overview ?? This project is a work-in-progress! Instructions will be added as soon as it is

May 17, 2022
iflandown runs commands after the wired LAN link is down for a given amount of time.

iflandown iflandown runs commands after the wired LAN link is down for a given amount of time. All/most linux devices should work. Tested on amd64, Ra

Mar 16, 2022
Home Assistant screenshot capture web server suitable for e-ink displays

hass-shooter hass-shooter is a Home Assistant screenshot capture web server suitable for e-ink displays. Dependencies Chromium ImageMagick Installatio

Jan 28, 2022
Helping Indiranagar ka Gunda get back home at the earliest

Indiranagar ka Gunda This is the solution to a problem given to me by @exagil. The problem is as follows: Chirag is Indiranagar ka Gunda, but somehow,

Nov 27, 2021
It allows the world to access websites on home computers.

Intranet-Penetration-Go Software function: It allows the world to access websites on home computers. Principle The client runs on a home computer with

Dec 27, 2021
Go-libp2p-core. - Home to the interfaces and abstractions that make up go-libp2p

go-libp2p-core Home to the interfaces and abstractions that make up go-libp2p. I

Jan 17, 2022
Fluux XMPP is a Go XMPP library, focusing on simplicity, simple automation, and IoT.

Fluux XMPP is a Go XMPP library, focusing on simplicity, simple automation, and IoT. The goal is to make simple to write simple XMPP client

Dec 14, 2022