-
Platform information:
- Hardware: Raspberry Pi 2 Model B Rev 1.1
- OS: Raspbian GNU/Linux 9
- openHAB version: 2.2
Issue:
I have created an Item in my items file
Switch GF_LivingDining_Server "Plex Server" <poweroutlet> (GF_LivingDining, gnetwork) { wol="xxx.xxx.xxx.255#xx-xx-xx-xx-xx-xx" }
and an associated rule
rule "Switch the Plex Server off via Exec"
when
Item GF_LivingDining_Server received update OFF
then {
logInfo("switchOffPlexServer.rules", "Plex Server is being switched off")
val String FeedbackScript = executeCommandLine('net rpc shutdown -f -t 0 -U USERNAME%PASSWORD -I xxx.xxx.xxx.10', 10000)
logInfo("switchOffPlexServer.rules", FeedbackScript)
}
end
My issue is this:
If the PC is initially OFF and I toggle the state of the Switch ‘GF_LivingDining_Server’ to ON then I can see in the Log file:
[INFO ] [nhab.binding.wol.internal.WolBinding] - Wake-on-LAN packet sent [broadcastIp=xxx.xxx.xxx.255, macaddress=xxxxxxxxxxxx]
and the PC successfully turns on.
If the PC is turned on and I toggle the state from ON to OFF in the UI then the PC successfully shuts down.
ALL good so far and ALL working as expected .
However the WOL does not work again once the PC has been turned off via the rule (it is being fired and I can see it in the OpenHab logs). If the PC is turned off by logging onto the PC and choosing ‘shutdown’ manually then the WOL works as expected.
Does anyone have any idea on why the rule to shutdown the PC is then stopping the WOL command? By the way the PC is running Windows 10.
Many thanks in advance for any pointers!