

I found it simplest to just create the pipe in home assistants config directory, remember to change the path to your own:

If you choose a new location you must expose that location to your home assistant container.
Wakeonlan freebox install#
Install wakeonlan if you don’t have it alreadyĬreate a named pipe. We will use the ability of wakeonlan to read the mac-adress from a file, that file will be our named pipe which will just be waiting for us to input the mac-adress to it. See the Stackoverflow post above for some more explanation, or do a quick google.įor our purposes, they are a way of passing information from docker to the controlling host. I had never used named pipes prior to this, so I won’t go into detail how they work.
Wakeonlan freebox how to#
I also took inspiration from this thread with how to structure the switch on_command. My solution was to use named pipe, inspired by this answer from Stackoverflow I don’t want to use host network, and I was reluctant to use the ssh solution presented here (good effort and documentation though!). I wanted to post my reply in this old thread to share my solution to this, mainly because this was my first hit when searching for a solution to wake-on-lan from Docker. Now get back inside the home assistant container check that it works by doing the following :~# docker exec -it homeassistant bash one very long keyĬhange the start of the single line in the file by adding the following bit at the startĬommand="/usr/bin/wakeonlan ma:ca:dd:re:ss" ssh-rsa AAAQIUHINEFAS. It will be a one line file and look like this ssh-rsa AAA. Now as the root user on the main server edit the file \home\hawol\.ssh\authorized_keys
Wakeonlan freebox password#
Now verify you can ssh into your server from inside homeassistant docker without a password by typing Now copy to ssh key from inside the docker container on to the server Save the passkey in the default directory (press enter)Ĭhoose the passphrase as nothing (press enter twice) Now create an ssh key inside the homeassistant docker container ( more info) Now create a directory in the home assistant docker container to store the ssh key (or use portainer, click homeassistant container, then click the >_ console button ) Now get a terminal inside the homeassistant docker

If wakeonlan is an invalid command then you can install etherwake insteadĬreate a user on your server for the wakeonlanĬhange your docker-compose or docker-run for home assistant and add the following volume mapping so that the ssh key is persistant when home assistant is upgraded (similar to the /config directory). My solution is to create a user on your host server called “hawol” and it only has ssh access to a single command to send magic packet.Ĭheck the wakeonlan command works on your server (it does in ubuntu 18.04) If you run home assistant in docker and are not using network mode host, then you can’t send magic wakeonlan packets out from homeassistant inside the docker.
