SmartThings
Control your Samsung SmartThings ecosystem from FaustBot. Manage lights, switches, locks, thermostats, sensors, and activate scenes for the ultimate smart streaming setup.
Overview
FaustBot connects to SmartThings via the cloud API for comprehensive smart home control:
Device Control
Turn on/off switches, lights, and plugs.
Lighting
Adjust brightness, color, and temperature.
Scenes
Activate SmartThings scenes instantly.
Thermostat
Control temperature and HVAC modes.
Locks
Lock and unlock smart door locks.
Sensors
Read motion, contact, and temperature sensors.
Setup
Connect SmartThings
Create Personal Access Token
Go to SmartThings Tokens and create a new personal access token. Select the scopes for devices, scenes, and any other capabilities you want to use.
Configure FaustBot
In FaustBot, go to Integrations → SmartThings. Paste your personal access token and click Connect.
Select Location
Choose which SmartThings location to control. If you have multiple homes, select the one where your streaming setup is located.
Verify Devices
Your devices should now appear in FaustBot. Test by toggling a light or activating a scene.
Token Scopes
When creating your token, enable these scopes for full functionality: r:devices:*, x:devices:*, r:scenes:*, x:scenes:*, r:locations:*.
Effects
Switch Control
Turn On
Turn on a switch or light.
Turn Off
Turn off a switch or light.
Toggle
Toggle device state.
Lighting Control
Set Brightness
Adjust light brightness (0-100%).
Set Color
Change light color (HSB).
Set Temperature
Set color temperature (K).
Scenes & Climate
Activate Scene
Run a SmartThings scene.
Set Thermostat
Adjust temperature settings.
Lock/Unlock
Control smart locks.
Scripting API
Control SmartThings devices from your scripts:
Device Control
# Get all devices
devices = CPH.SmartThingsGetDevices()
for device in devices:
CPH.LogInfo(f"Device: {device['name']} ({device['type']})")
# Control a switch
CPH.SmartThingsTurnOn("Living Room Light")
CPH.SmartThingsTurnOff("Living Room Light")
CPH.SmartThingsToggle("Living Room Light")
# Check device status
status = CPH.SmartThingsGetDeviceStatus("Living Room Light")
CPH.LogInfo(f"Switch is: {status['switch']}")Lighting
# Set light brightness (0-100)
CPH.SmartThingsSetBrightness("Desk Lamp", 75)
# Set light color (hue 0-360, saturation 0-100)
CPH.SmartThingsSetColor("LED Strip", 280, 100) # Purple
# Set color temperature (2700-6500K)
CPH.SmartThingsSetColorTemperature("Desk Lamp", 4000)
# Dim lights for stream
CPH.SmartThingsSetBrightness("Room Light", 30)
CPH.SmartThingsSetColor("LED Strip", 270, 80) # Stream purpleScenes
# Get available scenes
scenes = CPH.SmartThingsGetScenes()
for scene in scenes:
CPH.LogInfo(f"Scene: {scene['name']}")
# Activate a scene
CPH.SmartThingsActivateScene("Stream Mode")
# Example: Scene based on stream status
def Execute():
if args["isLive"]:
CPH.SmartThingsActivateScene("Streaming")
else:
CPH.SmartThingsActivateScene("Normal")
return TrueThermostat & Locks
# Get thermostat status
status = CPH.SmartThingsGetThermostatStatus("Thermostat")
CPH.LogInfo(f"Current temp: {status['temperature']}°")
CPH.LogInfo(f"Mode: {status['mode']}")
# Set thermostat mode
CPH.SmartThingsSetThermostatMode("Thermostat", "cool") # heat, cool, auto, off
# Set target temperature
CPH.SmartThingsSetTemperature("Thermostat", 72)
# Lock/unlock a smart lock
CPH.SmartThingsLock("Front Door")
CPH.SmartThingsUnlock("Front Door")See the full API reference for all available SmartThings methods.