WoL for Kodi (LibreELEC)

Hi,

I’ve spent hours trying to get this to work following multiple guides but with no luck.

Setup

  • Home Assistant running in docker (192.168.0.11/24), with the network_mode: host option and no ports mapped.
  • LibreELEC running on a dedicated NUC (192.168.0.6/24), enabled for WoL and has been used via other apps such as Yatse with success.
  • LibreELEC sits on the same subnet as docker/Home Assistant.
  • I can exec into the docker container (sudo docker exec -it home-assistant /bin/bash) and run wakeonlan LibreELEC_mac_address and the NUC/LibreELEC will wake as expected.

So, according to this: https://www.home-assistant.io/integrations/kodi, I edit the configuration.yml file and add the following:

wake_on_lan:
script:
  turn_on_kodi_with_wol:
    sequence:
      - service: wake_on_lan.send_magic_packet
        data:
          mac: c5:2f:85:01:1f:97
          broadcast_address: 192.168.0.255

According to what the documentation says, I should now be able to push the On/Off button within the LibreELEC/Kodi media player and my NUC should fire up. This is not the case however. It does nothing.
I’ve also tried the following config:

media_player:
  - platform: kodi
    host: 192.168.0.6
    username: root
    password: root_password
    turn_on_action:
      - service: wake_on_lan.send_magic_packet
        data:
          mac: c5:2f:85:01:1f:97
          broadcast_address: 192.168.0.255
    turn_off_action:
      - service: kodi.call_method
        data:
          entity_id: media_player.libreelec
          method: System.Shutdown

Everything else apart from this works. All my other devices are added and configured. This is the last part that I need to get working. After this is fixed, I’m hoping it will give me the pointers to use WoL on my NAS/ESXi hosts also.

If anyone can spot anything obvious that I’ve missed, feel free t opoint it out!!