Project Awesome project awesome

Frameworks > homebridge-smartrent

A Homebridge plugin for integrating SmartRent locks, thermostats, leak sensors, and switches with Apple HomeKit via real-time WebSocket connection.

Package 2 stars GitHub


Homebridge SmartRent

verified-by-homebridge

npm version npm downloads GitHub Stars GitHub Last Commit GitHub pull requests GitHub issues FOSSA Status

The most comprehensive SmartRent Homebridge integration to date, Homebridge Verified. Control your SmartRent devices with Apple Home: supporting 6 device types w/ real-time updates, battery monitoring, and advanced status reporting.


Supported Devices

Device HomeKit Service Capabilities
🔒 Locks LockMechanism + Battery
  • Lock/unlock
  • Battery level
  • Low battery alerts
  • Jam detection
  • Auto-lock timer
🌡️ Thermostats Thermostat + Fan
  • Mode control (heat/cool/auto/aux heat)
  • Temperature
  • Humidity
  • Fan mode
  • Real-time operating state
💧 Leak Sensors LeakSensor + Battery
  • Leak detection
  • Battery level
  • Low battery alerts
🔍 Motion Sensors MotionSensor
  • Motion detection
  • Real-time updates
🔌 Switches Switch
  • On/off control
💡 Dimmers Lightbulb
  • On/off control
  • Brightness control

All devices report online/offline status via the StatusActive characteristic.

Homebridge dashboard


Architecture

graph TD
    Home["🏠 Apple Home"]

    subgraph Homebridge
        platform["<b>SmartRentPlatform</b><br>DynamicPlatformPlugin"]
        accessories["<b>Accessories</b><br>Lock · Thermostat · Leak<br>Motion · Switch · Dimmer"]
    end

    subgraph SmartRent Cloud
        rest["<b>REST API</b><br>control.smartrent.com/api/v3"]
        ws["<b>WebSocket</b><br>Phoenix protocol<br>real-time state updates"]
        auth["<b>OAuth + TOTP</b><br>authentication/sessions"]
    end

    Home <-->|"HomeKit"| accessories
    platform --> accessories
    platform -->|"device discovery<br>state commands"| rest
    platform <-->|"heartbeat 30s<br>attribute events"| ws
    platform -->|"email/password<br>+ optional 2FA"| auth
    auth --> rest
    auth --> ws

Features

  • Real-time updates — WebSocket connection with Phoenix heartbeat for instant state changes across all devices
  • 6 device types — Locks, thermostats, leak sensors, motion sensors, switches, and dimmers
  • Accurate HVAC status — Uses the thermostat's actual operating state (heating/cooling/idle), not just the target mode
  • Lock jam detection — Detects and reports lock jams via SmartRent notification events
  • Battery monitoring — Battery level and low-battery alerts for locks and leak sensors
  • Device online/offline status — Reports device reachability for all device types
  • Two-factor authentication — Full TOTP support for secured SmartRent accounts
  • Auto-lock — Configurable timer to automatically re-lock after unlocking
  • Per-device toggles — Enable or disable any device type independently via config

Installation

Install Homebridge, add it to Apple Home, then install and configure Homebridge SmartRent.

Recommended

  1. Open the Homebridge UI.

  2. Open the Plugins tab, search for homebridge-smartrent, and install the plugin.

  3. Log in to SmartRent through the settings panel, and optionally set your unit name.

Plugin settings screenshot

Manual

  1. Install the plugin using NPM:

    npm i -g @jackietreeh0rn/homebridge-smartrent
    
  2. Configure the SmartRent platform in ~/.homebridge/config.json as shown in config.example.json.

  3. Start Homebridge:

    homebridge -D
    

Configuration

Property Type Default Description
email string required SmartRent account email
password string required SmartRent account password
tfaSecret string 32-character TOTP seed for two-factor authentication
unitName string Unit name — only needed if you have multiple units. Find it in the SmartRent app under the More tab.
enableLocks boolean true Enable lock accessories
enableThermostats boolean true Enable thermostat accessories
enableLeakSensors boolean true Enable leak sensor accessories
enableMotionSensors boolean true Enable motion sensor accessories
enableSwitches boolean true Enable switch accessories
enableSwitchMultiLevels boolean true Enable dimmer/multilevel switch accessories
enableAutoLock boolean false Automatically re-lock after unlocking
autoLockDelayInMinutes integer 5 Minutes to wait before auto-locking
excludeDevices array List of SmartRent device IDs to exclude from HomeKit. Device IDs are shown in logs at startup.
lowBatteryThreshold integer 20 Battery percentage at or below which devices report low battery status (5–50)
temperatureUnit string fahrenheit Temperature display unit for thermostats (fahrenheit or celsius)
verboseLogging boolean false Enable verbose debug logging for troubleshooting

Development

Prerequisites

  • Node.js 18.20.4+, 20.18.0+, 22.10.0+, or 24.0.0+
  • Homebridge 1.8.0+ or 2.0.0-beta+

Setup

npm install
npm run build
npm link

Watch Mode

Automatically recompiles and restarts Homebridge on source changes:

npm run watch

This runs a local Homebridge instance in debug mode using the config at ./test/hbConfig/. Stop any other Homebridge instances first to avoid port conflicts. The watch behavior can be adjusted in nodemon.json.

Linting & Formatting

npm run lint        # check for lint errors
npm run lint:fix    # auto-fix lint errors
npm run prettier    # check formatting
npm run format      # auto-fix formatting

Commits must follow Conventional Commits — enforced by pre-commit hooks via commitlint and husky.


Troubleshooting

If you run into issues, check the Homebridge troubleshooting wiki first. If the problem persists, open an issue with as much detail as possible.


Contributing

See CONTRIBUTING.md for guidelines on bug reports, feature requests, and code contributions.


Useful Resources

Read the full write-up: Homebridge SmartRent & Blink — an architectural deep-dive into how both plugins map their respective APIs into HomeKit (HAP service composition, IMMI streaming, OAuth/2FA, motion polling).


License

GNU GENERAL PUBLIC LICENSE, Version 3


Disclaimer

This project is not endorsed by, directly affiliated with, maintained, authorized, or sponsored by SmartRent Technologies, Inc or Apple Inc. All product and company names are the registered trademarks of their original owners. The use of any trade name or trademark is for identification and reference purposes only and does not imply any association with the trademark holder of their product brand.

Back to Internet of Things