CMD Switch
homebridge-cmdswitch2 · v0.2.10
Adds switches that run command-line commands, for turning things on, off or checking state via Siri.
What it says it supports
Devices it names
- CLI commands (ping, shutdown, wakeonlan)
Shows up in Apple Home as from its README
What people report
Generic shell-command switch plugin; reports are about running console tools (PS4, Xbox) and mostly come down to permissions or sudo.
- Works2
- Partly works1
| Device | Status | What they said | Source |
|---|---|---|---|
| Raspberry Pi HDMI monitor (tvservice) | Works | State command fixed with correct command from TwitterSaved copyI'm having some difficulty here. I'm using a tutorial that's out of date for Homebridge to control my Pi's monitor. I want it off when I'm not present, and on when I am, with the state of the rest of my smart home. I've modified the suggested config, as tvservice doesn't control my HDMI port correctly. My modifications work, however, I have no idea how to fix the "state_cmd", and it's always off. If I run tvservice on the command line as listed in the config, it returns nothing. If I run it without the grep, it returns: state 0xa [HDMI CUSTOM RGB lim 16:9], 1920x1080 @ 60.00Hz, progressive As … Excerpt saved from GitHub on 2026-10-22. | Issue #59 · 2020-05 |
| Sony PlayStation 4 (via ps4-waker) | Works | Works after adding sudo to commands and redoing credentials on Raspberry PiSaved copyHello everyone, I'm trying to use CMDSwitch2 with ps4-waker. I was able to setup both while Homebridge running on Macbook. Works very good. But I need to move it to a Homebridge on Raspberry Pi. After installing ps4-waker I'm able to turn on/off Playstation manually typing "ps4-waker" or "ps4-waker standby. But it doesn't work with Homebridge + CMDSwitch2. Not responding. But no errors. After setup of both plugins, I can see the new device in the Home app on iOS. But pressing Playstation button does nothing. Do anyone have the same issue? Everything is updated. Node -v v8.9.3 NPM -v 5.5.1 … Excerpt saved from GitHub on 2026-10-22. | Issue #35 · 2017-12 |
| Microsoft Xbox (xbox-poweroff) | Partly works | Off command works in terminal, fails in plugin; likely permissionsSaved copyI have a switch setup with this as the off command: "off_cmd": "/home/pi/venv/bin/xbox-poweroff --address 192.168.1.35 --liveid FXXXXXXXXXXXXXXX" this works fine if I run it from a terminal in PuTTy. if I put it in the off_cmd line on cmdswitch2 it fails. do I need to put it in a virtual environment (source venv/bin/activate) first? how do I make this work? I used to run Homebridge straight from PuTTy, but i got tired of manually having to launch it if it crashed. now I set hb-service up and i'm running into all kinds of problems. this is the only one I can't seem to figure out. i figured out … Excerpt saved from GitHub on 2026-10-22. | Issue #64 · 2020-07 |
Gathered from the plugin’s GitHub issues, pull requests, discussions, wiki and docs, and from r/homebridge. These are individual reports, so check the linked thread and the date before you buy.
How it connects
Local
Runs shell commands on the Homebridge host
You’ll need
- Commands runnable by the Homebridge user
Compatibility
| Verified by Homebridge | No |
|---|---|
| Homebridge versions | >=0.3.0 |
| Homebridge 2.0 | No |
| Node.js | >=0.12.0 |
| Settings in Homebridge UI | No |
| Matter | No |
| License | ISC |
Community signals
| Downloads a week | 25 |
|---|---|
| Downloads a month | 226 |
| GitHub stars | 175 |
| Open issues | 47 |
| Closed issues | 22 |
| Last code push | 2021-12-19 |
| Latest version | 0.2.10 (2017-11-12) |
| First published | 2016-04-17 |
| Releases | 30 |
In ReReHome
Whatever this plugin publishes reaches Apple Home as a normal HomeKit accessory behind your Homebridge bridge, so ReReHome shows and controls it like any other.
Bridges get their own settings page listing the accessories behind them.
Caveats from the README
- This plugin is archived, deprecated or on Homebridge’s unmaintained list.
- Replaces deprecated homebridge-cmdswitch; accessories re-created
HomeKit services in its code
Found by scanning the published npm package. A plugin can register a service only for some devices.
- Switch