Ok honestly, I have overseen this in the code example.
Nevertheless it does not work for me.
For my local NAS I have:
val actions = getActions("network", "network:pingdevice:localNAS")
actions.sendWakeOnLanPacket()
localNAS_Online.postUpdate(OFF)
Which perfectly works as intended.
I had the same for the remote NAS which is connected via LAN-LAN VPN of AVM fritzbox. It is just in another subnet. If online I can easily contact it via the IP.
Now I changed for the remote NAS to:
val actions = getActions("network", "network:pingdevice:remoteNAS")
actions.sendWakeOnLanPacketViaIp()
remoteNAS_Online.postUpdate(OFF)
And get following log:
[ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'WOL_NAS_remote' failed: val actions = getActions("network", "network:pingdevice:remoteNAS")
actions.sendWakeOnLanPacketViaIp()
remoteNAS.postUpdate(OFF)
The method sendWakeOnLanPacketViaIp() is undefined for the type ThingActions; line 2, column 91, length 24
The IP is correctly configured in the thing and I am running the latest version of the binding and openhab.
Found a comparable issue without solution:
Any idea?