node-red-contrib-samsung-smartthings 1.0.0
Node-RED nodes for Samsung SmartThings device control and automation via the SmartThings REST API
node-red-contrib-samsung-smartthings
Professional Node-RED nodes for Samsung SmartThings device control and automation.
This package provides a complete set of nodes to interact with the SmartThings REST API, enabling you to manage locations, rooms, devices, scenes, and execute device commands directly from Node-RED flows.
Features
- Full SmartThings API coverage — Locations, Rooms, Devices, Status, Commands, Scenes, and Events
- Real-time event monitoring — Polling-based change detection that outputs messages only when device values change
- Dynamic & static configuration — Use editor dropdowns for quick setup, or override any parameter via
msgproperties at runtime - Shared configuration — A single config node securely stores your API token and is shared across all SmartThings nodes
- Energy monitoring — Read energy and power meter data from compatible devices
- Cascading dropdowns — Device, capability, and command selectors populate dynamically based on your SmartThings account
- Professional error handling — Rate limiting, retry logic, and visual node status indicators
Installation
Install via the Node-RED Palette Manager, or run:
cd ~/.node-red
npm install node-red-contrib-samsung-smartthings
Prerequisites
You need a SmartThings Personal Access Token (PAT) for authentication:
- Navigate to https://account.smartthings.com/tokens
- Sign in with your Samsung account
- Generate a new token with the required scopes (Devices, Locations, Scenes)
- Copy the token — you will need it for the configuration node
Note: For production integrations, use OAuth 2.0. PATs are intended for testing and personal use.
Nodes
| Node | Description |
|---|---|
| smartthings-config | Configuration node — stores API token and base URL (shared by all nodes) |
| smartthings-locations | Retrieve SmartThings locations |
| smartthings-rooms | Retrieve rooms within a location |
| smartthings-devices | List and filter devices by location, room, or capability |
| smartthings-status | Get device status including energy/power meter readings |
| smartthings-command | Execute commands on devices (switch, dim, color, lock, etc.) |
| smartthings-scenes | List and execute SmartThings scenes |
| smartthings-events | Monitor device changes in real-time via intelligent polling |
Quick Start
- Drag a smartthings-devices node onto your flow
- Double-click and create a new SmartThings Config — enter your API token
- Select a location filter (optional) and deploy
- Connect an inject node to trigger it and a debug node to see the output
- Deploy and click the inject button to retrieve your devices
Dynamic Usage
Every node supports dynamic override via msg properties. Static dropdown values serve as defaults; msg values always take priority.
Example: Dynamic device command
{
"deviceId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"component": "main",
"capability": "switch",
"command": "on",
"arguments": []
}
Send this as the msg object to a smartthings-command node (with no static configuration) and it will execute the command dynamically.
Event Monitoring
The smartthings-events node monitors a device and outputs a message only when its status changes. This provides a subscription-like experience using intelligent polling.
Setup:
- Select a device, optionally filter by component/capability
- Set the polling interval (default: 10 seconds)
- Connect to a debug node or downstream flow
Dynamic control via input:
{
"action": "start",
"deviceId": "your-device-id",
"capability": "energyMeter",
"interval": 5
}
Send { "action": "stop" } to pause monitoring.
API Reference
This package communicates with the SmartThings REST API v1:
- Base URL:
https://api.smartthings.com - API Documentation
- Capabilities Reference
License
Apache-2.0 — Copyright 2026 Layer-IT