Wake-on-LAN

logo

This library adds a block to wake a Network device with a Wake-on-LAN packet. You need the Network binding installed and a configured device Thing. If you wish to use the MAC method, you should also provide the MAC address in the thing configuration.

Blocks

image

This block will send a Wake-on-LAN packet to the specified network device, which you can select in a popup by clicking inside the thing block. Only choose a Network device when picking the thing.
Watch out for log messages if the operation doesn’t seem to work, for instance:

java.lang.IllegalStateException: Cannot send WoL packet because the 'macAddress' is not configured for network:servicedevice:mycomputer

Changelog

Version 0.1

  • initial release

Resources

uid: wol
tags: []
props:
  parameters: []
  parameterGroups: []
component: BlockLibrary
config:
  name: Wake-on-LAN
slots:
  blocks:
    - component: BlockType
      config:
        type: send_wol
        message0: send a Wake-on-LAN packet via %1 to wake %2
        args0:
          - type: field_dropdown
            name: METHOD
            options:
              - - MAC
                - Mac
              - - IP
                - Ip
          - type: input_value
            name: DEVICE
        previousStatement: ""
        nextStatement: ""
        inputsInline: false
        colour: 0
        tooltip: ""
        helpUrl: ""
      slots:
        code:
          - component: BlockCodeTemplate
            config:
              template: >
                {{utility:things}}.getActions('network', {{input:DEVICE}}).sendWakeOnLanPacketVia{{field:METHOD}}();
        toolbox:
          - component: PresetInput
            config:
              name: DEVICE
              type: oh_thing
              shadow: true
  utilities:
    - component: UtilityJavaType
      config:
        name: things
        javaClass: org.openhab.core.model.script.actions.Things
6 Likes

Thank you very much. I‘m using it already and it‘s working perfectly :slight_smile:

1 Like

Glad to hear it! :smiley:

1 Like