Not waking/shutting down my iMac
See original GitHub issueBackstory
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:
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!
Issue Analytics
- State:
- Created 6 years ago
- Comments:33 (15 by maintainers)
Top GitHub Comments
@amaisano Yes and no. Yes as this issue mostly has to do with Macs “lying” about their state. No as there’s most likely an issue with the internal state machine that has come up in other issues.
A PR came in yesterday mentioning pinging which may or may not be related.
I’d say that your best off following the milestone https://github.com/AlexGustafsson/homebridge-wol/milestones to follow progress.
If u are using “oznu/docker-homebridge” the user “abc” is running node and with this your ssh keys are at a different location. If thats your problem u can go to /config/.ssh and put your keys there.