I'm Alex, I build things.
Work-related stuff found here: https://github.com/alexg-axis.
A Wake on Lan plugin for Homebridge
License: MIT License
I'm Alex, I build things.
Work-related stuff found here: https://github.com/alexg-axis.
Hi!
I'm noobs in programming.
I have this problem, how can I do this step?
**Note: homebridge-wol requires extra permissions due to the use of pinging and magic packages. Start homebridge with sudo: sudo homebridge or change capabilities accordingly (setcap cap_net_raw=pe /path/to/bin/node). Systemd users can add the following lines to the [Service] section of homebridge's unit file (or create a drop-in if unit is packaged by your distro) to achieve this in a more secure way:
CapabilityBoundingSet=CAP_NET_RAW
AmbientCapabilities=CAP_NET_RAW_**
There is someone who can help me step by step?( I can only use terminal or hoimebridge app for iOS)
Thanks so much,
Gio
Based my interpretation of the README, it looks like the wakeCommand
should execute after wakeGraceTime
number of seconds have elapsed.
However, it currently looks like the wakeCommand
is executed immediately after the wol
request.
Am I misinterpreting the documentation? (listed below)
Key Description Required wakeGraceTime Number of seconds to wait after wake-up before checking online status and issuing the wakeCommand
, default45
No
I have a slightly unusual use-case, since I would like to wake a virtual machine running on a host computer that may or may not be already powered on.
I was hoping the wakeCommand
would be executed after the wakeGraceTime
so that I could turn on the vm through ssh after powering on the host.
My configuration looks like this:
{
"accessory": "NetworkDevice",
"name": "<vm-name>",
"mac": "<host-mac-address>",
"ip": "<vm-ip>",
"pingInterval": 10,
"wakeGraceTime": 45,
"wakeCommand": "ssh <host-user>@<host-ip> <start-vm-cmd>",
"shutdownGraceTime": 15,
"shutdownCommand": "ssh <host-user>@<host-ip> <shutdown-vm-cmd>"
}
When I follow these steps:
DEBUG=* homebridge -D -P ~/homebridge-wol/
<vm-name>
switchI get the following log (relevant section):
[2019-3-4 21:24:01] [<vm-name>] NetworkDevice awake cycle started for "<vm-name>" (<vm-ip-address>)
[2019-3-4 21:24:01] [<vm-name>] Attempting to wake up "<vm-name>" (<vm-ip-address>)
[2019-3-4 21:24:01] [<vm-name>] NetworkDevice "<vm-name>" (<vm-ip-address>) went from status "Offline" to "Waking Up"
[2019-3-4 21:24:01] [<vm-name>] Stopping pinger
[2019-3-4 21:24:01] [<vm-name>] Attempting to wake up "<vm-name>" (<vm-ip-address>) using "ssh <host-user>@<host-ip> <start-vm-cmd>"
[2019-3-4 21:24:01] [<vm-name>] Stopping pinger
[2019-3-4 21:24:01] [<vm-name>] Starting pinger at an interval of 10000 milli seconds
[2019-3-4 21:24:02] [<vm-name>] An error occured while trying to wake "<vm-name>" (<vm-ip-address>): Error: Command failed: ssh <host-user>@<host-ip> <start-vm-cmd>
ssh: connect to host <host-ip-address> port 22: No route to host
[2019-3-4 21:24:02] [<vm-name>] Stopping pinger
[2019-3-4 21:24:02] [<vm-name>] Starting pinger at an interval of 10000 milli seconds
[2019-3-4 21:24:02] [<vm-name>] Pinger can't see device; setting to Offline.
[2019-3-4 21:24:02] [<vm-name>] NetworkDevice "<vm-name>" (<vm-ip-address>) went from status "Waking Up" to "Offline"
If there is supposed to be a delay before issuing the wakeCommand, the following change worked for me:
diff --git a/lib/network-device.js b/lib/network-device.js
index 9492e8d..f196ae7 100644
--- a/lib/network-device.js
+++ b/lib/network-device.js
@@ -154,13 +154,16 @@ class NetworkDevice {
// Wake up using a wake command if available
if (this.config.wakeCommand) {
- exec(this.config.wakeCommand, error => {
- if (error)
- this.log('An error occured while trying to wake "%s" (%s): %s', this.config.name, this.config.ip || 'unknown ip', error);
+ setTimeout(() => {
+ exec(this.config.wakeCommand, error => {
+ this.log('Attempting to wake up "%s" (%s) using "%s"', this.config.name, this.config.ip || 'unknown ip', this.config.wakeCommand);
+ if (error)
+ this.log('An error occured while trying to wake "%s" (%s): %s', this.config.name, this.config.ip || 'unknown ip', error);
- if (this.pinger)
- this.pinger.start();
- });
+ if (this.pinger)
+ this.pinger.start();
+ })
+ }, this.config.wakeGraceTime);
woke = true;
}
Hello,
since version 3. 0. 0 no longer awakes the WINPC on
here the config:
{ "accessory": "NetworkDevice", "name": "PC-Det", "mac": "C8:60:00:14:98:B4", "ip": "192.168.23.211", "pingInterval": 45, "wakeGraceTime": 90, "shutdownGraceTime": 60, "shutdownCommand": "net rpc shutdown -f -t 60 -I 192.168.23.211 -U xxxx%xxx" },
with version 2. 1. 0 and other accessory-name it worked.
Please fix
Thank you
Edit:
I use
node 8. 4. 0
npm 5. 4. 1
I'm trying to send a shutdownCommand to Windows to remotely shut down my computer through the Home app on my iPhone/Watch, however it returns an error when the shutdown command is sent by tapping the 'off' button in my Home app. Should be possible to get this working or am I doing something completely wrong?
My configuration looks like this:
{
"bridge": {
"name": "Homebridge",
"username": "<mac-address>",
"port": 51826,
"pin": "<snip>"
},
"description": "This is an example configuration file with one fake accessory and one$
"accessories": [
{
"accessory": "NetworkDevice",
"name": "Desktop",
"mac": "<mac-address>",
"ip": "192.168.178.10",
"shutdownCommand": "shutdown -s -f -t 30 -mm \\192.168.178.10"
},
{
"accessory": "Xbox",
"name": "Xbox One",
"ipAddress": "192.168.178.16",
"liveId": "<snip>"
}
]
}
IMPORTANT!
Remove any mac addresses from the configuration by
exchanging them with <mac-address>
When I follow these steps:
DEBUG=* homebridge
I get the following log:
[4/12/2018, 9:25:49 PM] [Desktop] NetworkDevice shutdown cycle started for "Desktop" (192.168.178.10)
[4/12/2018, 9:25:49 PM] [Desktop] Stopping pinger
[4/12/2018, 9:25:49 PM] [Desktop] Starting pinger again in 15000 milli seconds
[4/12/2018, 9:25:49 PM] [Desktop] Attempting to shut down "Desktop" (192.168.178.10) using "shutdown -s -f -t 30 -mm \192.168.178.10"
[4/12/2018, 9:25:49 PM] [Desktop] NetworkDevice "Desktop" (192.168.178.10) went from status "Online" to "Shutting Down"
EventedHTTPServer [::ffff:192.168.178.19] Sending HTTP event '2.10' with data: {"characteristics":[{"aid":2,"iid":10,"value":false}]} +61ms
EventedHTTPServer [::ffff:192.168.178.22] Sending HTTP event '2.10' with data: {"characteristics":[{"aid":2,"iid":10,"value":false}]} +26ms
EventedHTTPServer [::ffff:192.168.178.22] HTTP Response is finished +131ms
EventedHTTPServer [::ffff:192.168.178.22] Writing pending HTTP event data +3ms
[4/12/2018, 9:25:49 PM] [Desktop] An error occured while trying to shut down "Desktop" (192.168.178.10): Error: Command failed: shutdown -s -f -t 30 -mm \192.168.178.10
shutdown: invalid option -- 's'
[4/12/2018, 9:25:49 PM] [Desktop] Stopping pinger
[4/12/2018, 9:25:49 PM] [Desktop] Starting pinger at an interval of 2000 milli seconds
[4/12/2018, 9:25:49 PM] [Desktop] Pinger toggled state change
[4/12/2018, 9:25:49 PM] [Desktop] NetworkDevice "Desktop" (192.168.178.10) went from status "Shutting Down" to "Online"
EventedHTTPServer [::ffff:192.168.178.19] Sending HTTP event '2.10' with data: {"characteristics":[{"aid":2,"iid":10,"value":true}]} +163ms
EventedHTTPServer [::ffff:192.168.178.22] Sending HTTP event '2.10' with data: {"characteristics":[{"aid":2,"iid":10,"value":true}]} +29ms
shutdown.exe with /:
[4/12/2018, 9:29:55 PM] [Desktop] NetworkDevice shutdown cycle started for "Desktop" (192.168.178.10)
[4/12/2018, 9:29:55 PM] [Desktop] Attempting to shut down "Desktop" (192.168.178.10) using "shutdown /s /f /t 30 /m \192.168.178.10"
[4/12/2018, 9:29:55 PM] [Desktop] NetworkDevice "Desktop" (192.168.178.10) went from status "Online" to "Shutting Down"
[4/12/2018, 9:29:55 PM] [Desktop] An error occured while trying to shut down "Desktop" (192.168.178.10): Error: Command failed: shutdown /s /f /t 30 /m \192.168.178.10
Failed to parse time specification: /s
[4/12/2018, 9:29:55 PM] [Desktop] NetworkDevice "Desktop" (192.168.178.10) went from status "Shutting Down" to "Online"
Typing out 'shutdown /s /f /t 30 /m \192.168.178.10' in cmd.exe on Windows works perfectly fine, so there's nothing wrong with the syntax.
I want to use the wol plugin to shut down my piCorePlayer running on a Raspberry Pi. When the Pi is shut down, the socket (handled by Tuya-LAN) for the Pi should be switched off.
When I am using the plugin to shut down my Pi the following happens:
[TuyaAccessory] Sending piCorePlayer {"1":true}
[4/29/2019, 9:03:57 PM] [Musikbox] NetworkDevice "Musikbox" (192.168.178.107) went from status "Offline" to "Online"
[4/29/2019, 9:04:10 PM] [Musikbox] NetworkDevice shutdown cycle started for "Musikbox" (192.168.178.107)
[4/29/2019, 9:04:10 PM] [Musikbox] Attempting to shut down "Musikbox" (192.168.178.107) using "sshpass -p 'xxxxx' ssh -oStrictHostKeyChecking=no [email protected] pcp bs"
[4/29/2019, 9:04:10 PM] [Musikbox] NetworkDevice "Musikbox" (192.168.178.107) went from status "Online" to "Shutting Down"
[TuyaAccessory] Sending piCorePlayer {"1":false}
[4/29/2019, 9:04:56 PM] [Musikbox] NetworkDevice "Musikbox" (192.168.178.107) went from status "Shutting Down" to "Offline"
In the moment where I press the Button to shut Down the Pi the Button becomes switched off in Homekit, although the Pi is only in status "Shutting Down"
Isn't it possible to let the Button in Homekit set to off when the Pi is in status "Offline"?
My configuration looks like this:
{
"accessory": "NetworkDevice",
"name": "Musikbox",
"ip": "192.168.178.107",
"pingInterval": 5,
"shutdownGraceTime": 45,
"shutdownCommand": "sshpass -p 'xxxxx' ssh -oStrictHostKeyChecking=no [email protected] pcp bs"
},
I have omitted the Log, as you can see the Log above and there is no issue in not functioning or something like that.
/usr/lib/node_modules/homebridge-wol/node_modules/net-ping/node_modules/raw-socket/index.js:47
this.wrap = new raw.SocketWrap (
I am getting this error after installing. Here is my config:
"accessory": "Computer",
"name": "Upstairs",
"mac": "40.15.8A.AE.75.C1",
"ip": "192.168.1.10"
Error: Operation not permitted
at Error (native)
at new Socket (/usr/lib/node_modules/homebridge-wol/node_modules/net-ping/node_modules/raw-socket/index.js:47:14)
at Object.exports.createSocket (/usr/lib/node_modules/homebridge-wol/node_modules/net-ping/node_modules/raw-socket/index.js:202:9)
at Session.getSocket (/usr/lib/node_modules/homebridge-wol/node_modules/net-ping/index.js:147:20)
at new Session (/usr/lib/node_modules/homebridge-wol/node_modules/net-ping/index.js:101:7)
at Object.exports.createSession (/usr/lib/node_modules/homebridge-wol/node_modules/net-ping/index.js:545:9)
at new Pinger (/usr/lib/node_modules/homebridge-wol/index.js:114:24)
at new Computer (/usr/lib/node_modules/homebridge-wol/index.js:28:16)
at Server._loadAccessories (/usr/lib/node_modules/homebridge/lib/server.js:244:29)
at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:72:38)
at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:40:10)
at Object. (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
at node.js:974:3
When Shutting Down fail , I mean command execute successful, but actually fail ,the network still active, the status will maintain Shutting Down, and the pinger cannot change back the status to Online again. I think it should change to the actual status after a timeout
Hi!
Great plugin.. I'm already using it for both my Mac Mini and Windows PC. I'm just trying to get the WOL functionality working with the mac - it sleeps fine, but detecting that it is asleep is tricky. I saw that you added pingCommand
for this, but I haven't yet found any example of how this is supposed to work.
Perhaps an example of how this should work when connecting to a Mac would be useful for others as well?
"accessory": "NetworkDevice",
"name": "Server",
"mac": "xx:xx:xx:xx:xx:xx",
"ip": "1x.x.x.x",
"pingInterval": 45,
"wakeGraceTime": 90,
"shutdownGraceTime": 15,
"shutdownCommand": "ssh [email protected] /Users/admin/shutdown.sh",
"log": true
See #49
Hi,
The WOL to my Ubuntu desktop does not work (it doesn't wake up when switched ON using homebridge-wol) for me. But if I use my Asus router's UI (where my Ubuntu desktop is connected to) to send a WOL packet, it works fine. The rest of the features (like shutdown) in homebridge-wol is working fine. Can you advise what's wrong with my setup? Thank you.
"accessories": [
{
"accessory": "Computer",
"name": "UbuntuPC",
"mac": "50:e5:49:xx:xx:xx", <<< I masked off my real MAC addr
"ip": "192.168.1.11",
"pingInterval": 45,
"wakeGraceTime": 30,
"shutdownGraceTime": 15,
"shutdownCommand": "ssh [email protected] sudo poweroff"
}
Homebridge log: Latest events first
2017-03-18 13:01:16 UbuntuPC(192.168.1.11) was just turned off
2017-03-18 13:01:16 Computer shutdown cycle started for UbuntuPC(192.168.1.11)
2017-03-18 13:01:16 Setting grace timer for UbuntuPC(192.168.1.11) for 15000ms
2017-03-18 13:01:16 Canceling currently running grace timer for UbuntuPC(192.168.1.11)
2017-03-18 13:01:16 Attempting to shut down UbuntuPC(192.168.1.11) using "ssh [email protected] sudo poweroff"
2017-03-18 13:01:16 Turn UbuntuPC(192.168.1.11) off
2017-03-18 13:01:11 UbuntuPC(192.168.1.11) was just turned on
2017-03-18 13:01:10 UbuntuPC(192.168.1.11) was just turned on
2017-03-18 13:01:10 Computer awake cycle started for UbuntuPC(192.168.1.11)
2017-03-18 13:01:10 Setting grace timer for UbuntuPC(192.168.1.11) for 90000ms
2017-03-18 13:01:10 Canceling currently running grace timer for UbuntuPC(192.168.1.11)
2017-03-18 13:01:10 UbuntuPC(192.168.1.11) was just turned on
2017-03-18 13:01:10 Attempting to wake UbuntuPC(192.168.1.11, 50:e5:49:xx:xx:xx)
2017-03-18 13:01:10 Turn UbuntuPC(192.168.1.11) on
Attempting to use this for my Ubuntu server for WOL and shutdown. I'm using oznu/docker-homebridge setup on a pi Zero W. I'm able to WOL without problems, and ping is obviously working as the status is correct in the Home app.
I'm unable to successfully perform a poweroff command via this accessory. I have tried a few things to see what's happening but I'm at a loss.
from config.json:
{ "accessory": "NetworkDevice", "name": "Server", "mac": "<mac-address>", "ip": "x.x.x.x", "pingInterval": 45, "wakeGraceTime": 120, "shutdownGraceTime": 15, "shutdownCommand": "ssh -v [email protected] sudo poweroff" },
This is what I see when I view the logs after switching off the server in the home app:
`[2018-7-10 13:53:45] [Server] NetworkDevice shutdown cycle started for "Server" (x.x.x.x)
[2018-7-10 13:53:45] [Server] Attempting to shut down "Server" (x.x.x.x) using "ssh -v [email protected] sudo poweroff"
[2018-7-10 13:53:45] [Server] NetworkDevice "Server" (x.x.x.x) went from status "Online" to "Shutting Down"
[2018-7-10 13:53:46] [Server] An error occured while trying to shut down "Server" (x.x.x.x): Error: Command failed: ssh -v [email protected] sudo poweroff
OpenSSH_7.5p1-hpn14v4, LibreSSL 2.6.3
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to x.x.x.x [x.x.x.x] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /config/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /config/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /config/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /config/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /config/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /config/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /config/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /config/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.5p1-hpn14v4
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.4
debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.4 pat OpenSSH* compat 0x04000000
debug1: Remote is NON-HPN aware
debug1: Authenticating to x.x.x.x:22 as 'USER'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: [email protected]
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: compression: none
debug1: kex: client->server cipher: [email protected] MAC: compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:
debug1: read_passphrase: can't open /dev/tty: No such device or address
Host key verification failed.
[2018-7-10 13:53:46] [Server] NetworkDevice "Server" (x.x.x.x) went from status "Shutting Down" to "Online"`
I've managed to do this exact command from a terminal session within the docker container (using homebridge-config-ui-x), which seems to run as root. I am able to ssh into the server without a password, so my key is correctly installed. I have made sure my user on the server is full sudo access.
What I can't figure out is "who" is performing the command. Is it run as root within the container? What's the difference between running the command in a terminal session, and running the command via the homebridge instance?
Pulling my (thinning) hair out, any help is appreciated
Steve
[1/7/2017, 5:46:09 PM] ERROR LOADING PLUGIN homebridge-wol:
[1/7/2017, 5:46:09 PM] Error: Cannot find module './build/Release/raw'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/index.js:4:11)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
I was attempting to re-configure homebridge-wol due to a recent move w/ switch of equipment.
I do not know what exactly happened, it didn't yell at me before. I've updated and reinstalled everything (including deleting the .homebridge folder at ~/ and /root/) to make sure something didn't corrupt or anything.
My configuration looks like this:
{
"bridge": {
"name": "Homebridge",
"username": "<Mac-address>",
"port": 51826,
"pin": "031-45-154"
},
"accessories":[
{
"accessory": "WinPC",
"name": "My Windows PC",
"http_method": "GET",
"on_url": "wol://<Mac-address>",
"off_url": "http://10.0.0.1:7879/?action=System.Shutdown",
"status_url": "http://10.0.0.1:7879/",
"sendimmediately": "yes",
"poll_status_interval": "60",
"username" : "User",
"password" : "<Mac-address>",
"powerstateOnError" : "0",
"powerstateOffError": "1"
},
{
"accessory": "NetworkDevice",
"name": "PC",
"mac": "<Mac-address>",
"ip": "10.0.0.1",
"shutdownCommand": "net rpc shutdown --ipaddress 10.0.0.1 --user redacted%redacted"
}
]
}
IMPORTANT!
Homebridge fails to load at error, so can't really debug. But, here is the console output.
[28/04/2018, 22:16:41] Loaded plugin: homebridge-winpc
[28/04/2018, 22:16:41] Registering accessory 'homebridge-winpc.WinPC'
[28/04/2018, 22:16:41] ---
[28/04/2018, 22:16:41] ====================
[28/04/2018, 22:16:41] ERROR LOADING PLUGIN homebridge-wol:
[28/04/2018, 22:16:41] SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/usr/local/lib/node_modules/homebridge-wol/index.js:1:88)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
[28/04/2018, 22:16:41] ====================
[28/04/2018, 22:16:41] Loaded config.json with 2 accessories and 0 platforms.
[28/04/2018, 22:16:41] ---
[28/04/2018, 22:16:41] Loading 2 accessories...
[28/04/2018, 22:16:41] [My Windows PC] Initializing WinPC accessory...
[28/04/2018, 22:16:41] [My Windows PC] Setting info: {"serialnumber":"Unknown","model":"Windows PC","manufacterer":"Microsoft","name":"Windows PC","softwareversion":"Unknown","manufacturer":"Microsoft"}
HAP Warning: Characteristic 00000054-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 0000003E-0000-1000-8000-0026BB765291. Adding anyway.
/usr/local/lib/node_modules/homebridge/lib/api.js:64
throw new Error("The requested accessory '" + name + "' was not registered by any plugin.");
^
Error: The requested accessory 'NetworkDevice' was not registered by any plugin.
at API.accessory (/usr/local/lib/node_modules/homebridge/lib/api.js:64:13)
at Server.str.replace.Server._loadAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:264:42)
at Server.str.replace.Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:86:38)
at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:40:10)
at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
none
In some logging statements, "unknown" has incorrectly become "unkown".
There are at least the following occurrences:
homebridge-wol/lib/network-device.js
Line 73 in 181965f
homebridge-wol/lib/network-device.js
Line 122 in 181965f
homebridge-wol/lib/network-device.js
Line 150 in 181965f
homebridge-wol/lib/network-device.js
Line 154 in 181965f
homebridge-wol/lib/network-device.js
Line 158 in 181965f
homebridge-wol/lib/network-device.js
Line 165 in 181965f
homebridge-wol/lib/network-device.js
Line 171 in 181965f
A fix should correct all these occurrences.
I get the following error when running this add on, it worked fine before I added it.
TypeError: Cannot read property 'indexOf' of undefined
at API.platform (/usr/local/lib/node_modules/homebridge/lib/api.js:92:11)
at Server._loadPlatforms (/usr/local/lib/node_modules/homebridge/lib/server.js:263:45)
at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:71:36)
at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:40:10)
at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (module.js:434:26)
at Object.Module._extensions..js (module.js:452:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:475:10)
at startup (node.js:117:18)
at node.js:951:3
Hi there!
I've installed the homebridge-wol plugin like described in the instructions.
I've also added the entry to the config.json like this:
{
"accessory": "Computer",
"name": "Boston2",
"mac": "MY_MAC_ADDRESS",
"ip": "192.168.178.12",
"pingInterval": 20,
"wakeGraceTime": 60,
"shutdownGraceTime": 15
},
Unfortunately I'm getting this error, when starting homebridge with:
hombridge
[Tue May 10 2016 19:05:19 GMT+0000 (UTC)] [Boston2] Initializing Computer accessory...
/usr/local/lib/node_modules/homebridge-wol/node_modules/net-ping/node_modules/raw-socket/index.js:47
this.wrap = new raw.SocketWrap (
^
Error: Operation not permitted
at Error (native)
at new Socket (/usr/local/lib/node_modules/homebridge-wol/node_modules/net-ping/node_modules/raw-socket/index.js:47:14)
at Object.exports.createSocket (/usr/local/lib/node_modules/homebridge-wol/node_modules/net-ping/node_modules/raw-socket/index.js:202:9)
at Session.getSocket (/usr/local/lib/node_modules/homebridge-wol/node_modules/net-ping/index.js:147:20)
at new Session (/usr/local/lib/node_modules/homebridge-wol/node_modules/net-ping/index.js:101:7)
at Object.exports.createSession (/usr/local/lib/node_modules/homebridge-wol/node_modules/net-ping/index.js:545:9)
at new Pinger (/usr/local/lib/node_modules/homebridge-wol/index.js:114:24)
at new Computer (/usr/local/lib/node_modules/homebridge-wol/index.js:28:16)
at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:244:29)
at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:72:38)
All my other plugins are setting up correctly except the wol alias Computer plugin.
It seems for me like an issue in the raw-socket module but I just want to make sure I didn't misconfigured anything.
Thanks in advance!
It has come to my attention that some wake and shutdown commands (such as net rpc ...
) may need username and passwords in the command itself. SSH, for example allows for the sensible solution to use key authentication - but not all commands may allow such a workaround. Since the current version of homebridge-wol may log the commands being used, these username and passwords may be visible in the terminal output or a log file.
This line logs the wake command which may contain secrets such as a username and or password.
This line logs the shutdown command which may contain secrets such as a username and or password.
A possible solution is to extract the first word and log only that, which may result in logs such as:
Attempting to wake up "My Windows PC" (192.168.1.151) using "net"
instead of
Attempting to wake up "My Windows PC" (192.168.1.151) using "net rpc shutdown --ipaddress 192.168.1.151 --user alex%1234"
Another solution would be to omit all details about the command used.
This issue is great for anyone that may have just started out in open source and or javascript.
When starting Homebridge, everything runs fine. The app shows the computer as off, but when I try to power on, I see homebridge stop and provide the following:
Call get for undefined, return true
/usr/local/lib/node_modules/homebridge-wol/node_modules/wake_on_lan/wake_on_lan.js:12
if (mac.length == 2 * mac_bytes + (mac_bytes - 1)) {
^
TypeError: Cannot read property 'length' of undefined
at Object.exports.createMagicPacket (/usr/local/lib/node_modules/homebridge-wol/node_modules/wake_on_lan/wake_on_lan.js:12:10)
at Object.exports.wake (/usr/local/lib/node_modules/homebridge-wol/node_modules/wake_on_lan/wake_on_lan.js:46:30)
at wake (/usr/local/lib/node_modules/homebridge-wol/index.js:69:9)
at Computer. (/usr/local/lib/node_modules/homebridge-wol/index.js:41:11)
Im trying to use a raspberry pi in conjunction with homebridge to wake a windows 10 PC but despite my best attempts it doesnt seem to work. I feel I may be missing something. Does the windows PC need to have some sort of WOL software running on it as well?
I enabled 'Allow this device to wake the computer' and 'Only allow a magic packet to wake the computer' for the Ethernet Adapter in Device Manager. I also enabled WOL in my BIOS advanced power management.
When I flip the switch on my iphone using homekit the switch will turn on and off but nothing happens to my PC. Also the switch does not accurately reflect if my PC is on or off despite having included my mac address in config.json file
This is the 2nd plugin for homebridge I am attempting. The first one works great so I think I have the installation of homebridge done ok. Homebridge is set to auto start using pm2. For this plugin I followed the installation to the best of my ability.
Based on the instruction these are the 3 commands I thought I needed to run:
sudo npm install -g homebridge-wol
sudo setcap cap_net_raw=pe /usr/bin/node
sudo apt-get install samba samba-common
My configuration looks like this:
NOTE: I AM GOING TO KEEP THE MAC ADDRESS BUT CHANGE IT A BIT BECAUSE I WANT TO KNOW IF MAYBE MY PROBLEM IS A FORMATTING ISSUE.
{
"bridge": {
"name": "Homebridge",
"username": "AA:35:3A:A3:AA:30",
"port": 51826,
"pin": "032-45-154"
},
"description": "This is an example configuration file with one fake accessory and one fake platform. You can use this as a template for creating your own configuration file containing devices you actuall$
"accessories": [{
"accessory": "webostv",
"name": "My webOS tv",
"ip": "192.168.1.24",
"mac": "7B:1B:4B:5B:22:00",
"keyFile": "/home/pi/.homebridge/lgtvKeyFile",
"mediaControl": false,
"pollingEnabled": true,
"appSwitch": [
"com.webos.app.hdmi1",
"com.webos.app.hdmi2",
"com.webos.app.hdmi3",
"com.webos.app.hdmi4"
]
},
{
"accessory": "NetworkDevice",
"name": "Gaming PC",
"mac": "32C050C2276C",
"ip": "192.168.1.41",
"shutdownCommand": "net rpc shutdown --ipaddress 192.168.1.41 --user username%password"
}
],
"platforms": []
}
PLEASE CHECK THE FAKE MAC ADDRESSES I INCLUDED TO MAKE SURE THE FORMAT IS CORRECT
When I follow these steps:
DEBUG=* homebridge
I get the following log:
pi@raspberrypi:~ $ DEBUG=* homebridge
[2019-1-1 19:36:43] Loaded config.json with 2 accessories and 0 platforms.
[2019-1-1 19:36:43] ---
[2019-1-1 19:36:43] Loaded plugin: homebridge-webos-tv
[2019-1-1 19:36:43] Registering accessory 'homebridge-webos-tv.webostv'
[2019-1-1 19:36:43] ---
[2019-1-1 19:36:43] Loaded plugin: homebridge-wol
[2019-1-1 19:36:43] Registering accessory 'homebridge-wol.NetworkDevice'
[2019-1-1 19:36:43] ---
[2019-1-1 19:36:43] Loading 0 platforms...
[2019-1-1 19:36:43] Loading 2 accessories...
[2019-1-1 19:36:43] [My webOS tv] Initializing webostv accessory...
[2019-1-1 19:36:43] [Gaming PC] Initializing NetworkDevice accessory...
[2019-1-1 19:36:43] [Gaming PC] Stopping pinger
[2019-1-1 19:36:43] [Gaming PC] Starting pinger at an interval of 2000 milli seconds
Setup Payload:
X-HM://0025IV32CL5OB
Scan this code with your HomeKit app on your iOS device to pair with Homebridge:
Or enter this code with your HomeKit app on your iOS device to pair with Homebridge:
ββββββββββββββ
β β
ββββββββββββββ
EventedHTTPServer Server listening on port 51826 +0ms
[2019-1-1 19:36:43] Homebridge is running on port 51826.
EventedHTTPServer [::ffff:192.168.1.3] New connection from client +998ms
EventedHTTPServer [::ffff:192.168.1.3] HTTP server listening on port 39641 +2ms
EventedHTTPServer [::ffff:192.168.1.3] HTTP request: /pair-verify +27ms
HAPServer [CC:34:3D:E3:CE:30] HAP Request: POST /pair-verify +2ms
HAPServer [CC:34:3D:E3:CE:30] Pair verify step 1/2 +11ms
EventedHTTPServer [::ffff:192.168.1.3] HTTP Response is finished +37ms
EventedHTTPServer [::ffff:192.168.1.3] HTTP request: /pair-verify +11ms
HAPServer [CC:34:3D:E3:CE:30] HAP Request: POST /pair-verify +0ms
HAPServer [CC:34:3D:E3:CE:30] Pair verify step 2/2 +2ms
HAPServer [CC:34:3D:E3:CE:30] Client 6A7DCF68-57D2-450D-A854-8155C7A9B0D2 verification complete +9ms
EventedHTTPServer [::ffff:192.168.1.3] HTTP Response is finished +2ms
EventedHTTPServer [::ffff:192.168.1.3] HTTP request: /accessories +9ms
HAPServer [CC:34:3D:E3:CE:30] HAP Request: GET /accessories +0ms
EventedHTTPServer [::ffff:192.168.1.3] HTTP Response is finished +6ms
EventedHTTPServer [::ffff:192.168.1.5] New connection from client +106ms
EventedHTTPServer [::ffff:192.168.1.5] HTTP server listening on port 39325 +1ms
EventedHTTPServer [::ffff:192.168.1.15] New connection from client +2ms
EventedHTTPServer [::ffff:192.168.1.15] HTTP server listening on port 43595 +1ms
EventedHTTPServer [::ffff:192.168.1.6] New connection from client +1ms
EventedHTTPServer [::ffff:192.168.1.6] HTTP server listening on port 41935 +1ms
EventedHTTPServer [::ffff:192.168.1.5] HTTP request: /pair-verify +4ms
HAPServer [CC:34:3D:E3:CE:30] HAP Request: POST /pair-verify +1ms
HAPServer [CC:34:3D:E3:CE:30] Pair verify step 1/2 +1ms
EventedHTTPServer [::ffff:192.168.1.5] HTTP Response is finished +10ms
EventedHTTPServer [::ffff:192.168.1.15] HTTP request: /pair-verify +1ms
HAPServer [CC:34:3D:E3:CE:30] HAP Request: POST /pair-verify +0ms
HAPServer [CC:34:3D:E3:CE:30] Pair verify step 1/2 +1ms
EventedHTTPServer [::ffff:192.168.1.15] HTTP Response is finished +10ms
EventedHTTPServer [::ffff:192.168.1.6] HTTP request: /pair-verify +1ms
HAPServer [CC:34:3D:E3:CE:30] HAP Request: POST /pair-verify +0ms
HAPServer [CC:34:3D:E3:CE:30] Pair verify step 1/2 +1ms
EventedHTTPServer [::ffff:192.168.1.6] HTTP Response is finished +10ms
EventedHTTPServer [::ffff:192.168.1.6] HTTP request: /pair-verify +34ms
HAPServer [CC:34:3D:E3:CE:30] HAP Request: POST /pair-verify +0ms
HAPServer [CC:34:3D:E3:CE:30] Pair verify step 2/2 +1ms
HAPServer [CC:34:3D:E3:CE:30] Client 6A7DCF68-57D2-450D-A854-8155C7A9B0D2 verification complete +3ms
EventedHTTPServer [::ffff:192.168.1.6] HTTP Response is finished +1ms
EventedHTTPServer [::ffff:192.168.1.5] HTTP request: /pair-verify +1ms
HAPServer [CC:34:3D:E3:CE:30] HAP Request: POST /pair-verify +1ms
HAPServer [CC:34:3D:E3:CE:30] Pair verify step 2/2 +0ms
HAPServer [CC:34:3D:E3:CE:30] Client 40756D61-6DFE-4294-86BD-BD5701C76432 verification complete +3ms
EventedHTTPServer [::ffff:192.168.1.5] HTTP Response is finished +1ms
EventedHTTPServer [::ffff:192.168.1.15] HTTP request: /pair-verify +1ms
HAPServer [CC:34:3D:E3:CE:30] HAP Request: POST /pair-verify +0ms
HAPServer [CC:34:3D:E3:CE:30] Pair verify step 2/2 +1ms
HAPServer [CC:34:3D:E3:CE:30] Client 6A7DCF68-57D2-450D-A854-8155C7A9B0D2 verification complete +3ms
EventedHTTPServer [::ffff:192.168.1.15] HTTP Response is finished +1ms
EventedHTTPServer [::ffff:192.168.1.14] New connection from client +1ms
EventedHTTPServer [::ffff:192.168.1.14] HTTP server listening on port 32833 +0ms
EventedHTTPServer [::ffff:192.168.1.19] New connection from client +5ms
EventedHTTPServer [::ffff:192.168.1.19] HTTP server listening on port 40021 +0ms
EventedHTTPServer [::ffff:192.168.1.6] HTTP request: /accessories +1ms
HAPServer [CC:34:3D:E3:CE:30] HAP Request: GET /accessories +0ms
EventedHTTPServer [::ffff:192.168.1.6] HTTP Response is finished +5ms
EventedHTTPServer [::ffff:192.168.1.5] HTTP request: /accessories +0ms
HAPServer [CC:34:3D:E3:CE:30] HAP Request: GET /accessories +0ms
EventedHTTPServer [::ffff:192.168.1.5] HTTP Response is finished +4ms
EventedHTTPServer [::ffff:192.168.1.15] HTTP request: /accessories +23ms
HAPServer [CC:34:3D:E3:CE:30] HAP Request: GET /accessories +1ms
EventedHTTPServer [::ffff:192.168.1.15] HTTP Response is finished +4ms
EventedHTTPServer [::ffff:192.168.1.14] HTTP request: /pair-verify +1ms
HAPServer [CC:34:3D:E3:CE:30] HAP Request: POST /pair-verify +0ms
HAPServer [CC:34:3D:E3:CE:30] Pair verify step 1/2 +1ms
EventedHTTPServer [::ffff:192.168.1.14] HTTP Response is finished +10ms
EventedHTTPServer [::ffff:192.168.1.19] HTTP request: /pair-verify +10ms
HAPServer [CC:34:3D:E3:CE:30] HAP Request: POST /pair-verify +1ms
HAPServer [CC:34:3D:E3:CE:30] Pair verify step 1/2 +0ms
EventedHTTPServer [::ffff:192.168.1.19] HTTP Response is finished +10ms
EventedHTTPServer [::ffff:192.168.1.14] HTTP request: /pair-verify +9ms
HAPServer [CC:34:3D:E3:CE:30] HAP Request: POST /pair-verify +1ms
HAPServer [CC:34:3D:E3:CE:30] Pair verify step 2/2 +0ms
HAPServer [CC:34:3D:E3:CE:30] Client 40756D61-6DFE-4294-86BD-BD5701C76432 verification complete +3ms
EventedHTTPServer [::ffff:192.168.1.14] HTTP Response is finished +1ms
EventedHTTPServer [::ffff:192.168.1.14] HTTP request: /accessories +6ms
HAPServer [CC:34:3D:E3:CE:30] HAP Request: GET /accessories +0ms
EventedHTTPServer [::ffff:192.168.1.14] HTTP Response is finished +4ms
EventedHTTPServer [::ffff:192.168.1.19] HTTP request: /pair-verify +11ms
HAPServer [CC:34:3D:E3:CE:30] HAP Request: POST /pair-verify +0ms
HAPServer [CC:34:3D:E3:CE:30] Pair verify step 2/2 +1ms
HAPServer [CC:34:3D:E3:CE:30] Client 40756D61-6DFE-4294-86BD-BD5701C76432 verification complete +3ms
EventedHTTPServer [::ffff:192.168.1.19] HTTP Response is finished +1ms
EventedHTTPServer [::ffff:192.168.1.19] HTTP request: /accessories +8ms
HAPServer [CC:34:3D:E3:CE:30] HAP Request: GET /accessories +1ms
EventedHTTPServer [::ffff:192.168.1.19] HTTP Response is finished +4ms
EventedHTTPServer [::ffff:192.168.1.5] HTTP request: /characteristics +52ms
HAPServer [CC:34:3D:E3:CE:30] HAP Request: PUT /characteristics +0ms
Accessory [Homebridge] Processing characteristic set: [{"aid":4,"iid":10,"ev":true}] +3ms
Accessory [Homebridge] Registering Characteristic "On" for events +2ms
EventedHTTPServer [::ffff:192.168.1.5] HTTP Response is finished +1ms
EventedHTTPServer [::ffff:192.168.1.5] HTTP request: /characteristics +24ms
HAPServer [CC:34:3D:E3:CE:30] HAP Request: PUT /characteristics +1ms
Accessory [Homebridge] Processing characteristic set: [{"aid":2,"iid":26,"ev":true},{"aid":2,"iid":23,"ev":true},{"aid":2,"iid":10,"ev":true},{"aid":2,"iid":17,"ev":true},{"aid":2,"iid":29,"ev":true},{"aid":2,"iid":35,"ev":true},{"aid":2,"iid":13,"ev":true},{"aid":2,"iid":14,"ev":true},{"aid":2,"iid":20,"ev":true},{"aid":2,"iid":32,"ev":true},{"aid":2,"iid":38,"ev":true}] +1ms
Accessory [Homebridge] Registering Characteristic "On" for events +0ms
Accessory [Homebridge] Registering Characteristic "On" for events +0ms
Accessory [Homebridge] Registering Characteristic "On" for events +1ms
Accessory [Homebridge] Registering Characteristic "On" for events +0ms
Accessory [Homebridge] Registering Characteristic "On" for events +0ms
Accessory [Homebridge] Registering Characteristic "On" for events +1ms
Accessory [Homebridge] Registering Characteristic "On" for events +0ms
Accessory [Homebridge] Registering Characteristic "Brightness" for events +0ms
Accessory [Homebridge] Registering Characteristic "On" for events +1ms
Accessory [Homebridge] Registering Characteristic "On" for events +0ms
Accessory [Homebridge] Registering Characteristic "On" for events +0ms
EventedHTTPServer [::ffff:192.168.1.5] HTTP Response is finished +1ms
EventedHTTPServer [::ffff:192.168.1.19] HTTP request: /characteristics +199ms
HAPServer [CC:34:3D:E3:CE:30] HAP Request: PUT /characteristics +0ms
Accessory [Homebridge] Processing characteristic set: [{"aid":4,"iid":10,"ev":true}] +1ms
Accessory [Homebridge] Registering Characteristic "On" for events +1ms
EventedHTTPServer [::ffff:192.168.1.19] HTTP Response is finished +0ms
EventedHTTPServer [::ffff:192.168.1.19] HTTP request: /characteristics +227ms
HAPServer [CC:34:3D:E3:CE:30] HAP Request: PUT /characteristics +0ms
Accessory [Homebridge] Processing characteristic set: [{"aid":2,"iid":26,"ev":true},{"aid":2,"iid":23,"ev":true},{"aid":2,"iid":10,"ev":true},{"aid":2,"iid":17,"ev":true},{"aid":2,"iid":29,"ev":true},{"aid":2,"iid":35,"ev":true},{"aid":2,"iid":13,"ev":true},{"aid":2,"iid":14,"ev":true},{"aid":2,"iid":20,"ev":true},{"aid":2,"iid":32,"ev":true},{"aid":2,"iid":38,"ev":true}] +1ms
Accessory [Homebridge] Registering Characteristic "On" for events +0ms
Accessory [Homebridge] Registering Characteristic "On" for events +1ms
Accessory [Homebridge] Registering Characteristic "On" for events +0ms
Accessory [Homebridge] Registering Characteristic "On" for events +0ms
Accessory [Homebridge] Registering Characteristic "On" for events +1ms
Accessory [Homebridge] Registering Characteristic "On" for events +0ms
Accessory [Homebridge] Registering Characteristic "On" for events +0ms
Accessory [Homebridge] Registering Characteristic "Brightness" for events +0ms
Accessory [Homebridge] Registering Characteristic "On" for events +1ms
Accessory [Homebridge] Registering Characteristic "On" for events +0ms
Accessory [Homebridge] Registering Characteristic "On" for events +0ms
EventedHTTPServer [::ffff:192.168.1.19] HTTP Response is finished +1ms
[2019-1-1 19:36:47] [My webOS tv] webOS - Error: connect EHOSTUNREACH 192.168.1.24:3000
EventedHTTPServer [::ffff:192.168.1.5] HTTP request: /characteristics?id=2.23,2.10,2.26,2.29,2.13,2.14,2.32,2.35,2.17,2.38,2.20,4.10 +11s
HAPServer [CC:34:3D:E3:CE:30] HAP Request: GET /characteristics?id=2.23,2.10,2.26,2.29,2.13,2.14,2.32,2.35,2.17,2.38,2.20,4.10 +0ms
Accessory [Homebridge] Getting value for Characteristic "On" +8ms
Accessory [Homebridge] Got Characteristic "On" value: false +4ms
Accessory [Homebridge] Getting value for Characteristic "On" +1ms
Accessory [Homebridge] Getting value for Characteristic "On" +9ms
Accessory [Homebridge] Got Characteristic "On" value: false +1ms
Accessory [Homebridge] Getting value for Characteristic "On" +1ms
Accessory [Homebridge] Got Characteristic "On" value: false +1ms
Accessory [Homebridge] Getting value for Characteristic "On" +0ms
Accessory [Homebridge] Got Characteristic "On" value: false +1ms
Accessory [Homebridge] Getting value for Characteristic "Brightness" +1ms
Accessory [Homebridge] Got Characteristic "Brightness" value: 0 +9ms
Accessory [Homebridge] Getting value for Characteristic "On" +1ms
Accessory [Homebridge] Got Characteristic "On" value: false +1ms
Accessory [Homebridge] Getting value for Characteristic "On" +1ms
Accessory [Homebridge] Got Characteristic "On" value: false +1ms
Accessory [Homebridge] Getting value for Characteristic "On" +0ms
Accessory [Homebridge] Got Characteristic "On" value: false +1ms
Accessory [Homebridge] Getting value for Characteristic "On" +1ms
Accessory [Homebridge] Got Characteristic "On" value: false +0ms
Accessory [Homebridge] Getting value for Characteristic "On" +1ms
Accessory [Homebridge] Got Characteristic "On" value: false +0ms
Accessory [Homebridge] Getting value for Characteristic "On" +1ms
Accessory [Homebridge] Got Characteristic "On" value: false +10ms
Accessory [Homebridge] Got Characteristic "On" value: false +3s
EventedHTTPServer [::ffff:192.168.1.5] HTTP Response is finished +4ms
EventedHTTPServer [::ffff:192.168.1.5] HTTP request: /characteristics +7s
HAPServer [CC:34:3D:E3:CE:30] HAP Request: PUT /characteristics +1ms
Accessory [Homebridge] Processing characteristic set: [{"aid":4,"iid":10,"ev":true}] +2ms
Accessory [Homebridge] Registering Characteristic "On" for events +1ms
EventedHTTPServer [::ffff:192.168.1.5] HTTP Response is finished +1ms
EventedHTTPServer [::ffff:192.168.1.5] HTTP request: /characteristics +29ms
HAPServer [CC:34:3D:E3:CE:30] HAP Request: PUT /characteristics +1ms
Accessory [Homebridge] Processing characteristic set: [{"aid":2,"iid":26,"ev":true},{"aid":2,"iid":23,"ev":true},{"aid":2,"iid":10,"ev":true},{"aid":2,"iid":17,"ev":true},{"aid":2,"iid":29,"ev":true},{"aid":2,"iid":35,"ev":true},{"aid":2,"iid":13,"ev":true},{"aid":2,"iid":14,"ev":true},{"aid":2,"iid":20,"ev":true},{"aid":2,"iid":32,"ev":true},{"aid":2,"iid":38,"ev":true}] +2ms
Accessory [Homebridge] Registering Characteristic "On" for events +1ms
Accessory [Homebridge] Registering Characteristic "On" for events +0ms
Accessory [Homebridge] Registering Characteristic "On" for events +1ms
Accessory [Homebridge] Registering Characteristic "On" for events +0ms
Accessory [Homebridge] Registering Characteristic "On" for events +1ms
Accessory [Homebridge] Registering Characteristic "On" for events +1ms
Accessory [Homebridge] Registering Characteristic "On" for events +0ms
Accessory [Homebridge] Registering Characteristic "Brightness" for events +1ms
Accessory [Homebridge] Registering Characteristic "On" for events +0ms
Accessory [Homebridge] Registering Characteristic "On" for events +1ms
Accessory [Homebridge] Registering Characteristic "On" for events +0ms
EventedHTTPServer [::ffff:192.168.1.5] HTTP Response is finished +3ms
EventedHTTPServer [::ffff:192.168.1.14] HTTP request: /characteristics +5s
HAPServer [CC:34:3D:E3:CE:30] HAP Request: PUT /characteristics +0ms
Accessory [Homebridge] Processing characteristic set: [{"aid":4,"iid":10,"value":1}] +2ms
Accessory [Homebridge] Setting Characteristic "On" to value 1 +0ms
[2019-1-1 19:37:12] [Gaming PC] NetworkDevice awake cycle started for "Gaming PC" (192.168.1.41)
[2019-1-1 19:37:12] [Gaming PC] Stopping pinger
[2019-1-1 19:37:12] [Gaming PC] Starting pinger again in 45000 milli seconds
[2019-1-1 19:37:12] [Gaming PC] Attempting to wake up "Gaming PC" (192.168.1.41)
[2019-1-1 19:37:12] [Gaming PC] NetworkDevice "Gaming PC" (192.168.1.41) went from status "Offline" to "Waking Up"
EventedHTTPServer [::ffff:192.168.1.5] Sending HTTP event '4.10' with data: {"characteristics":[{"aid":4,"iid":10,"value":true}]} +13ms
EventedHTTPServer [::ffff:192.168.1.19] Sending HTTP event '4.10' with data: {"characteristics":[{"aid":4,"iid":10,"value":true}]} +4ms
EventedHTTPServer [::ffff:192.168.1.14] HTTP Response is finished +12ms
EventedHTTPServer [::ffff:192.168.1.14] HTTP request: /characteristics +33s
HAPServer [CC:34:3D:E3:CE:30] HAP Request: PUT /characteristics +1ms
Accessory [Homebridge] Processing characteristic set: [{"aid":4,"iid":10,"value":0}] +2ms
Accessory [Homebridge] Setting Characteristic "On" to value 0 +1ms
EventedHTTPServer [::ffff:192.168.1.5] Sending HTTP event '4.10' with data: {"characteristics":[{"aid":4,"iid":10,"value":false}]} +2ms
EventedHTTPServer [::ffff:192.168.1.19] Sending HTTP event '4.10' with data: {"characteristics":[{"aid":4,"iid":10,"value":false}]} +3ms
EventedHTTPServer [::ffff:192.168.1.14] HTTP Response is finished +2ms
[2019-1-1 19:37:57] [Gaming PC] Stopping pinger
[2019-1-1 19:37:57] [Gaming PC] Starting pinger at an interval of 2000 milli seconds
[2019-1-1 19:37:58] [Gaming PC] Pinger can't see device; setting to Offline.
[2019-1-1 19:37:58] [Gaming PC] NetworkDevice "Gaming PC" (192.168.1.41) went from status "Waking Up" to "Offline"
From what I read I thought that with this configuration I would be able to turn on my computer as well as see if it is on or off. I dont think I will be able to turn off my computer because I did not include my username and password in the shutdown command.
I am also not sure if the reason this is not working is because of what was mentioned in the instructions about how I "may or may not need to run net rpc with sudo." I didnt know what I am supposed to do with this command since when I type it into the raspberry pi it brings a bunch of options.
Any help would be greatly appreciated. thanks!
I set up WOL for my Windows PC on my RPi. The wake command works great, but the shutdown command is producing errors.
The error NT_STATUS_OBJECT_NAME_NOT_FOUND is logged when the following shutdown command is sent:
sudo net rpc shutdown --ipaddress 192.168.1.63 --user <username>%<password>
I also tried without sudo, which produced the same error.
My configuration looks like this:
"accessories": [
{
"accessory": "NetworkDevice",
"name": "My PC",
"mac": "<mac-address>",
"ip": "192.168.1.63",
"shutdownCommand": "sudo net rpc shutdown --ipaddress 192.168.1.63 --user <username>%<password>"
}
],
[2/1/2019, 9:43:47 PM] [My PC] NetworkDevice "My PC" (192.168.1.63) went from status "Online" to "Shutting Down"
[2/1/2019, 9:43:48 PM] [My PC] An error occured while trying to shut down "My PC" (192.168.1.63): Error: Command failed: sudo net rpc shutdown --ipaddress 192.168.1.63 --user <username>%<password>
Could not initialise pipe winreg. Error was NT_STATUS_OBJECT_NAME_NOT_FOUND
just playing around with homebridge and had a sudden thought if i could use it for wol so i found this.
when I "turn on" my computer it turn itself off agian without actualy turning on my computer
My configuration looks like this:
{
"bridge": {
"name": "Homebridge",
"username": "CC:22:3D:E3:CE:30",
"port": 51826,
"pin": "031-45-154"
},
"description": "This is an example configuration file with one fake accessory and one fake platform. You can use this as a template for creating your own configuration file containing devices you actually own.",
"platforms": [
{
"platform": "yeelight",
"name": "Yeelight",
"transitions": {
"power": 400,
"brightness": 400
},
"multicast": {
"interface": "0.0.0.0"
}
}
],
"accessories": [
{
"accessory": "NetworkDevice",
"name": "Computer",
"mac": "<mac-address>",
"ip": "10.10.0.52",
"pingInterval": 45,
"wakeGraceTime": 1
},
{
"accessory": "WinPC",
"name": "My Windows PC",
"http_method": "GET",
"on_url": "wol://<mac-address>?ip=10.0.0.52",
"off_url": "http://10.0.0.52:8000/?action=System.hibernate",
"status_url": "http://10.0.0.52:8000/",
"sendimmediately": "yes",
"poll_status_interval": "1",
"username" : "User",
"password" : "password",
"powerstateOnError" : "0",
"powerstateOnConnect" : "1"
}
]
}
When I follow these steps:
DEBUG=* homebridge
I get the following log:
(node:3773) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
HAP Warning: Characteristic 00000054-0000-1000-8000-0026BB765291 not in required or optional characteristics for service 0000003E-0000-1000-8000-0026BB765291. Adding anyway.
EventedHTTPServer Server listening on port 51826 +0ms
EventedHTTPServer [::ffff:10.0.0.24] New connection from client +1s
EventedHTTPServer [::ffff:10.0.0.24] HTTP server listening on port 42155 +2ms
EventedHTTPServer [::ffff:10.0.0.24] HTTP request: /pair-verify +23ms
HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify +2ms
HAPServer [CC:22:3D:E3:CE:30] Pair verify step 1/2 +18ms
EventedHTTPServer [::ffff:10.0.0.24] HTTP Response is finished +55ms
EventedHTTPServer [::ffff:10.0.0.11] New connection from client +3ms
EventedHTTPServer [::ffff:10.0.0.11] HTTP server listening on port 45415 +1ms
EventedHTTPServer [::ffff:10.0.0.11] HTTP request: /pair-verify +7ms
HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify +1ms
HAPServer [CC:22:3D:E3:CE:30] Pair verify step 1/2 +2ms
EventedHTTPServer [::ffff:10.0.0.11] HTTP Response is finished +19ms
EventedHTTPServer [::ffff:10.0.0.24] HTTP request: /pair-verify +4ms
HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify +0ms
HAPServer [CC:22:3D:E3:CE:30] Pair verify step 2/2 +4ms
HAPServer [CC:22:3D:E3:CE:30] Client C681727E-6418-45DB-823C-FC5261D48A88 verification complete +9ms
EventedHTTPServer [::ffff:10.0.0.24] HTTP Response is finished +1ms
EventedHTTPServer [::ffff:10.0.0.24] HTTP request: /accessories +17ms
HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /accessories +1ms
EventedHTTPServer [::ffff:10.0.0.24] HTTP Response is finished +6ms
EventedHTTPServer [::ffff:10.0.0.11] HTTP request: /pair-verify +1ms
HAPServer [CC:22:3D:E3:CE:30] HAP Request: POST /pair-verify +0ms
HAPServer [CC:22:3D:E3:CE:30] Pair verify step 2/2 +1ms
HAPServer [CC:22:3D:E3:CE:30] Client C681727E-6418-45DB-823C-FC5261D48A88 verification complete +7ms
EventedHTTPServer [::ffff:10.0.0.11] HTTP Response is finished +1ms
EventedHTTPServer [::ffff:10.0.0.11] HTTP request: /accessories +104ms
HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /accessories +1ms
EventedHTTPServer [::ffff:10.0.0.11] HTTP Response is finished +3ms
EventedHTTPServer [::ffff:10.0.0.24] HTTP request: /characteristics +293ms
HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics +1ms
Accessory [Homebridge] Processing characteristic set: [{"aid":12,"iid":10,"ev":true}] +7ms
Accessory [Homebridge] Registering Characteristic "On" for events +5ms
EventedHTTPServer [::ffff:10.0.0.24] HTTP Response is finished +4ms
EventedHTTPServer [::ffff:10.0.0.24] HTTP request: /characteristics +12ms
HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics +1ms
Accessory [Homebridge] Processing characteristic set: [{"aid":14,"iid":10,"ev":true}] +2ms
Accessory [Homebridge] Registering Characteristic "On" for events +1ms
EventedHTTPServer [::ffff:10.0.0.24] HTTP Response is finished +3ms
EventedHTTPServer [::ffff:10.0.0.11] HTTP request: /characteristics +130ms
HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics +0ms
Accessory [Homebridge] Processing characteristic set: [{"aid":14,"iid":10,"ev":true}] +2ms
Accessory [Homebridge] Registering Characteristic "On" for events +0ms
EventedHTTPServer [::ffff:10.0.0.11] HTTP Response is finished +3ms
EventedHTTPServer [::ffff:10.0.0.11] HTTP request: /characteristics +12ms
HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics +1ms
Accessory [Homebridge] Processing characteristic set: [{"aid":12,"iid":10,"ev":true}] +2ms
Accessory [Homebridge] Registering Characteristic "On" for events +1ms
EventedHTTPServer [::ffff:10.0.0.11] HTTP Response is finished +2ms
EventedHTTPServer [::ffff:10.0.0.11] HTTP request: /characteristics +15ms
HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics +1ms
Accessory [Homebridge] Processing characteristic set: [{"aid":12,"iid":10,"ev":true}] +2ms
Accessory [Homebridge] Registering Characteristic "On" for events +1ms
EventedHTTPServer [::ffff:10.0.0.11] HTTP Response is finished +2ms
EventedHTTPServer [::ffff:10.0.0.11] HTTP request: /characteristics +11ms
HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics +1ms
Accessory [Homebridge] Processing characteristic set: [{"aid":14,"iid":10,"ev":true}] +2ms
Accessory [Homebridge] Registering Characteristic "On" for events +0ms
EventedHTTPServer [::ffff:10.0.0.11] HTTP Response is finished +2ms
EventedHTTPServer [::ffff:10.0.0.11] HTTP request: /characteristics?id=14.10,12.10 +27s
HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /characteristics?id=14.10,12.10 +1ms
Accessory [Homebridge] Getting value for Characteristic "On" +11ms
Accessory [Homebridge] Got Characteristic "On" value: false +5ms
Accessory [Homebridge] Getting value for Characteristic "On" +2ms
Accessory [Homebridge] Got Characteristic "On" value: false +3s
EventedHTTPServer [::ffff:10.0.0.11] HTTP Response is finished +5ms
EventedHTTPServer [::ffff:10.0.0.11] HTTP request: /characteristics?id=14.10,12.10 +4m
HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /characteristics?id=14.10,12.10 +1ms
Accessory [Homebridge] Getting value for Characteristic "On" +2ms
Accessory [Homebridge] Got Characteristic "On" value: false +1ms
Accessory [Homebridge] Getting value for Characteristic "On" +0ms
Accessory [Homebridge] Got Characteristic "On" value: false +3s
EventedHTTPServer [::ffff:10.0.0.11] HTTP Response is finished +2ms
EventedHTTPServer [::ffff:10.0.0.11] HTTP request: /characteristics +6s
HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics +0ms
Accessory [Homebridge] Processing characteristic set: [{"aid":14,"iid":10,"value":1}] +3ms
Accessory [Homebridge] Setting Characteristic "On" to value 1 +1ms
EventedHTTPServer [::ffff:10.0.0.24] Sending HTTP event '14.10' with data: {"characteristics":[{"aid":14,"iid":10,"value":true}]} +18ms
EventedHTTPServer [::ffff:10.0.0.11] Sending HTTP event '14.10' with data: {"characteristics":[{"aid":14,"iid":10,"value":true}]} +5ms
EventedHTTPServer [::ffff:10.0.0.11] HTTP Response is finished +17ms
EventedHTTPServer [::ffff:10.0.0.11] Writing pending HTTP event data +1ms
EventedHTTPServer [::ffff:10.0.0.24] Sending HTTP event '14.10' with data: {"characteristics":[{"aid":14,"iid":10,"value":false}]} +2s
EventedHTTPServer [::ffff:10.0.0.11] Sending HTTP event '14.10' with data: {"characteristics":[{"aid":14,"iid":10,"value":false}]} +6ms
EventedHTTPServer [::ffff:10.0.0.11] HTTP request: /characteristics?id=14.10,12.10 +2m
HAPServer [CC:22:3D:E3:CE:30] HAP Request: GET /characteristics?id=14.10,12.10 +1ms
Accessory [Homebridge] Getting value for Characteristic "On" +2ms
Accessory [Homebridge] Got Characteristic "On" value: false +0ms
Accessory [Homebridge] Getting value for Characteristic "On" +1ms
Accessory [Homebridge] Got Characteristic "On" value: false +3s
EventedHTTPServer [::ffff:10.0.0.11] HTTP Response is finished +2ms
EventedHTTPServer [::ffff:10.0.0.11] HTTP request: /characteristics +921ms
HAPServer [CC:22:3D:E3:CE:30] HAP Request: PUT /characteristics +1ms
Accessory [Homebridge] Processing characteristic set: [{"aid":14,"iid":10,"value":1}] +2ms
Accessory [Homebridge] Setting Characteristic "On" to value 1 +1ms
EventedHTTPServer [::ffff:10.0.0.24] Sending HTTP event '14.10' with data: {"characteristics":[{"aid":14,"iid":10,"value":true}]} +6ms
EventedHTTPServer [::ffff:10.0.0.11] Sending HTTP event '14.10' with data: {"characteristics":[{"aid":14,"iid":10,"value":true}]} +5ms
EventedHTTPServer [::ffff:10.0.0.11] HTTP Response is finished +9ms
EventedHTTPServer [::ffff:10.0.0.11] Writing pending HTTP event data +1ms
EventedHTTPServer [::ffff:10.0.0.24] Sending HTTP event '14.10' with data: {"characteristics":[{"aid":14,"iid":10,"value":false}]} +2s
EventedHTTPServer [::ffff:10.0.0.11] Sending HTTP event '14.10' with data: {"characteristics":[{"aid":14,"iid":10,"value"
Please write about things that you did not see fit the above headers.
Seems like an interesting Plugin for homebridge.
How do I install homebridge-wol?
homebridge-wol also uses Computer, making it confusing or maybe impossible to try and configure a homebridge setup with both pc-volume and wol installed.
see also JosephDuffy/homebridge-pc-volume#2
Trying to Shutdown Remote Windows Machine from my Windows Homebridge Server with this plugin but keep getting an error:
The Shutdown Command looks as follows in the config file:
"shutdownCommand": "shutdown -s -m \media-pc",
And the error in homebridge is:
An error occured while trying to shut down "PC" (10.1.1.121): Error: Command failed: shutdown -s -m \media-pc
\media-pc: The network address is invalid.(1707)
at ChildProcess.exithandler (child_process.js:304:12)
at ChildProcess.emit (events.js:196:13)
at maybeClose (internal/child_process.js:1011:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:268:5) {
killed: false,
code: 1707,
signal: null,
cmd: 'shutdown -s -m \media-pc'
Why does the log only read \media-pc and not \media-pc from the config.json file?
I can confirm that when running the following command on the homebridge PC that it will initiate the shutdown correctly: shutdown -s -m \media-pc
Any help much appreciated,
Hi,
I tried to use the below as a shutdown command but it does not work:
"shutdownCommand": "shutdown -f -r t 0"
What would be the correct way to parse through the command from a Pi to Windows system?
I've decided to do a complete code refactor to hopefully provide better readability of the code with a stricter code standard. I've also decided to try to remove the dependency on net-ping
which used raw sockets to provide ping functionality. Instead ping
is introduced which relies on the native implementations of pinging. This should remove the need for sudo permission on linux devices or at least mitigate the issue to a complete linux one where the fix is to provide the user running Homebridge with rights to ping.
All in all these changes should provide easier navigating of the code as well as improved usability in the sense that sudo rights should no longer be required.
Before the changes is pushed to the master branch as well as published to npm I'd like some feedback to see that it is working reliably on devices.
To install and test the beta, navigate to the beta branch and follow the instructions.
Hello.
For some reason it be blinking will going on/off constantly. It dosen't send the WOL request, but still responds to when i press on. This is purely "cosmetic". This only happens with NAS1, my second NAS dosen't have this problem.
log
Apr 23 20:33:41 raspberrypi homebridge[1366]: [4/23/2017, 8:33:41 PM] [NAS1] NAS1(192.168.200.200) was just turned off
Apr 23 20:33:42 raspberrypi homebridge[1366]: [4/23/2017, 8:33:42 PM] [NAS1] NAS1(192.168.200.200) was just turned on
Apr 23 20:33:46 raspberrypi homebridge[1366]: [4/23/2017, 8:33:46 PM] [NAS1] NAS1(192.168.200.200) was just turned off
Apr 23 20:33:47 raspberrypi homebridge[1366]: [4/23/2017, 8:33:47 PM] [NAS1] NAS1(192.168.200.200) was just turned on
Apr 23 20:33:51 raspberrypi homebridge[1366]: [4/23/2017, 8:33:51 PM] [NAS1] NAS1(192.168.200.200) was just turned off
Apr 23 20:33:52 raspberrypi homebridge[1366]: [4/23/2017, 8:33:52 PM] [NAS1] NAS1(192.168.200.200) was just turned on
Apr 23 20:33:56 raspberrypi homebridge[1366]: [4/23/2017, 8:33:56 PM] [NAS1] NAS1(192.168.200.200) was just turned off
Apr 23 20:33:57 raspberrypi homebridge[1366]: [4/23/2017, 8:33:57 PM] [NAS1] NAS1(192.168.200.200) was just turned on
Apr 23 20:34:01 raspberrypi homebridge[1366]: [4/23/2017, 8:34:01 PM] [NAS1] NAS1(192.168.200.200) was just turned off
Apr 23 20:34:02 raspberrypi homebridge[1366]: [4/23/2017, 8:34:02 PM] [NAS1] NAS1(192.168.200.200) was just turned on
Apr 23 20:34:06 raspberrypi homebridge[1366]: [4/23/2017, 8:34:06 PM] [NAS1] NAS1(192.168.200.200) was just turned off
Apr 23 20:34:07 raspberrypi homebridge[1366]: [4/23/2017, 8:34:07 PM] [NAS1] NAS1(192.168.200.200) was just turned on
Apr 23 20:34:11 raspberrypi homebridge[1366]: [4/23/2017, 8:34:11 PM] [NAS1] NAS1(192.168.200.200) was just turned off
Apr 23 20:34:12 raspberrypi homebridge[1366]: [4/23/2017, 8:34:12 PM] [NAS1] NAS1(192.168.200.200) was just turned on
Apr 23 20:34:16 raspberrypi homebridge[1366]: [4/23/2017, 8:34:16 PM] [NAS1] NAS1(192.168.200.200) was just turned off
Apr 23 20:34:17 raspberrypi homebridge[1366]: [4/23/2017, 8:34:17 PM] [NAS1] NAS1(192.168.200.200) was just turned on
Apr 23 20:34:21 raspberrypi homebridge[1366]: [4/23/2017, 8:34:21 PM] [NAS1] NAS1(192.168.200.200) was just turned off
Apr 23 20:34:22 raspberrypi homebridge[1366]: [4/23/2017, 8:34:22 PM] [NAS1] NAS1(192.168.200.200) was just turned on
Apr 23 20:34:26 raspberrypi homebridge[1366]: [4/23/2017, 8:34:26 PM] [NAS1] NAS1(192.168.200.200) was just turned off
Apr 23 20:34:27 raspberrypi homebridge[1366]: [4/23/2017, 8:34:27 PM] [NAS1] NAS1(192.168.200.200) was just turned on
Apr 23 20:34:31 raspberrypi homebridge[1366]: [4/23/2017, 8:34:31 PM] [NAS1] NAS1(192.168.200.200) was just turned off
Apr 23 20:34:32 raspberrypi homebridge[1366]: [4/23/2017, 8:34:32 PM] [NAS1] NAS1(192.168.200.200) was just turned on
Apr 23 20:34:36 raspberrypi homebridge[1366]: [4/23/2017, 8:34:36 PM] [NAS1] NAS1(192.168.200.200) was just turned off
Apr 23 20:34:37 raspberrypi homebridge[1366]: [4/23/2017, 8:34:37 PM] [NAS1] NAS1(192.168.200.200) was just turned on
Apr 23 20:34:41 raspberrypi homebridge[1366]: [4/23/2017, 8:34:41 PM] [NAS1] NAS1(192.168.200.200) was just turned off
Apr 23 20:34:42 raspberrypi homebridge[1366]: [4/23/2017, 8:34:42 PM] [NAS1] NAS1(192.168.200.200) was just turned on
Apr 23 20:34:46 raspberrypi homebridge[1366]: [4/23/2017, 8:34:46 PM] [NAS1] NAS1(192.168.200.200) was just turned off
Apr 23 20:34:47 raspberrypi homebridge[1366]: [4/23/2017, 8:34:47 PM] [NAS1] NAS1(192.168.200.200) was just turned on
Apr 23 20:34:51 raspberrypi homebridge[1366]: [4/23/2017, 8:34:51 PM] [NAS1] NAS1(192.168.200.200) was just turned off
Apr 23 20:34:52 raspberrypi homebridge[1366]: [4/23/2017, 8:34:52 PM] [NAS1] NAS1(192.168.200.200) was just turned on
Apr 23 20:34:56 raspberrypi homebridge[1366]: [4/23/2017, 8:34:56 PM] [NAS1] NAS1(192.168.200.200) was just turned off
Apr 23 20:34:57 raspberrypi homebridge[1366]: [4/23/2017, 8:34:57 PM] [NAS1] NAS1(192.168.200.200) was just turned on
Apr 23 20:35:01 raspberrypi homebridge[1366]: [4/23/2017, 8:35:01 PM] [NAS1] NAS1(192.168.200.200) was just turned off
Apr 23 20:35:02 raspberrypi homebridge[1366]: [4/23/2017, 8:35:02 PM] [NAS1] NAS1(192.168.200.200) was just turned on
Apr 23 20:35:06 raspberrypi homebridge[1366]: [4/23/2017, 8:35:06 PM] [NAS1] NAS1(192.168.200.200) was just turned off
Apr 23 20:35:07 raspberrypi homebridge[1366]: [4/23/2017, 8:35:07 PM] [NAS1] NAS1(192.168.200.200) was just turned on
Apr 23 20:35:11 raspberrypi homebridge[1366]: [4/23/2017, 8:35:11 PM] [NAS1] NAS1(192.168.200.200) was just turned off
Apr 23 20:35:12 raspberrypi homebridge[1366]: [4/23/2017, 8:35:12 PM] [NAS1] NAS1(192.168.200.200) was just turned on
Apr 23 20:35:16 raspberrypi homebridge[1366]: [4/23/2017, 8:35:16 PM] [NAS1] NAS1(192.168.200.200) was just turned off
Apr 23 20:35:17 raspberrypi homebridge[1366]: [4/23/2017, 8:35:17 PM] [NAS1] NAS1(192.168.200.200) was just turned on
Apr 23 20:35:21 raspberrypi homebridge[1366]: [4/23/2017, 8:35:21 PM] [NAS1] NAS1(192.168.200.200) was just turned off
Apr 23 20:35:22 raspberrypi homebridge[1366]: [4/23/2017, 8:35:22 PM] [NAS1] NAS1(192.168.200.200) was just turned on
Apr 23 20:35:26 raspberrypi homebridge[1366]: [4/23/2017, 8:35:26 PM] [NAS1] NAS1(192.168.200.200) was just turned off
Apr 23 20:35:27 raspberrypi homebridge[1366]: [4/23/2017, 8:35:27 PM] [NAS1] NAS1(192.168.200.200) was just turned on
config.json
`{
"bridge": {
"name": "Homebridge",
"username": "CC:22:3D:E3:CE:30",
"port": 51826,
"pin": "031-45-154"
},
"description": "This is an example configuration file with one fake accessory and one fake platform. You can use this as a template for creating your own configuration file containing devices you actually own.",
"accessories": [{
"accessory": "Computer",
"name": "NAS2",
"mac": "24:5E:BE:0D:79:3B",
"ip": "192.168.200.202"
},
{
"accessory": "Computer",
"name": "NAS",
"mac": "00:08:9B:CA:21:82",
"ip": "192.168.200.200"
},
{
"accessory": "Computer",
"name": "Mediacenter1",
"mac": "1C:B7:2C:B1:6F:D3",
"ip": "192.168.200.210"
},
{
"accessory": "PiTemperature",
"name": "Raspberry PI Temperature"
}
],
"platforms": []
}`
root@raspberrypi:/home/pi# node -v
v6.10.2
root@raspberrypi:/home/pi# npm -v
3.10.10
Linux raspberrypi 4.4.50+ #970 Mon Feb 20 19:12:50 GMT 2017 armv6l GNU/Linux
Hello,
Great plugin! I am utilizing the ping interval feature and wish to keep it at a short duration, but don't want my logs to grow to humongous proportions.
Can there be a way to limit the logging to hide all of the "Pinging x.x.x.x" entries but still keep the other logging entries as they are?
Thanks!
Hey,
I am having an issue getting this working. Hopefully someone can point out where I am going wrong! PLEASE HELP!
I am running Homebridge on a Mac mini and have this setup to wake/shutdown an iMac.
I have setup SSH so that I can SSH from the Mac mini to the iMac without a password and that works fine.
If I run the 'ssh 192.168.1.xx sudo shutdown -h now' command from terminal on the Mac mini then the iMac shutdown as expected.
However, when I attempt to toggle the switch to off I get the following:
[4/7/2019, 4:18:21 PM] [iMac] NetworkDevice shutdown cycle started for "iMac" (192.168.1.xx)
[4/7/2019, 4:18:21 PM] [iMac] Attempting to shut down "iMac" (192.168.1.xx) using "ssh 192.168.1.xx sudo shutdown -h now"
[4/7/2019, 4:18:21 PM] [iMac] NetworkDevice "iMac" (192.168.1.xx) went from status "Online" to "Shutting Down"
[4/7/2019, 4:18:21 PM] [iMac] An error occured while trying to shut down "iMac" (192.168.1.xx): Error: Command failed: ssh 192.168.1.xx sudo shutdown -h now
Permission denied, please try again.
Permission denied, please try again.
Received disconnect from 192.168.1.xx port 22:2: Too many authentication failures
Disconnected from 192.168.1.xx port 22
[4/7/2019, 4:18:21 PM] [iMac] NetworkDevice "iMac" (192.168.1.xx) went from status "Shutting Down" to "Online"
config.json
{
"accessory": "NetworkDevice",
"name": "iMac",
"mac": "xxxx",
"ip": "192.168.1.xx",
"pingInterval": 45,
"wakeGraceTime": 10,
"wakeCommand": "ssh 192.168.1.xx sudo caffeinate -u -t 300",
"shutdownGraceTime": 15,
"shutdownCommand": "ssh 192.168.1.xx sudo shutdown -h now"
}
Homebridge is started via a LaunchAgent.
I have an account called 'ME' on my Mac mini, an account called 'ME' on my iMac and have set Homebridge to run under 'ME' - at least I think!
Here is the plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>com.homebridge.server</string>
<key>ProgramArguments</key>
<array>
<string>sudo</string>
<string>/usr/local/bin/homebridge</string>
<string>-I</string>
</array>
<key>UserName</key>
<string>ME</string>
<key>StandardOutPath</key>
<string>/Users/ME/.homebridge/logfile.log</string>
<key>StandardErrorPath</key>
<string>/Users/ME/.homebridge/logfile.log</string>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
<key>HOME</key>
<string>/Users/ME</string>
</dict>
</dict>
</plist>
PS. The account isn't actually called 'ME' but you get the point!
Please HELP!
Seems like the switch is resetting itself back to the off state even thought the computer is still on.
Line 38-40:
setTimeout(function() {
this._service.setCharacteristic(Characteristic.On, false);
}.bind(this), 30000);
Any particular reason that is there? Why not leave the switch on, it already assumes that the wol packet was sent successfully. Maybe run a periodic ping to set the actual state?
can this be used to wake and turn off an xbox?
I'm trying but not succeeding.
{ "accessory": "NetworkDevice", "name": "My XBOX", "ip": "192.168.1.36", "wakeCommand": "ssh 192.168.1.36 caffeinate -u -t 300" },
thanks!
Hi Alex,
Thank you for sharing the plugin with the community. In a few days I am going to build a custom NAS with Ubuntu installed on it. I suggest this should work with homebridge instead of a Raspberry Pi right ?
My second question is: In the end of the text you are saying that it is not possible to turn off youre computer /device with this plugin, however, in the main title you are saying it is possible to turn on and off the computer / machine.
So my question is: When my PC does support WOL, can I simply ask Siri: Shuwdown the server/ Turn on the server ?
Regards,
Elroy
Not too long ago I updated the README to a simpler to read and more consistent layout. This process included adding a logo for the project;
The logo works, but isn't especially pretty.
Your task is to create a new logo displaying a trait of the wake on lan nature of the project, as well as its name (homebridge-wol).
The current logo can be found in the .github folder as logo.png
and logo.psd
. The new logo should have the same dimensions and preferably (not required) have a source which can be shared.
Unless otherwise noted, the created logo will fall under the same license as the project and will be used in the README.
Everytime I start homebridge (with sudo) this appears:
`[2017-8-20 10:41:51] ====================
[2017-8-20 10:41:51] ERROR LOADING PLUGIN homebridge-wol:
[2017-8-20 10:41:51] Error: Cannot find module './build/Release/raw'
at Function.Module._resolveFilename (module.js:489:15)
at Function.Module._load (module.js:439:25)
at Module.require (module.js:517:17)
at require (internal/module.js:11:18)
at Object. (/usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/index.js:4:11)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
[2017-8-20 10:41:51] ====================
[2017-8-20 10:41:51] No plugins found. See the README for information on installing plugins.
[2017-8-20 10:41:51] Loaded config.json with 1 accessories and 0 platforms.
[2017-8-20 10:41:51] ---
[2017-8-20 10:41:51] Loading 0 platforms...
[2017-8-20 10:41:51] Loading 1 accessories...
/usr/local/lib/node_modules/homebridge/lib/api.js:64
throw new Error("The requested accessory '" + name + "' was not registered by any plugin.");
^
Error: The requested accessory 'Gaming-PC' was not registered by any plugin.
at API.accessory (/usr/local/lib/node_modules/homebridge/lib/api.js:64:13)
at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:254:42)
at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:81:38)
at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:40:10)
at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)`
My config-file looks like this, and yes it's in the root directory:
`
{
"bridge": {
"name": "Homebridge",
"username": "CC:22:3D:E3:CE:30",
"port": 51826,
"pin": "031-45-154",
"manufacturer": "@nfarina",
"model": "Homebridge",
"serialNumber": "0.4.20"
},
"description": "Something",
"accessories": [
{
"accessory": "Gaming-PC",
"name": "DESKTOP-P86F3UU",
"mac": "XX:XX:XX:XX:XX:XX",
"ip": "192.168.15.30"
}
],
"platforms": [
]
}`
I've got homebridge running on a mac mini. I can successfully get that mac to sleep (not shutdown) with the shutdown command 'sudo pmset sleepnow'.
Once it is asleep, the caffeinate command doesn't seem to work to wake it up. Since the homebridge is running on that computer, and that computer is now asleep, I suppose it's not entirely surprising it doesn't work, but I was wondering if there is any work around?
I'm a little stumped here. I see the accessory get registered in the logs, but then I go in to the Home app (and a couple other HomeKit apps for posterity's sake) and I don't see any devices other than my Yeelight strip. Tried running sudo homebridge
and still no dice.
My main concern is that I was kind of lazy when setting up what I have thus far and instead of installing the npm modules globally with a user with root access, I just ran sudo npm install -g [package]
. I would assume that even if that was the issue that running sudo homebridge
would likely fix the issue I'm seeing, but that's clearly not the case.
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
My configuration looks like this:
{
"bridge": {
"name": "Homebridge",
"username": "XX:XX:XX:XX:XX:XX",
"port": 51826,
"pin": "031-45-154"
},
// "description": "",
"accessories": [
{
"accessory": "NetworkDevice",
"name": "Magic Mirror",
"mac": "XX:XX:XX:XX:XX:XX",
"ip": "XXX.XXX.X.XXX",
"wakeCommand": "sshpass -p '[password]' ssh -oStrictHostKeyChecking=no pi@[ip-address] xscreensaver-command -deactivate",
"shutdownCommand": "sshpass -p '[password]' ssh -oStrictHostKeyChecking=no pi@[ip-address] xscreensaver-command -activate"
}
],
"platforms": [
{
"platform": "yeelight",
"name": "Yeelight",
"transitions": {
"power": 400,
"brightness": 400
},
"multicast": {
"interface": "0.0.0.0"
}
},
]
}
I see this in the logs when I run homebridge:
[2018-5-20 21:17:25] Loaded plugin: homebridge-wol
[2018-5-20 21:17:25] Registering accessory 'homebridge-wol.NetworkDevice'
New Install of HomeBridge on Ubuntu Server 16.04
Plugin not loading, causing error on accessory load. Removal of accessory
My configuration looks like this:
{
"bridge": {
"name": "Homebridge",
"username": "REDACTED",
"port": REDACTED,
"pin": "REDACTED"
},
"platforms": [
{
"platform": "Server",
"name": "Homebridge Server",
"port": REDACTED,
"log": "systemd",
"restart": "systemctl restart homebridge"
},
{
"platform": "Wink2",
"name": "WinkHub",
"username": "REDACTED",
"password": "REDACTED",
"client_id": "REDACTED",
"client_secret": "REDACTED",
"direct_access": "true",
"hide_groups": [],
"hide_ids": [],
"fan_ids": [
"REDACTED"
]
}
],
"accessories": [
{
"accessory": "NetworkDevice",
"name": "Server",
"mac": "REDACTED",
"ip": "REDACTED",
"pingInterval": 60,
"wakeGraceTime": 120,
"shutdownGraceTime": 15,
"shutdownCommand": "net rpc shutdown -I REDACTED -U REDACTED -f -t 120"
}
]
}
user@Homebridge:~$ homebridge -U /var/homebridge
[5/11/2018, 6:18:49 PM] Loaded plugin: homebridge-server
[5/11/2018, 6:18:49 PM] Registering platform 'homebridge-server.Server'
[5/11/2018, 6:18:49 PM] ---
[5/11/2018, 6:18:50 PM] Loaded plugin: homebridge-wink2
[5/11/2018, 6:18:50 PM] Registering platform 'homebridge-wink2.Wink2'
[5/11/2018, 6:18:50 PM] ---
[5/11/2018, 6:18:50 PM] ====================
[5/11/2018, 6:18:50 PM] ERROR LOADING PLUGIN homebridge-wol:
[5/11/2018, 6:18:50 PM] SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:374:25)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/usr/local/lib/node_modules/homebridge-wol/index.js:1:88)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
[5/11/2018, 6:18:50 PM] ====================
[5/11/2018, 6:18:50 PM] Loaded config.json with 1 accessories and 2 platforms.
[5/11/2018, 6:18:50 PM] ---
[5/11/2018, 6:18:50 PM] Loading 2 platforms...
[5/11/2018, 6:18:50 PM] [Homebridge Server] Initializing Server platform...
[5/11/2018, 6:18:50 PM] [WinkHub] Initializing Wink2 platform...
[5/11/2018, 6:18:50 PM] [WinkHub] Wink2 Init - Version 2.0.8
[5/11/2018, 6:18:50 PM] Loading 1 accessories...
/usr/local/lib/node_modules/homebridge/lib/api.js:64
throw new Error("The requested accessory '" + name + "' was not registered by any plugin.");
^
Error: The requested accessory 'NetworkDevice' was not registered by any plugin.
at API.accessory (/usr/local/lib/node_modules/homebridge/lib/api.js:64:13)
at Server.str.replace.Server._loadAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:264:42)
at Server.str.replace.Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:86:38)
at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:40:10)
at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (module.js:410:26)
at Object.Module._extensions..js (module.js:417:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:442:10)
can I wake up a device over WLAN?
thanks!
/usr/local/lib/node_modules/homebridge/lib/api.js:47
throw new Error("The requested accessory '" + name + "' was not registered by any plugin.");
^
Error: The requested accessory 'Computer' was not registered by any plugin.
at API.accessory (/usr/local/lib/node_modules/homebridge/lib/api.js:47:13)
at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:164:42)
at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:36:38)
at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:23:16)
at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (module.js:398:26)
at Object.Module._extensions..js (module.js:405:10)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Function.Module.runMain (module.js:430:10)
at startup (node.js:141:18)
at node.js:980:3
Users have been having issues where a device would not enter the shutdown state.
This issue has been created to follow up on the current issue and document the cause and solution.
Run the following commands on the computer running homebridge:
# Remove homebridge-wol
npm uninstall -g homebridge-wol
# Clone the fix
git clone https://github.com/cr3ative/homebridge-wol.git
# Enter the directory, install dependencies and "install" the plugin
cd homebridge-wol
npm install
npm link
To uninstall, run the following commands on the same computer:
# "Uninstall" the plugin
npm unlink homebridge-wol
# Remove the directory
rm -r homebridge-wol
Hi together,
i am trying to control my pc with WoL and Homebrige. My computer has some know issues with WoL, which is sometimes working and sometimes no, but this is another story.
The plugin sends the WoL packet just fine. The ping function to check wehter the pc is on or off works as well.
Just having some issues to shutdown over SSH on Win 10.
When i run the same ssh command from terminal works perfect, but it default asks for password of user pi (which i added in Win 10 with blank password and necessary permissions) and i just have to press enter.
I guessed that could have been the problem, so I installed sshpass and tried to change config.json with "sshpass -p '' ssh 192.168.131.31 shutdown -s"but nothing changed. Again it works from terminal on the very same Pi.
I also tried sshpass with my admin credentials like this: "sshpass -p 'myAdminPassword' ssh 192.168.131.11 -U myPc/myAdminAccount shutdown -s" (also tried without domain).
Everything works on terminal nothing works on homebridge.
Some ideas? Thank you =)
Raspberry Pi 3 @ Noob
Everything at the latest version.
###Config.json
{
"accessory": "NetworkDevice",
"name": "AsusFX8",
"mac": "60-AC-4C-32-C1-C5",
"ip": "192.168.131.11",
"pingInterval": 45,
"wakeGraceTime": 90,
"shutdownGraceTime": 15,
"shutdownCommand": "ssh 192.168.131.31 shutdown -s"
}
Loaded config.json with 7 accessories and 0 platforms.
Loading 7 accessories...
[...]
[AsusFX8] Initializing NetworkDevice accessory...
[AsusFX8] Stopping pinger
[AsusFX8] Starting pinger at an interval of 45000 milli seconds
[...]
[AsusFX8] NetworkDevice shutdown cycle started for "AsusFX8" (192.168.131.31)
[AsusFX8] Stopping pinger
[AsusFX8] Starting pinger again in 15000 milli seconds
[AsusFX8] Attempting to shut down "AsusFX8" (192.168.131.31) using "ssh 192.168.131.31 shut
[AsusFX8] NetworkDevice "AsusFX8" (192.168.131.31) went from status "Online" to "Shutting D
Nov 17 19:16:47 raspberrypi homebridge[434]: Fri, 17 Nov 2017 18:16:47 GMT EventedHTTPServer [::ffff:192.168.131.242] Sending HTTP event '7.10' with data: {"c
Nov 17 19:16:47 raspberrypi homebridge[434]: Fri, 17 Nov 2017 18:16:47 GMT EventedHTTPServer [::ffff:192.168.131.190] Sending HTTP event '7.10' with data: {"c
Nov 17 19:16:47 raspberrypi homebridge[434]: Fri, 17 Nov 2017 18:16:47 GMT EventedHTTPServer [::ffff:192.168.131.190] HTTP Response is finished
Nov 17 19:16:47 raspberrypi homebridge[434]: Fri, 17 Nov 2017 18:16:47 GMT EventedHTTPServer [::ffff:192.168.131.190] Writing pending HTTP event data
[AsusFX8] An error occured while trying to shut down "AsusFX8" (192.168.131.31): Error: Com
Nov 17 19:16:47 raspberrypi homebridge[434]: Host key verification failed.
[AsusFX8] Stopping pinger
[AsusFX8] Starting pinger at an interval of 45000 milli seconds
[...]
Is maybe something going on with Host Key verification??
Hi everything work perfect until I click power off (In console of home bridge in qnap I mast type the password :( how to save password only for power off commands?
Using the plugin via the Home App
I successfully installed homebridge-wol and added the configuration to the config file. The plugin seems to be running fine and my iMac 5K shows up in HomeKit.
However, I am not not able to either wake up or shut down my computer. Nor does the plugin update my iMac status if I manually turn it on or off. The switch doesn't seem to do anything.
Here is screenshots of my networking settings:
And here is my configuration file:
{
"bridge": {
"name": "Homebridge Misc",
"username": "CD:22:4D:E3:DE:34",
"port": 51826,
"pin": "051-85-128"
},
"description": "This is an example configuration file. You can use this as a template for creating your own configuration file containing devices you actually own.",
"accessories": [
{
"accessory": "NetworkDevice",
"name": "iMac 5k",
"mac": "<mac-address>",
"ip": "10.0.1.12",
"pingInterval": 45,
"wakeGraceTime": 90,
"shutdownGraceTime": 45,
"shutdownCommand": "ssh 10.0.1.12 sudo shutdown -h now"
}
],
"platforms": [
{
"platform": "config",
"name": "Config",
"port": 8170,
"log": "/homebridge/logs/homebridge.log",
"restart": "docker-compose restart homebridge"
}
]
}
When I follow these steps:
I couldn't figure out how to run the DEBUG=* homebridge
command. However, here is a copy of my log file:
I get the following log:
[2018-1-31 13:02:22] Homebridge is running on port 51826.
[2018-1-31 13:02:25] [Config] Using Form Authentication
[2018-1-31 13:02:25] [Config] Console is listening on port 8170.
[2018-1-31 13:03:55] [Config] Changes to config.json saved.
/usr/local/lib/node_modules/homebridge/node_modules/mdns/lib/advertisement.js:42
var error = dns_sd.buildException(errorCode);
^
Error: dns service error: unknown
at Advertisement.on_service_registered (/usr/local/lib/node_modules/homebridge/node_modules/mdns/lib/advertisement.js:42:24)
at SocketWatcher.MDNSService.self.watcher.callback (/usr/local/lib/node_modules/homebridge/node_modules/mdns/lib/mdns_service.js:18:40)
*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node>
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister>
[2018-1-31 13:04:30] Loaded plugin: homebridge-dummy
[2018-1-31 13:04:30] Registering accessory 'homebridge-dummy.DummySwitch'
[2018-1-31 13:04:30] ---
[2018-1-31 13:04:30] Loaded plugin: homebridge-wol
[2018-1-31 13:04:30] Registering accessory 'homebridge-wol.NetworkDevice'
[2018-1-31 13:04:30] ---
[2018-1-31 13:04:31] Loaded plugin: homebridge-config-ui-x
[2018-1-31 13:04:31] Registering platform 'homebridge-config-ui-x.config'
[2018-1-31 13:04:31] ---
[2018-1-31 13:04:31] Loaded config.json with 1 accessories and 1 platforms.
[2018-1-31 13:04:31] ---
[2018-1-31 13:04:31] Loading 1 platforms...
[2018-1-31 13:04:31] [Config] Initializing config platform...
[2018-1-31 13:04:31] Loading 1 accessories...
[2018-1-31 13:04:31] [iMac 5k] Initializing NetworkDevice accessory...
Setup Payload:
X-HM://0023K0OYWKCPC
Scan this code with your HomeKit app on your iOS device to pair with Homebridge:
Or enter this code with your HomeKit app on your iOS device to pair with Homebridge:
ββββββββββββββ
β 051-85-128 β
ββββββββββββββ
[2018-1-31 13:04:31] Homebridge is running on port 51826.
[2018-1-31 13:04:34] [Config] Using Form Authentication
[2018-1-31 13:04:34] [Config] Console is listening on port 8170.
[2018-1-31 13:07:39] [iMac 5k] NetworkDevice awake cycle started for "iMac 5k" (10.0.1.12)
[2018-1-31 13:07:39] [iMac 5k] Attempting to wake up "iMac 5k" (10.0.1.12)
[2018-1-31 13:07:39] [iMac 5k] NetworkDevice "iMac 5k" (10.0.1.12) went from status "Offline" to "Waking Up"
[2018-1-31 13:07:44] [iMac 5k] NetworkDevice shutdown cycle started for "iMac 5k" (10.0.1.12)
[2018-1-31 13:07:44] [iMac 5k] Attempting to shut down "iMac 5k" (10.0.1.12) using "ssh 10.0.1.12 sudo shutdown -h now"
[2018-1-31 13:07:44] [iMac 5k] NetworkDevice "iMac 5k" (10.0.1.12) went from status "Waking Up" to "Shutting Down"
[2018-1-31 13:07:44] [iMac 5k] An error occured while trying to shut down "iMac 5k" (10.0.1.12): Error: Command failed: ssh 10.0.1.12 sudo shutdown -h now
/bin/sh: ssh: not found
[2018-1-31 13:07:44] [iMac 5k] NetworkDevice "iMac 5k" (10.0.1.12) went from status "Shutting Down" to "Offline"
[2018-1-31 13:10:21] [iMac 5k] NetworkDevice awake cycle started for "iMac 5k" (10.0.1.12)
[2018-1-31 13:10:21] [iMac 5k] Attempting to wake up "iMac 5k" (10.0.1.12)
[2018-1-31 13:10:21] [iMac 5k] NetworkDevice "iMac 5k" (10.0.1.12) went from status "Offline" to "Waking Up"
[2018-1-31 13:11:51] [iMac 5k] NetworkDevice "iMac 5k" (10.0.1.12) went from status "Waking Up" to "Offline"
I would love to get your help with this problem. I was REALLY excited to be able to remotely turn off and turn on my iMac. Please let me know if there is any additional information you need from me!
Hi,
when i try to install the plugin i keep getting this error:
> [email protected] install /usr/lib/node_modules/homebridge-wol/node_modules/raw-socket
> node-gyp rebuild
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/homebridge-wol/node_modules/raw-socket/build'
gyp ERR! stack at Error (native)
gyp ERR! System Linux 4.8.0-36-generic
gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/homebridge-wol/node_modules/raw-socket
gyp ERR! node -v v6.11.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/jort/.npm/_logs/2017-07-20T19_03_06_798Z-debug.log
I don't know what I am doing wrong, since im an inexperienced coder!
would love to get an experts opinion on this!
thank you,
Jort
Hi, Im hoping you can help me (and that my question is not too stupid). I installed home bridge and have it working with my TP-Link switches. I thought your plugin sounded great so have installed it. I get no errorsβeverything seems to run fineβbut my MacBook does not show up in the home kit app. I'm not sure what I am doing wrong!
My RPi is connected to my network via ethernet.
My config file is as follows:
`{
"bridge": {
"name": "Homebridge",
"username": "CC:22:3D:E3:CE:30",
"port": 51826,
"pin": "031-45-154"
},
"description": "This is a modified configuration file",
"accessories": [
{
"accessory": "Computer",
"name": "My Macbook",
"mac": "XX:XX:XX:XX:XX:XX",
"ip": "192.168.0.11",
"pingInterval": 45,
"wakeGraceTime": 90,
"shutdownGraceTime": 15,
"shutdownCommand": "ssh 192.168.1.51 sudo shutdown -h now"
}
],
"platforms": [
{
"platform" : "Hs100"
}
]
}
`
I'm going to assume that the issue is with me and not your brilliant plugin so apologies if i shouldn't e posting this here. Any help would be much appreciated, though.
Thanks
Stuart
I can shut down my win10 PC but wake doesn't work.
I can wake from my router but homebridge doesn't do it.
For logging I removed other plugins from config.
{
"bridge": {
"name": "HomeBridge",
"username": "CC:22:3D:E3:CE:20",
"port": 51877,
"pin": "031-77-154"
},
"accessories": [{
"accessory": "NetworkDevice",
"name": "Vobiscum",
"mac": "<mac-address>",
"ip": "172.16.1.9",
"pingInterval": 45,
"wakeGraceTime": 90,
"shutdownGraceTime": 60,
"shutdownCommand": "SHUTDOWN /s /f /t 0 /m 172.16.1.9"
}]
}
C:\Users\pax07>homebridge
[2018-3-10 01:43:34] Loaded plugin: homebridge-config-ui-x
[2018-3-10 01:43:34] Registering platform 'homebridge-config-ui-x.config'
[2018-3-10 01:43:34] ---
[2018-3-10 01:43:35] Loaded plugin: homebridge-dacp
[2018-3-10 01:43:35] Registering platform 'homebridge-dacp.DACP'
[2018-3-10 01:43:35] ---
[2018-3-10 01:43:35] Loaded plugin: homebridge-delay-switch
[2018-3-10 01:43:35] Registering accessory 'homebridge-delay-switch.DelaySwitch'
[2018-3-10 01:43:35] ---
[2018-3-10 01:43:35] Loaded plugin: homebridge-plex
[2018-3-10 01:43:35] Registering accessory 'homebridge-plex.Plex'
[2018-3-10 01:43:35] ---
[2018-3-10 01:43:35] Loaded plugin: homebridge-samsung-remote
[2018-3-10 01:43:35] Registering accessory 'homebridge-samsung-remote.SamsungTV'
[2018-3-10 01:43:35] ---
[2018-3-10 01:43:35] Loaded plugin: homebridge-weather-station-extended
[2018-3-10 01:43:35] Registering platform 'homebridge-wunderground-extended.WeatherStation'
[2018-3-10 01:43:36] ---
[2018-3-10 01:43:36] Loaded plugin: homebridge-wol
[2018-3-10 01:43:36] Registering accessory 'homebridge-wol.NetworkDevice'
[2018-3-10 01:43:36] ---
[2018-3-10 01:43:36] Loaded config.json with 1 accessories and 0 platforms.
[2018-3-10 01:43:36] ---
[2018-3-10 01:43:36] Loading 1 accessories...
[2018-3-10 01:43:36] [Vobiscum] Initializing NetworkDevice accessory...
[2018-3-10 01:43:36] [Vobiscum] Stopping pinger
[2018-3-10 01:43:36] [Vobiscum] Starting pinger at an interval of 45000 milli seconds
Setup Payload:
X-HM://0023ITNLUFMCK
Scan this code with your HomeKit app on your iOS device to pair with Homebridge:
Or enter this code with your HomeKit app on your iOS device to pair with Homebridge:
ββββββββββββββ
β 031-77-154 β
ββββββββββββββ
EventedHTTPServer Server listening on port 51877 +0ms
[2018-3-10 01:43:36] Homebridge is running on port 51877.
EventedHTTPServer [::ffff:172.16.1.30] New connection from client +1s
EventedHTTPServer [::ffff:172.16.1.30] HTTP server listening on port 49606 +6ms
EventedHTTPServer [::ffff:172.16.1.30] HTTP request: /pair-verify +22ms
HAPServer [CC:22:3D:E3:CE:20] HAP Request: POST /pair-verify +3ms
HAPServer [CC:22:3D:E3:CE:20] Pair verify step 1/2 +5ms
EventedHTTPServer [::ffff:172.16.1.30] HTTP Response is finished +26ms
EventedHTTPServer [::ffff:172.16.1.13] New connection from client +23ms
EventedHTTPServer [::ffff:172.16.1.13] HTTP server listening on port 49608 +4ms
EventedHTTPServer [::ffff:172.16.1.30] HTTP request: /pair-verify +21ms
HAPServer [CC:22:3D:E3:CE:20] HAP Request: POST /pair-verify +7ms
HAPServer [CC:22:3D:E3:CE:20] Pair verify step 2/2 +3ms
HAPServer [CC:22:3D:E3:CE:20] Client B68F9B09-30AC-4B70-B01D-378C9CD17925 verification complete +8ms
EventedHTTPServer [::ffff:172.16.1.30] HTTP Response is finished +2ms
EventedHTTPServer [::ffff:172.16.1.13] HTTP request: /pair-verify +1ms
HAPServer [CC:22:3D:E3:CE:20] HAP Request: POST /pair-verify +0ms
HAPServer [CC:22:3D:E3:CE:20] Pair verify step 1/2 +3ms
EventedHTTPServer [::ffff:172.16.1.13] HTTP Response is finished +35ms
EventedHTTPServer [::ffff:172.16.1.30] HTTP request: /accessories +74ms
HAPServer [CC:22:3D:E3:CE:20] HAP Request: GET /accessories +5ms
EventedHTTPServer [::ffff:172.16.1.30] HTTP Response is finished +26ms
EventedHTTPServer [::ffff:172.16.1.13] HTTP request: /pair-verify +21ms
HAPServer [CC:22:3D:E3:CE:20] HAP Request: POST /pair-verify +5ms
HAPServer [CC:22:3D:E3:CE:20] Pair verify step 2/2 +4ms
HAPServer [CC:22:3D:E3:CE:20] Client BE78E569-3CDA-4E67-BC98-782BCB323F0B verification complete +28ms
EventedHTTPServer [::ffff:172.16.1.13] HTTP Response is finished +7ms
EventedHTTPServer [::ffff:172.16.1.13] HTTP request: /accessories +111ms
HAPServer [CC:22:3D:E3:CE:20] HAP Request: GET /accessories +3ms
EventedHTTPServer [::ffff:172.16.1.13] HTTP Response is finished +2ms
EventedHTTPServer [::ffff:172.16.1.16] New connection from client +1m
EventedHTTPServer [::ffff:172.16.1.16] HTTP server listening on port 50058 +3ms
EventedHTTPServer [::ffff:172.16.1.16] HTTP request: /pair-verify +5ms
HAPServer [CC:22:3D:E3:CE:20] HAP Request: POST /pair-verify +1ms
HAPServer [CC:22:3D:E3:CE:20] Pair verify step 1/2 +1ms
EventedHTTPServer [::ffff:172.16.1.16] HTTP Response is finished +5ms
EventedHTTPServer [::ffff:172.16.1.16] HTTP request: /pair-verify +17ms
HAPServer [CC:22:3D:E3:CE:20] HAP Request: POST /pair-verify +0ms
HAPServer [CC:22:3D:E3:CE:20] Pair verify step 2/2 +1ms
HAPServer [CC:22:3D:E3:CE:20] Client 5FB36FAD-D135-4C33-BB69-CEE446881E18 verification complete +2ms
EventedHTTPServer [::ffff:172.16.1.16] HTTP Response is finished +10ms
EventedHTTPServer [::ffff:172.16.1.16] HTTP request: /accessories +6ms
HAPServer [CC:22:3D:E3:CE:20] HAP Request: GET /accessories +3ms
EventedHTTPServer [::ffff:172.16.1.16] HTTP Response is finished +15ms
EventedHTTPServer [::ffff:172.16.1.30] HTTP request: /characteristics?id=12.10 +5s
HAPServer [CC:22:3D:E3:CE:20] HAP Request: GET /characteristics?id=12.10 +3ms
Accessory [HomeBridge] Getting value for Characteristic "On" +4ms
Accessory [HomeBridge] Got Characteristic "On" value: false +1ms
EventedHTTPServer [::ffff:172.16.1.30] HTTP Response is finished +2ms
EventedHTTPServer [::ffff:172.16.1.30] HTTP request: /characteristics?id=12.10 +7s
HAPServer [CC:22:3D:E3:CE:20] HAP Request: GET /characteristics?id=12.10 +3ms
Accessory [HomeBridge] Getting value for Characteristic "On" +3ms
Accessory [HomeBridge] Got Characteristic "On" value: false +4ms
EventedHTTPServer [::ffff:172.16.1.30] HTTP Response is finished +8ms
EventedHTTPServer [::ffff:172.16.1.30] HTTP request: /characteristics +5s
HAPServer [CC:22:3D:E3:CE:20] HAP Request: PUT /characteristics +11ms
Accessory [HomeBridge] Processing characteristic set: [{"aid":12,"iid":10,"value":true}] +4ms
Accessory [HomeBridge] Setting Characteristic "On" to value true +2ms
[2018-3-10 01:45:23] [Vobiscum] NetworkDevice awake cycle started for "Vobiscum" (172.16.1.9)
[2018-3-10 01:45:23] [Vobiscum] Stopping pinger
[2018-3-10 01:45:23] [Vobiscum] Starting pinger again in 90000 milli seconds
[2018-3-10 01:45:23] [Vobiscum] Attempting to wake up "Vobiscum" (172.16.1.9)
[2018-3-10 01:45:23] [Vobiscum] NetworkDevice "Vobiscum" (172.16.1.9) went from status "Offline" to "Waking Up"
EventedHTTPServer [::ffff:172.16.1.30] HTTP Response is finished +22ms
[2018-3-10 01:46:53] [Vobiscum] Stopping pinger
[2018-3-10 01:46:53] [Vobiscum] Starting pinger at an interval of 45000 milli seconds
[2018-3-10 01:46:54] [Vobiscum] Pinger toggled state change
[2018-3-10 01:46:54] [Vobiscum] NetworkDevice "Vobiscum" (172.16.1.9) went from status "Waking Up" to "Offline"
[2018-3-10 01:52:28] Got SIGINT, shutting down Homebridge...
Terminate batch job (Y/N)? y
Status not correct when asleep and wake not working
I can successfully switch off my mac but not waking up.
Also, the switch turns off, but after a couple of seconds the status is on again even thought the mac is still sleeping.
If i run the wakeCommand from the terminal the mac wakes up correctly.
My configuration looks like this:
{
"accessory": "NetworkDevice",
"name": "Macbook Pro",
"mac": <mac-address>,
"ip": "192.168.0.100",
"pingInterval": 20,
"wakeGraceTime": 10,
"wakeCommand": "ssh [email protected] caffeinate -u -t 300",
"shutdownGraceTime": 15,
"shutdownCommand": "ssh [email protected] pmset sleepnow"
},
Jul 26 19:57:37 pi homebridge[419]: [2018-7-26 19:57:37] [Macbook Pro] NetworkDevice shutdown cycle started for "Macbook Pro" (192.168.0.100)
Jul 26 19:57:37 pi homebridge[419]: [2018-7-26 19:57:37] [Macbook Pro] Attempting to shut down "Macbook Pro" (192.168.0.100) using "ssh [email protected] pmset sleepnow"
Jul 26 19:57:37 pi homebridge[419]: [2018-7-26 19:57:37] [Macbook Pro] NetworkDevice "Macbook Pro" (192.168.0.100) went from status "Online" to "Shutting Down"
Jul 26 19:57:52 pi homebridge[419]: [2018-7-26 19:57:52] [Macbook Pro] NetworkDevice "Macbook Pro" (192.168.0.100) went from status "Shutting Down" to "Online"
Hey Alex, Iβm not able to see the status of my windows pc from the home app
I set extra permiss in service section of Homebridgeβs unit file
Iβm able to wake up the pc, but Iβm not able to shutdown
Iβm sure that the ip is correct, and with an other app in my iphone i can see the status from the ping
I don't care to turn ff my pc, but I want to see if is online or not
Can you help me please?
Raspberry Raspian GNU/Linux 9 (stretch)
Node version v8.12.0
Homebridge version 0.4.45
Homebridge-wol version: latest (Iβve installed your plugin last Monday so i think itβs 3.2.4, but I donβt know I can verify)
My configuration looks like this:
{
"bridge": {
"name": "Raspberry",
"username": "AC:22:3D:E3:CE:30",
"port": 51826,
"pin": "123-45-123"
},
"description": "",
"accessories": [
{
"accessory": "NetworkDevice",
"name": "Computer Vibox",
"mac": " ",
"ip": "192.168.1.35",
"shutdownCommand": "net rpc shutdown --ipaddress 192.168.1.35 --user *username%*password"
}
],
"platforms": []
}
When I follow these steps:
DEBUG=* homebridge
I get the following log:
DEBUG=* homebridge
events.js:183
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE :::51826
at Server.setupListenHandle [as _listen2] (net.js:1360:14)
at listenInCluster (net.js:1401:12)
at Server.listen (net.js:1485:7)
at EventedHTTPServer.listen (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/eventedhttp.js:60:19)
at HAPServer.listen (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:158:20)
at Bridge.Accessory.publish (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:607:16)
at Server._publish (/usr/lib/node_modules/homebridge/lib/server.js:128:16)
at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:97:10)
at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:45:10)
at Object. (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
-bash: [2018-11-8: command not found
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.