Wakeing up the server from my windows 10 installation using wol.exe with the command
wol.exe 123456abcdef
But when I use the switch in the app, the log viewer shows the following:
2019-12-14 07:24:54.512 [INFO ] [nhab.binding.wol.internal.WolBinding] - Wake-on-LAN packet sent [broadcastIp=myserver.lan, macaddress=123456abcdef]
==> /var/log/openhab2/events.log <==
2019-12-14 07:24:54.521 [vent.ItemStateChangedEvent] - House_Server_Lan changed from OFF to ON
For me this looks not so wrong, but the server just doesn’t wake up…
Can you help me, what I’m doing wrong? Also when I try to suspend it again, the command doesn’t seem to work. But systemctl suspend is the command I use on debian based openmediavault to send it to hibernate.
Hello Udo,
thanks a lot. Now it works and after your post and re-reading the official documentation (https://www.openhab.org/addons/bindings/wol1/) it is clear now, what they meant. I thought they were talking about not to use the OpenHab2 ip… Sorry for that.
Thanks also for your hint regarding the exec. This didn’t and doesn’t work, too. The official documentation uses the \\ and I thought this masking would be necessary.
Nevertheless, also with \ it doesn’t work. Is there a possibility to find out, why it doesn’t work? What exactly is executed? The logging only tells me
2019-12-14 16:21:11.508 [ome.event.ItemCommandEvent] - Item 'House_Server_Lan' received command OFF
2019-12-14 16:21:11.520 [vent.ItemStateChangedEvent] - House_Server_Lan changed from ON to OFF
Your Item has an Exec binding version 1 configuration. Have you installed exec1?
You can type your command on the karaf console to see if it works.
You can use a temporary rule to call your exec action and inspect results.
rule "try exec"
when
Item House_Server_Lan received command OFF
then
val String results = executeCommandLine("systemctl suspend \\192.168.0.2", 5000)
logInfo("Exec", results)
end
@rossko57: I installed the exec binding right now and will try to make it run with the new syntax.
@Udo_Hartmann: Not exactly this command. I thought it was part of the exec to execute it against the given ip. Just as the shutdown command with ip parameter.
As far as I saw on the wiki page of the exec binding, it could be possible to connect to the server via ssh and then run the systemctl suspend command on the server directly.