https://github.com/febinbaiju/smartthings-shutdown-automation-connector
A lightweight Node.js SmartApp integration for Samsung SmartThings. This app listens for a virtual switch event and securely triggers a Raspberry Pi system shutdown. Built for automation enthusiasts using SmartThings + Raspberry Pi.
https://github.com/febinbaiju/smartthings-shutdown-automation-connector
automation iot nodejs raspberry-pi samsung smartthings webhook
Last synced: about 2 months ago
JSON representation
A lightweight Node.js SmartApp integration for Samsung SmartThings. This app listens for a virtual switch event and securely triggers a Raspberry Pi system shutdown. Built for automation enthusiasts using SmartThings + Raspberry Pi.
- Host: GitHub
- URL: https://github.com/febinbaiju/smartthings-shutdown-automation-connector
- Owner: febinbaiju
- Created: 2025-06-06T16:31:31.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-07T08:02:39.000Z (about 1 year ago)
- Last Synced: 2025-06-20T02:04:32.240Z (12 months ago)
- Topics: automation, iot, nodejs, raspberry-pi, samsung, smartthings, webhook
- Language: JavaScript
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Samsung SmartThings Shutdown Connector
A Node.js-based SmartApp that integrates with Samsung SmartThings and allows you to remotely trigger a system shutdown using a virtual switch.
## π Features
* Configure a SmartThings virtual switch to trigger system shutdown.
* Securely integrates using SmartThings SmartApp lifecycle events.
* Subscribes to `switch.on` events to trigger shutdown.
* Automatically deletes/re-creates subscriptions on update.
* Turns off the switch after triggering shutdown.
---
## π¦ Requirements
* Node.js (v16 or later recommended)
* A SmartThings developer account
* A Raspberry Pi (or any Linux system that supports `shutdown`)
---
## π Project Structure
```
smartthings-shutdown-connector/
βββ app.js # Main application logic
βββ .env # Environment variable configuration
βββ package.json # Project dependencies and scripts
βββ README.md # You're reading it!
```
---
## π§ Installation
```bash
# Clone the repo
git clone https://github.com/your-username/smartthings-shutdown-connector.git
cd smartthings-shutdown-connector
# Install dependencies
npm install
# Setup environment variables
cp .env.example .env
# Edit .env and add required values
```
### Example `.env`
```ini
PORT=5165
APP_NAME=SmartThings Shutdown
APP_DESCRIPTION=Trigger system shutdown from SmartThings
APP_ID=your-app-id
```
---
## πββοΈ Usage
Start the server:
```bash
npm start
```
Make sure the server is publicly accessible (you can use [ngrok](https://ngrok.com) during development).
Then, install your SmartApp on Samsung SmartThings Developer Workspace:
* Use your public endpoint (e.g., via ngrok) as the SmartApp URL.
* Grant permissions for `switch` capability.
* Choose your virtual switch during configuration.
---
## βοΈ Lifecycle Events Supported
* `CONFIGURATION`
* `INSTALL`
* `UPDATE`
* `EVENT`
* `UNINSTALL`
---
## β οΈ Important Notes
* Your server needs `sudo` permission to run `shutdown`.
* Itβs recommended to configure your system to allow passwordless shutdown for your service user.
* The virtual switch will be turned off automatically after triggering.
---
## π¨βπ» Author
**Febin Baiju**