Skip to content
Homebridge TestFlight
Protocols and bridges

Cmd4

homebridge-cmd4 · v8.0.4

LocalHomebridge 2.0

Exposes any HomeKit accessory type driven by shell commands or scripts you provide.

What it says it supports

Devices it names

  • Any accessory via exec scripts

Shows up in Apple Home as from its README

Sensor readings in its code

What people report

Generic command-line plugin; the evidence only shows a user running a Samsung home theater switch and a CO2 sensor via scripts.

  • Works2
DeviceStatusWhat they saidSource
Generic CarbonDioxideSensorWorkscarbonDioxideLevel supported by polling it alongside CarbonDioxideDetected; user got it working
Saved copy
… CarbonDioxideDetected works in my Home.app, but carbonDioxideLevel are not displayed. Am I wrong? [image: 2019-06-05 23 35 47] This is part of a config.txt. { "type": "CarbonDioxideSensor", "name": "CO2", "carbonDioxideDetected": 0, "carbonDioxideLevel": 0, "polling": false, "interval": 540, "stateChangeResponseTime": 3, "state_cmd": "ruby ~/.homebridge/cmd4.rb" }, This is part of a ruby script. mode, acs_name, chara, value = ARGVcase acs_kindwhen "CO2" field = "co2" ppm = current_value(field,location) case chara when "CarbonDioxideDetected" puts ppm > 1000 ? 1 : 0 when "CarbonDioxideLevel" …

Excerpt saved from GitHub on 2026-10-22.

Issue #25 · 2019-06
Samsung HT-D5500 home theaterWorksSet up as a Switch via scripts; manufacturer/model/serial can be set for any device
Saved copy
… device.Which I have done 😉 I’m busy scripting up some motion sensors to be used as person presence detectors so I get notifications when my kids come home. What I’d love to find is a list of all devices supported by the Apple HomeKit app, as many of them appear as Not Supported. I also tried the Television device for my TV, but found it dificult to configure And the other thing that I note is that Gotta solve this too: [6/5/2020, 21:32:52] [Cmd4] The file $HOME/.homebridge/Cmd4Scripts/PersonPresent.sh does not exist, It is highly likely the state_cmd will fail. Hint: Do not use wildcards that …

Excerpt saved from GitHub on 2026-10-22.

Issue #53 · 2020-06

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

Executes local shell commands

Compatibility

Verified by HomebridgeNo
Homebridge versions^1.8.0 || ^2.0.0-beta.0
Homebridge 2.0Yes
Node.js^18.20.4 || ^20.18.0 || ^22.10.0 || ^24.0.0
Settings in Homebridge UINo
MatterNo
LicenseMIT

Community signals

Downloads a week80
Downloads a month684
GitHub stars158
Open issues2
Closed issues141
Last code push2026-02-03
Latest version8.0.4 (2026-02-03)
First published2017-12-06
Releases123

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

  • Author stopped supporting it as of September 2025

HomeKit services in its code

Found by scanning the published npm package. A plugin can register a service only for some devices.

  • AccessCode
  • AccessControl
  • AccessoryMetrics
  • AccessoryRuntimeInformation
  • AirPurifier
  • AirQualitySensor
  • AssetUpdate
  • Assistant
  • AudioStreamManagement
  • Battery
  • BridgeConfiguration
  • BridgingState
  • CameraControl
  • CameraOperatingMode
  • CameraRTPStreamManagement
  • CameraRecordingManagement
  • CarbonDioxideSensor
  • CarbonMonoxideSensor
  • CloudRelay
  • ContactSensor
  • DataStreamTransportManagement
  • Diagnostics
  • Door
  • Doorbell
  • Fan
  • Fanv2
  • Faucet
  • FilterMaintenance
  • FirmwareUpdate
  • GarageDoorOpener
  • HeaterCooler
  • HumidifierDehumidifier
  • HumiditySensor
  • InputSource
  • IrrigationSystem
  • LeakSensor
  • LightSensor
  • Lightbulb
  • LockManagement
  • LockMechanism
  • Microphone
  • MotionSensor
  • NFCAccess
  • OccupancySensor
  • Outlet
  • Pairing
  • PowerManagement
  • ProtocolInformation
  • SecuritySystem
  • ServiceLabel
  • Siri
  • SiriEndpoint
  • Slats
  • SmartSpeaker
  • SmokeSensor
  • Speaker
  • StatefulProgrammableSwitch
  • StatelessProgrammableSwitch
  • Switch
  • TapManagement
  • TargetControl
  • TargetControlManagement
  • Television
  • TelevisionSpeaker
  • TemperatureSensor
  • Thermostat
  • ThreadTransport
  • TimeInformation
  • TransferTransportManagement
  • Tunnel
  • Valve
  • WiFiRouter
  • WiFiSatellite
  • WiFiTransport
  • Window
  • WindowCovering