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
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
thank you very much for this binding, thats very cool and helpfull.
I have one problem and iām stuck with it. I have a Ubuntu server which is not necessary to run 24/7. With my Openhab3 i would like to start it, which is working under some circumstances as followed.
I have a Openhab 3 Instance (3.2.0) running at a windows server VM on Ubuntu 18.04, installed via openhabian, which is running fine and without any problems so far. Actually i updated to 3.3 but the Problem seems to stay.
When i shut it down and send the āmagic Packetā via Openhab within a few Minutes after the shutdown, the WOL works perfectly fine and the server start booting.
If i wait for example for more then 30 minutes and send the WOL packet from openhab, the server does not wake up any more.
If i send the WOL package from my pfSense firewall or straight from the router 30minutess later or more, the server respond straight ahead and start booting. I donāt have any error messages inside the logs. Iāve implemmented the IP and MAC magic packet option inside the same rule to try both at the same time, but nothing changed. Iāve already tryed to send the magic packets multiple times with a delay in between, but no success. Iāve configured the server as a networkdevice, and selected port 9 inside the networkdevice binding settings to make sure the packet will send on the right port.
Do you have any idea or recommended settings for the binding i could try?
I would appreciate you help and/or feedback on that.
Hello everyone. I want to report an issue. I have been using this library for about a year without any problems. A few days ago I switched to OpenHAB 4.0.0 and also had to update Java to do so. Now the library no longer works and from the logs I get this message:
07:57:14.832 [ERROR] [ript.internal.ScriptEngineManagerImpl] - ScriptEngine for language 'application/javascript' could not be found for identifier: fc9a93c9-1d60-40a5-9d2b-077384451479
Doing a search on this same forum I found this:
The explanation then could be that the script needs to be updated to work with Java 17. This is my guess, I do not consider myself an expert but just a simple user of OpenHAB.
In the meantime I will find another solution, probably using the Exec binding and sending the command directly from the system. But I would like to return to this library. Thank you!!!
Will there be any update for this? Currently cannot be installed on Openhab 4.x Block library from marketplace is invalid: Couldn't find the block library in the add-on entry