Wake On Lan (WOL) from Docker (Truenas Scale)

I have migrated my Homeassistant Docker install from Synology NAS to TrueNAS Scale. Everything works so far.

Only issue I have is to use the WOL command. I have it like this in my config:

  # WOL - Workstation
  - platform: wake_on_lan
    mac: 04:*****
    name: "Workstation"
    turn_off:
      service: script.workstation_shutdown

… and it worked perfectly while still running on my Synology. But it does not anymore on my Truenas Scale System. The bits of information I have is that it maybe has something to do with the kubernetes/docker implementation of Scale.

WoL requires direct Layer2 network access without routing… it could be done using the not supported host-networking section.

… I tried to run the docker container in “priveleged-mode”. But that also did not work…

Any idea how I could make it work without extra hardware … ?

I also tried the commands from this post (Wake On Lan - For those running home assistant in docker) but Scale does not seem to support those …

Host networking is required for anything unicast / multicast in docker.
You have to specify that in your docker run or docker-compose.yml, what ever you use to launch the HA container.

Yes did that … but for Truenas Scale it seems a bit more complicated. Homeassistant has also same IP (hostip:8123) and Priveleged Access.

I guess because of the kubernetes layer…

Since my Router (Fritzbox 7490) is able to WOL computers as well … is there maybe a way to send the command to the router api and let it handle the call if I can not execute on my host nas system?

I looked at the Integration (AVM FRITZ!Box Tools - Home Assistant) but it does not mention WOL …

Ok I finally got it working - turns out TrueNAS Scale requires the extra flag broadcast address and port!

WOL - Workstation

  • platform: wake_on_lan
    mac: 04*** (of target system)
    broadcast_address: 192*** (IP of target system)
    broadcast_port: 9
    name: “Workstation”
    turn_off:
    service: script.workstation_shutdown

Ok weird behaviour … it only works to wake up a machine via TrueNAS Scale when it was recently ON. After a longer time has passed the wake up command from TrueNAS does nothing. If I sent the WOL from my Mac … it works?!?