Hello
I’m getting a little desperate.
I am trying to set up Wake on Lan with the network binding according to the documentation. When triggering the rule, however, I always get the error
2022-01-27 11:37:58.111 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'strom-2' failed: 'sendWakeOnLanPacketViaMac' is not a member of 'org.openhab.core.thing.binding.ThingActions'; line 43, column 17, length 34 in strom
rule snippet
val aktion = getActions("network", "network:pingdevice:computer")
if (aktion === null) {
logInfo("actions", "Actions not found, check thing ID")
return
} else {
Thread::sleep(8000)
aktion.sendWakeOnLanPacketViaMac()
}
I have also tried it with the original variable names via copy paste but that did not help either.
Binding an OH version 3.2
I think I had the same problems that you have but finally found a post in the community that works for me. Here is the example code that I am using:
var wolAction = actions.get("network","network:pingdevice:b16bfbfc7c");
wolAction.sendWakeOnLanPacketViaIp();
This is a JavaScript action in a rule, I think I created this via the JavaScripting addon, I’m not sure if I can see this somewhere in MainUI. It might also work in the built-in Nashorn Engine though, you can just try for yourself.
Unfortunately, no luck. I always write my rules as a file and not in the user interface. With the Javascript part, the whole rule doesn’t work anymore either.
Script execution of rule with UID 'strom-2' failed: An error occurred during the script execution: index=0, size=0 in strom
II don’t think so. The only way would be to adapt the functions of the binding. sendWakeOnLanPacketViaIp(); should work without problems in ECMAScript for rules. For DSL rules only sendWakeOnLanPacket
i’ve just updated to OH3.
still getting this error
'sendWakeOnLanPacketViaIp' is not a member of 'org.openhab.core.thing.binding.ThingActions'
has this still not been fixed?
Or what am i missing?
could someone tell me how to correctly implement the demo rule that is stated in the Network binding page? it simply doesnty work for me, just keeps posting that error.