![]() Systemd users can add the following lines to the 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: Start Homebridge using sudo homebridge or change capabilities accordingly ( setcap cap_net_raw=pe /path/to/bin/node). This plugin requires extra permissions due to the use of pinging and magic packages. 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. A shutdown command is executed if it is configured. Whenever you flick a switch to its off position via HomeKit, the device is immediately marked as turning off. Once all commands are completed, the device will be monitored again by the pinger - switching its state automatically. If a wakeCommand is configured, it will be called after the wait is over. ![]() Then the plugin will wait for the time configured by wakeGraceTime (defaults to 45s). After the device has been started, it is marked as online. 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. Whenever you flick a switch to its on position via HomeKit, the device is marked as "turning on". This pinging will result in state changes between online and offline. If pingCommand is configured, it is used instead of actual pings and will result in an immediate state change. 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. The pinging by actual pings or use of the pingCommand will continue in the background, monitoring the state of the device. If the pinging or pingCommand executes successfully, the device is considered online and vice versa. This is done by pinging or executing the pingCommand once, depending on the configuration. Whenever Homebridge starts, the plugin will check the state of all configured devices. Whether or not to let the plugin return early to mitigate Siri issue (see #85). The syslog log level to use such as Debug, Info, Error. Timeout for the shutdown command in seconds. Number of seconds to wait after shutdown before checking offline status, default 15 Use 0 (default) to disable the timeoutĬommand to run in order to shut down the remote machine Number of seconds to wait after startup before checking online status and issuing the wakeCommand, default 45Ĭommand to run after initial startup, useful for macOS users in need of running caffeinate Timeout for the start command in seconds. Defaults to 255.255.255.255Ĭommand to run in order to start the machine The broadcast address to use when sending the Wake on LAN packet. Allows any format such as XX:XX:XX:XX:XX:XX or XXXXXXXXXXXX The device's MAC address - used to send Magic Packets. Note: these settings render those mentioned in the above section useless. Ping interval in seconds, only used if host is set, default 2. If an error is thrown or the command exits with a non-zero exit code, the host is considered down If the command exits successfully (zero as the exit code) the host is considered up. Number of seconds to wait for pinging to finish, default 1Ĭommand to run in order to know if a host is up or not. The number of pings necessary to trigger a state change, only used if host is set, default 5 The IP address or hostname to ping in order to receive current status Defaults to a random id which is reset each time the server restarts. Defaults to "NetworkDevice"Ī unique id for the accessory. The name of the device - used in HomeKit apps as well as Siri, default My NetworkDevice Optional configuration Accessory information Key The type of accessory - has to be "NetworkDevice" "shutdownCommand": "sshpass -p 'raspberry' ssh -oStrictHostKe圜hecking=no sudo shutdown -h now "įor 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. "shutdownCommand": "net rpc shutdown -ipaddress 192.168.1.151 -user username%password " "shutdownCommand": "ssh macbook.local sudo shutdown -h now " "wakeCommand": "ssh macbook.local caffeinate -u -t 300 ", "pingCommand": "ssh macbook.local 'if ] then exit 1 else echo 1 fi ' ",
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |