MagicHome LED
Control MagicHome-compatible LED controllers and smart bulbs directly from FaustBot. Create vibrant stream lighting effects triggered by chat, events, or scripts.
Overview
FaustBot integrates with MagicHome LED controllers using the local network protocol, providing comprehensive control over your LED strips and smart bulbs:
Device Discovery
Automatically discover MagicHome devices on your network.
Power Control
Turn individual devices or all devices on/off.
Color Control
Set RGB colors by value or hex code.
Brightness
Adjust brightness levels for any device.
White Mode
Set warm or cool white on supported devices.
Built-in Patterns
Activate preset patterns and effects.
Setup
Connect to MagicHome Devices
Ensure Network Connection
Make sure your MagicHome LED controllers are connected to the same local network as your computer running FaustBot. They should be configured via the MagicHome app first.
Discover Devices
In FaustBot, go to MagicHome in the sidebar. Click Discover to scan your network for compatible devices.
Connect to Devices
Select the devices you want to control and click Connect. FaustBot will establish a connection and display the device status.
Manual IP Entry
If discovery fails, you can manually add a device by entering its IP address. Find device IPs in your router's connected devices list or the MagicHome app.
Effects
Power Control
Set Power
Turn a specific device on or off.
All On
Turn all connected devices on.
All Off
Turn all connected devices off.
Color Control
Set Color
Set RGB color values (0-255).
Set Color Hex
Set color using hex code.
All Color
Set same color on all devices.
Set Brightness
Adjust brightness (0-100%).
Set White
Set warm/cool white level.
Patterns
Set Pattern
Activate pattern by ID.
Set Pattern by Name
Activate pattern by name.
Get Patterns
List available patterns.
Scripting API
Control MagicHome devices programmatically from your scripts:
Discovery and Connection
# Discover MagicHome devices on the network
devices = CPH.MagicHomeDiscover()
for device in devices:
CPH.Log(f"Found device: {device['ip']}")
# Get all configured devices
all_devices = CPH.MagicHomeGetDevices()
for dev in all_devices:
CPH.Log(f"Device: {dev['name']} - {dev['ip']}")
# Get a specific device by ID
device = CPH.MagicHomeGetDevice("device-id")
CPH.Log(f"Device state: {device['power']}")
# Connect to a device
CPH.MagicHomeConnect("device-id")
# Disconnect from a device
CPH.MagicHomeDisconnect("device-id")Power Control
# Set power state for a specific device
CPH.MagicHomeSetPower("device-id", True) # Turn on
CPH.MagicHomeSetPower("device-id", False) # Turn off
# Turn all devices on
CPH.MagicHomeAllOn()
# Turn all devices off
CPH.MagicHomeAllOff()Color and Brightness
# Set color using RGB values (0-255)
CPH.MagicHomeSetColor("device-id", 255, 0, 128)
# Set color using hex code
CPH.MagicHomeSetColorHex("device-id", "#FF0080")
# Set same color on all devices
CPH.MagicHomeAllColor(0, 255, 0) # Green on all devices
# Set brightness (0-100)
CPH.MagicHomeSetBrightness("device-id", 75)
# Set white level for warm/cool white LEDs (0-255)
CPH.MagicHomeSetWhite("device-id", 200)Patterns and Effects
# Get available patterns
patterns = CPH.MagicHomeGetPatterns()
for pattern in patterns:
CPH.Log(f"Pattern: {pattern['id']} - {pattern['name']}")
# Set pattern by ID (speed: 0-100, higher is faster)
CPH.MagicHomeSetPattern("device-id", 37, 50) # Pattern 37 at 50% speed
# Set pattern by name
CPH.MagicHomeSetPatternByName("device-id", "Rainbow", 75)See the full API reference for all available MagicHome methods.