Git Product home page Git Product logo

homebridge-wol's Introduction

npm version npm downloads per year Verified by Homebridge
Quick Start | Contribute

A Wake on Lan plugin for Homebridge

Turn your PCs, laptops, servers and more on and off through Siri

Quick Start

To install the plugin, head over to the machine with Homebridge set up and run the following command:

npm install -g homebridge-wol

Add your devices to your config.json:

"accessories": [
  {
    "accessory": "NetworkDevice",
    "name": "My MacBook",
    "host": "192.168.1.51",
    "mac": "aa:bb:cc:dd:ee:ff"
  }
]

Table of contents

Quickstart
Configuration
Lifecycle
Notes and FAQ
Contributing

Configuration

To make Homebridge aware of the new plugin, you will have to add it to your configuration usually found in /root/.homebridge/config.json or /home/username/.homebridge/config.json. If the file does not exist, you can create it following the config sample. Somewhere inside that file you should see a key named accessories. There you can add configurations like the following.

Note that these are only examples to showcase the different possible configurations. Read through the configuration section below for detailed information.

"accessories": [
   {
     "accessory": "NetworkDevice",
     "name": "My Macbook",
     "mac": "<mac-address>",
     "host": "macbook.local",
     "pingCommand": "ssh macbook.local 'if [[ $(pmset -g powerstate IODisplayWrangler | tail -1 | cut -c29) -lt 4 ]]; then; exit 1; else; echo 1; fi;'",
     "pingInterval": 45,
     "wakeGraceTime": 10,
     "wakeCommand": "ssh macbook.local caffeinate -u -t 300",
     "shutdownGraceTime": 15,
     "shutdownCommand": "ssh macbook.local sudo shutdown -h now"
   },
   {
     "accessory": "NetworkDevice",
     "name": "My Windows Gaming Rig",
     "mac": "<mac-address>",
     "host": "192.168.1.151",
     "shutdownCommand": "net rpc shutdown --ipaddress 192.168.1.151 --user username%password"
   },
   {
     "accessory": "NetworkDevice",
     "name": "Raspberry Pi",
     "mac": "<mac-address>",
     "host": "192.168.1.251",
     "pingInterval": 45,
     "wakeGraceTime": 90,
     "shutdownGraceTime": 15,
     "shutdownCommand": "sshpass -p 'raspberry' ssh -oStrictHostKeyChecking=no [email protected] sudo shutdown -h now"
   },
   {
     "accessory": "NetworkDevice",
     "name": "My NAS",
     "host": "192.168.1.148",
     "log": false,
     "broadcastAddress": "172.16.1.255"
   }
]

For more configuration examples, please see the wiki which contains a growing collection of user-contributed guides on how to setup the plugin, Windows 10, Samba, Linux etc.: https://github.com/AlexGustafsson/homebridge-wol/wiki.

Required configuration

Key Description
accessory The type of accessory - has to be "NetworkDevice"

Optional configuration

Accessory information

Key Description
name The name of the device - used in HomeKit apps as well as Siri, default My NetworkDevice
manufacturer The manufacturer of the accessory. Defaults to "homebridge-wol"
model The model name of the accessory. Defaults to "NetworkDevice"
serialNumber A unique id for the accessory. Defaults to a random id which is reset each time the server restarts. See #117 for more information

Pinging

Key Description
host The IP address or hostname to ping in order to receive current status
pingInterval Ping interval in seconds, only used if host is set, default 2. Same as that for pinging with a command
pingsToChange The number of pings necessary to trigger a state change, only used if host is set, default 5
pingTimeout  Number of seconds to wait for pinging to finish, default 1

Pinging using a command

Key Description
pingCommand Command to run in order to know if a host is up or not. If the command exits successfully (zero as the exit code) the host is considered up. If an error is thrown or the command exits with a non-zero exit code, the host is considered down
pingCommandTimeout Timeout for the ping command in seconds. Use 0 (default) to disable the timeout
pingInterval Ping interval in seconds, only used if host is set, default 2. Same as that for pinging

Note: these settings render those mentioned in the above section useless.

Turning on

Key Description
mac The device's MAC address - used to send Magic Packets. Allows any format such as XX:XX:XX:XX:XX:XX or XXXXXXXXXXXX
broadcastAddress The broadcast address to use when sending the Wake on LAN packet. Only used in rare cases. Defaults to 255.255.255.255
startCommand Command to run in order to start the machine
startCommandTimeout Timeout for the start command in seconds. Use 0 (default) to disable the timeout
wakeGraceTime Number of seconds to wait after startup before checking online status and issuing the wakeCommand, default 45
wakeCommand Command to run after initial startup, useful for macOS users in need of running caffeinate
wakeCommandTimeout Timeout for the wake command in seconds. Use 0 (default) to disable the timeout

Turning off

Key Description
shutdownCommand Command to run in order to shut down the remote machine
shutdownGraceTime Number of seconds to wait after shutdown before checking offline status, default 15
shutdownCommandTimeout Timeout for the shutdown command in seconds. Use 0 (default) to disable the timeout

Logging

Key Description
logLevel  The syslog log level to use such as Debug, Info, Error. The default is Info. Use None to disable logging

Miscellaneous

Key Description
returnEarly Whether or not to let the plugin return early to mitigate Siri issue (see #85). Defaults to false

Lifecycle

Whenever Homebridge starts, the plugin will check the state of all configured devices. This is done by pinging or executing the pingCommand once, depending on the configuration. If the pinging or pingCommand executes successfully, the device is considered online and vice versa.

The pinging by actual pings or use of the pingCommand will continue in the background, monitoring the state of the device. If pingsToChange (defaults to 5) pings have the same result and that result is not the current state, the state of the device will be considered changed. If pingCommand is configured, it is used instead of actual pings and will result in an immediate state change.

This pinging will result in state changes between online and offline.

Whenever you flick a switch to its on position via HomeKit, the device is marked as "turning on". Then a WoL packet is sent to the device if a MAC address is configured and if a startCommand is configured, it is also executed immediately. After the device has been started, it is marked as online. Then the plugin will wait for the time configured by wakeGraceTime (defaults to 45s). If a wakeCommand is configured, it will be called after the wait is over. Once all commands are completed, the device will be monitored again by the pinger - switching its state automatically.

Whenever you flick a switch to its off position via HomeKit, the device is immediately marked as turning off. A shutdown command is executed if it is configured. After the command's completion (or directly if none is configured), the plugin will wait for shutdownGraceTime (defaults to 15s) before continuing to monitor the device using the configured pinging method.

Notes and FAQ

Permissions

This plugin requires extra permissions due to the use of pinging and magic packages. Start Homebridge using 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 like so:

CapabilityBoundingSet=CAP_NET_RAW
AmbientCapabilities=CAP_NET_RAW

Waking an Apple computer

The Macbook configuration example uses caffeinate in order to keep the computer alive after the initial wake-up. See this issue for more information.

Controlling a Windows PC

The Windows configuration example requires the samba-common package to be installed on the server. If you're on Windows 10 and you're signing in with a Microsoft account, the command should use your local username instead of your Microsoft ID (e-mail). Also note that you may or may not need to run net rpc with sudo.

SSH as wake or shutdown command

The Raspberry Pi example uses the sshpass package to sign in on the remote host. The -oStrictHostKeyChecking=no parameter permits any key that the host may present. This usage is heavily discouraged. You should be using SSH keys to authenticate yourself.

Secrets in the configuration

Using username and passwords in a command is heavily discouraged as this stores them in the configuration file in plaintext. Use other authentication methods or environment variables instead.

Contribute

Any contribution is welcome. If you're not able to code it yourself, perhaps someone else is - so post an issue if there's anything on your mind.

If you're new to the open source community, JavaScript, GitHub or just uncertain where to begin - issues labeled "good first issue" are a great place to start. Just comment on an issue you'd like to investigate and you'll get guidance along the way.

Contributors

This repository has evolved thanks to you. Issues reporting bugs, missing features or quirks are always a welcome method to help grow this project.

Beyond all helpful issues and wiki posts, this repository has seen modifications from these helpful contributors:


@AlexGustafsson

Author

@cr3ative

Previous collaborator

@blubber

Previous collaborator

@lnxbil

Contributor

@residentsummer

Contributor

@JulianRecke

Contributor

@tanmaster

Contributor

@HenrySeed

Logo designer

@conao3

Contributor

@joriskleiber

joriskleiber

Development

# Clone project
git clone https://github.com/AlexGustafsson/homebridge-wol.git && cd homebridge-wol

# Install dependencies
npm install

# Build the project
npm run build

# Link it (if running homebridge locally)
npm link

# Make sure linting passes
npm run lint

# Try to start Homebridge with the Homebridge Config UI X locally - available on localhost:8080
# with default credentials admin:admin
npm run test

# Run Homebridge, Homebridge Config UI X and Homebridge WoL on the current maintenance node LTS version
docker-compose -f integration/docker-compose.yml up --force-recreate

# If you make changes to the code base, you may have to rebuild the containers before running the above command
docker-compose -f integration/docker-compose.yml build

The things to look out for when running the dockerized environment is:

  1. Is the configuration UI working correctly? That is, is the config.schema.json up to date?
  2. Can you interact with the accessories as expected? See the logs for full insights.

The accessory MacBook Pro is fully hooked up to simulate a real world MacBook, with proper shutdown over SSH as well as a custom ping command.

The Generic accessory features regular pinging using ICMP messages over IPv4.

The Localhost accessory represents the same instance as that running the Homebridge server. It features only mock configuration. It does feature the full range of configurations available, which should help debugging the configuration UI.

homebridge-wol's People

Contributors

alexgustafsson avatar blubber avatar conao3 avatar cr3ative avatar dependabot[bot] avatar henryseed avatar joriskleiber avatar lnxbil avatar netmikey avatar residentsummer avatar tanmaster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homebridge-wol's Issues

Shutting down my server

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

Windows shutdown command errors - NT_STATUS_OBJECT_NAME_NOT_FOUND

Backstory

I set up WOL for my Windows PC on my RPi. The wake command works great, but the shutdown command is producing errors.

Issue

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.

Environment

  • os & os version: Raspian9
  • node version: v10.15.0
  • homebridge version: v0.4.46
  • homebridge-wol version: v3.2.4

Configuration

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>"
        }
    ],

Log

[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

Not waking/shutting down my iMac

Backstory

Using the plugin via the Home App

Issue

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:

screen shot 2018-01-31 at 1 16 53 pm

screen shot 2018-01-31 at 1 17 00 pm

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"
        }
    ]
}

Environment

  • os & os version: Raspberry Pi 3 - Raspian OS
  • node version: not sure
  • homebridge version: 0.4.37 (running via OZNU Docker)
  • homebridge-wol version: 3.1.0

Log

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"

Notes

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!

How can I do this step?

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

Homebridge crashing of error loading plugin

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": [



]

}`

shutdownCommand from Raspberry Pi to Windows

Backstory

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?

Environment

  • os & os version: Windows 10 x64, 1709 & Raspbian 9.4 stretch
  • node version: v.6.9.5
  • homebridge version: 0.4.38
  • homebridge-wol version: 3.2.1

Configuration

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>

Log

When I follow these steps:

  1. Run DEBUG=* homebridge
  2. Let it run for five minutes
  3. Tap a switch
  4. Wait one minute
  5. Tap the same switch

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"

Notes

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.

wakeGraceTime wait before executing wakeCommand

Backstory

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, default 45 No

Issue

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.

Environment

  • homebridge-wol version: master branch (36cdd0f)

Configuration

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>"
        }

Log

When I follow these steps:

  1. Run DEBUG=* homebridge -D -P ~/homebridge-wol/
  2. Let it run for one minute
  3. Tap <vm-name> switch

I 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"

Notes

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;
     }

Windows Shutdown Command

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?

WOL works with router UI, but not with homebridge-wol

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

Power switch not staying on

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?

wake and sleep xbox?

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!

error when installing plugin

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

Designing a new logo

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;

Current logo

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.

Bug not allowing users to use the shutdown command completely

Backstory

Users have been having issues where a device would not enter the shutdown state.

Notes

This issue has been created to follow up on the current issue and document the cause and solution.

Testing @cr3ative's fix

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

Typos in code related to logging

In some logging statements, "unknown" has incorrectly become "unkown".

There are at least the following occurrences:

this.log('NetworkDevice "%s" (%s) went from status "%s" to "%s"', this.config.name, this.config.ip || 'unkown ip', this.getValueOfSymbol(this.status), this.getValueOfSymbol(newStatus));

this.log('NetworkDevice shutdown cycle started for "%s" (%s)', this.config.name, this.config.ip || 'unkown ip');

this.log('An error occured while waking "%s" (%s, %s): %s', this.config.name, this.config.ip || 'unkown ip', this.config.mac, error);

this.log('Attempting to wake up "%s" (%s) using "%s"', this.config.name, this.config.ip || 'unkown ip', this.config.wakeCommand);

this.log('An error occured while trying to wake "%s" (%s): %s', this.config.name, this.config.ip || 'unkown ip', error);

this.log('Attempting to shut down "%s" (%s) using "%s"', this.config.name, this.config.ip || 'unkown ip', this.config.shutdownCommand);

this.log('An error occured while trying to shut down "%s" (%s): %s', this.config.name, this.config.ip || 'unkown ip', error);

A fix should correct all these occurrences.

Status not correct when sleeping

Backstory

Status not correct when asleep and wake not working

Issue

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.

Configuration

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"
 },

Environment

  • os & os version: Raspbian GNU/Linux 9
  • node version: v8.11.3
  • homebridge version: v0.4.44
  • homebridge-wol version: v3.2.4

Log

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"

Error Loading Plugin

Backstory

New Install of HomeBridge on Ubuntu Server 16.04

Issue

Plugin not loading, causing error on accessory load. Removal of accessory

Environment

  • os & os version: Ubuntu Server 16.04
  • node version: v4.2.6
  • homebridge version: 0.4.42
  • homebridge-wol version: latest

Configuration

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"
        }
    ]
}

Log

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)

Shutting Down Status Issue

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

Error after installing

/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

Following error when running

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

Can´t shutdown Windows 10 Pc

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 =)

Environment

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"
}

Log

[...]
Loaded plugin: homebridge-wol
Registering accessory 'homebridge-wol.NetworkDevice'

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
[...]

Notes

Is maybe something going on with Host Key verification??

Raw Socket initializing error

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!

Computer not showing up in HomeKit App

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

Quality Assurance Beta

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.

The wake and shutdown command may reveal secrets used

Backstory

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.

Issue

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.

Environment

  • homebridge-wol version: 3.2.2

Notes

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.

Need help with getting this working...

Hey,

I am having an issue getting this working. Hopefully someone can point out where I am going wrong! PLEASE HELP!

Backstory

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.

Issue

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"

Environment

  • os & os version: Mac mini (running Homebridge) - macOS 10.13.6 / iMac (the WOL device) maxOS 10.14.4
  • node version: v11.6.0
  • homebridge version: 0.4.48
  • homebridge-wol version: v3.2.4

Configuration

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"
}

Notes

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!

Windows PC does not wake up

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

Ping Problem status

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?

Environment

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)

Configuration

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": []
}

Log

When I follow these steps:

  1. Run DEBUG=* homebridge
  2. Let it run for five minutes
  3. Tap a switch
  4. Wait one minute
  5. Tap the same switch

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

Documentation around pingCommand

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?

can a sleeping mac wake itself up?

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?

Install

Seems like an interesting Plugin for homebridge.

How do I install homebridge-wol?

Question about the WOL plugin

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

I cant seem to get this to work...but im also pretty computer dumb

Backstory

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

Issue

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

Environment

  • os & os version: Raspbian Stretch Kernel version:4.14 on Raspberry PI & Windows 10 Pro 1803 on PC
  • node version: v8.15.0
  • homebridge version: v0.4.32
  • homebridge-wol version: v3.2.4

Configuration

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

Log

When I follow these steps:

  1. Run DEBUG=* homebridge
  2. Let it run for five minutes
  3. Tap a switch
  4. Wait one minute
  5. Tap the same switch

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"

Notes

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!

Blinking on and off

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

The switch in Homekit is switched off although the status is "Shutting Down"

Backstory

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.

Issue

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"?

Environment

  • os & os version: Raspbian
  • node version: 11.14.0
  • homebridge version: 0.4.49
  • homebridge-wol version: 3.2.4

Configuration

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.

Limit pinginterval logging

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!

Accessory registers (at least in the log) => does not show up in app

Issue

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.

Environment

  • node version: 8.11.1
  • homebridge version: 0.4.42
  • homebridge-wol version: 6.0.1
  • OS details:
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"

Configuration

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"
                }
        },
    ]
}

Log

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'

SyntaxError: Block-scoped ... strict mode.

Backstory

I was attempting to re-configure homebridge-wol due to a recent move w/ switch of equipment.

Issue

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.

Environment

  • [ x] * Os & os version: Raspbian 9 stretch | Controlling a Windows 10.pre.1803 desktop
  • [ x] * node version: 4.8.2
  • [ x] * homebridge version: 4.38
  • [ x] * homebridge-wol version: 3.2.2

Configuration

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!

  • [x ] Remove any mac addresses from the configuration by
    exchanging them with

Log

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)

Notes

none

Shutdown Command for Windows not working

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,

Cannot start HomeBridge

/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

Can't wake Windows 10

Backstory

I can shut down my win10 PC but wake doesn't work.
I can wake from my router but homebridge doesn't do it.

Environment

  • os & os version: Win 10 x64
  • node version: 9.7.1
  • homebridge version: 0.4.38
  • homebridge-wol version: 3.2.1

Log

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

Switch turns on then back off

Backstory

just playing around with homebridge and had a sudden thought if i could use it for wol so i found this.

Issue

when I "turn on" my computer it turn itself off agian without actualy turning on my computer

Environment

  • os & os version:raspian & dont know what version as the homebridge host, windows 10 for other computer
  • node version: 8.11.1
  • homebridge version: latest as of writing this
  • homebridge-wol version: latest as of writing this

Configuration

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"				
   }
        
    ]
}


Log

When I follow these steps:

  1. Run DEBUG=* homebridge
  2. Let it run for five minutes
  3. Tap a switch
  4. Wait one minute
  5. Tap the same switch

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"

Notes

Please write about things that you did not see fit the above headers.

Cannot read property 'length' of undefined

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)

Error loading plugin on RPi

[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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.