Network Binding & Wake On LAN (WOL)

Recently, and sadly, not recently enough for me to pinpoint accurately whats broken it, my WoL functionality has broken.

I’m running OH 3.2.0 (Snapshot) and org.openhab.binding.network/3.2.0-SNAPSHOT

<feature name="openhab-binding-network" description="Network Binding" version="3.2.0.SNAPSHOT">
        <feature>openhab-runtime-base</feature>
        <feature>openhab-core-model-script</feature>
        <feature dependency="true">openhab.tp-commons-net</feature>
        <bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.network/3.2.0-SNAPSHOT</bundle>
    </feature>

I have a virtual switch (WoLNAS) that used to, until recently, run the following rule;

rule "Computers - Wake On LAN - NAS"
    when
        Item WoLNAS received command ON
    then
        val actions = getActions("network", "network:pingdevice:nas")
        if (actions === null) {
        logInfo("EXTRA", "WOL - NAS - Actions not found, check thing ID")
    return
    }
    else {
        actions.sendWakeOnLanPacket()
        logInfo("EXTRA", "WOL - NAS - Magic Packet sent to NAS")
        WoLNAS.sendCommand("OFF")
    }
end

The rule still runs as I get the relevant log entries, but the action actions.sendWakeOnLanPacket() does not seem to be working. Is there a Java dependency or similar on this? Could a Java update or something have broken the binding functionality?

I did recently install UFW and wondered if I’d broken the firewall config on the Pi on which I have OH running. Checking UFW Status revealed Port 9 wasn’t open, so I opened that (in/out) and still no joy.

I then installed etherwake on the Pi to test functionality/comms from the Pi itself, and running etherwake to initiate the magic packet does work.

Unless I’m mistaken, this points to OpenHab as being the issue.

Any thoughts? Suggestions? Things to check?

Changes in this area

This is fixed in 3.2.0.M4

1 Like

Amazing, thanks. I did search the community and didn’t find anything “recent”, but never thought about changelogs or to poke around the binding.

Fixed by simply updating actions.sendWakeOnLanPacket() to include the true bool.

rule "Computers - Wake On LAN - NAS"
    when
        Item WoLNAS received command ON
    then
        val actions = getActions("network", "network:pingdevice:nas")
    	if (actions === null) {
        logInfo("EXTRA", "WOL - NAS - Actions not found, check thing ID")
    return
	} 
	else {
    	actions.sendWakeOnLanPacket(true)
	    logInfo("EXTRA", "WOL - NAS - Magic Packet sent to NAS")
		WoLNAS.sendCommand("OFF")
	}
end```
2 Likes