-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement a way to run wake up commands without trying wake on lan #149
Comments
This should already work. See the following part of the README:
By using |
Perhaps this should be clarified. If you get it working the way you'd like, could you please give some feedback on how to better explain your use case in the README? Also, see #148 where the idea is to start gathering common use cases. |
Thank you for the reply! I saw When I add a start command to the plugin's config like so;
Thus I think I'm stuck with using the Full plugin config attempting {
"name": "Nic Main PC",
"ip": "192.168.1.241",
"mac": "xx-xx-xx-xx-xx-E3",
"host": "192.168.1.241",
"pingInterval": 2,
"pingsToChange": 5,
"pingTimeout": 1,
"pingCommand": "nc -vz 192.168.1.241 4028 2>&1 | grep -i 'open'",
"pingCommandTimeout": 3,
"startCommandTimeout": 5,
"wakeGraceTime": 1,
"wakeCommandTimeout": 5,
"startCommand": "sshpass -p 'password' ssh [email protected] -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no 'cmd.exe /c C:\\Users\\UnbendableStraw\\Desktop\\start.bat'",
"shutdownGraceTime": 1,
"shutdownCommandTimeout": 5,
"shutdownCommand": "sshpass -p 'password' ssh [email protected] -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no 'cmd.exe /c C:\\Users\\UnbendableStraw\\Desktop\\stop.bat' ",
"log": true,
"logPinger": false,
"debugLog": false,
"returnEarly": true,
"accessory": "NetworkDevice"
} |
What version of homebridge-wol do you use? |
Your usage seems correct, but there seems to be a bug here: homebridge-wol/lib/network-device.js Line 197 in cfed7db
This is fixed in the latest version. Can you try to install the beta (#124)? |
That does the trick! I opted to replace those lines in network-device.js , then in my plugin config I can get away with no WoL configuration entered and it will execute the start command right away without failing: {
"name": "Plex VM",
"ip": "192.168.1.172",
"pingInterval": 10,
"pingsToChange": 2,
"pingTimeout": 1,
"pingCommand": "nc -vz 192.168.1.105 32400 2>&1 | grep -i 'open'",
"pingCommandTimeout": 1,
"startCommandTimeout": 5,
"startCommand": "sshpass -p 'password' ssh [email protected] -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no 'powershell -Command Start-VM -Name Plex'",
"shutdownCommand": "sshpass -p 'password' ssh [email protected] -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no 'powershell -Command Stop-VM -Name Plex'",
"shutdownGraceTime": 10,
"shutdownCommandTimeout": 2,
"log": true,
"logPinger": false,
"debugLog": false,
"returnEarly": true,
"accessory": "NetworkDevice"
} I was on Homebridge 1.3.2 and I just updated to 1.3.3 and its still working fine : ) Thank you! |
General idea
I'm using this plugin not to actually power machines on and off, but run either on.bat or off.bat. It works as expected when running the off command, but there are minor issues trying to use this exclusively to run commands for the on switch
a) if you don't enter the wake on lan config (i.e. mac address) the on command always fails because no WOL config was present
b) if you do enter wake on lan info it will try to send the magic packet first, then run my on command
It would be nice to see wake on lan info not required and when not provided to try running the off command anyways
The text was updated successfully, but these errors were encountered: