Skip to main content

Philips Hue notification system with CLI and daemon

Project description

huesignal 💡

PyPI version Python 3.11+ License: MIT

Visual feedback for AI agents and automation workflows.

Turn your Philips Hue lights into a status dashboard. Perfect for coding agents to signal task progress, CI/CD pipelines to show build status, and developers who want ambient feedback without context-switching.

# Green pulse = task complete
huesignal effect apply pulse -l desk-light -c green -b 0.7

# Red blinks = error/blocker  
huesignal effect apply blink -l desk-light -c red --count 3

⚡ 60-Second Quickstart

# Install
uv pip install huesignal       # or: pip install huesignal

# Authenticate (press bridge link button when prompted)
huesignal auth login

# Discover your lights
huesignal lights list

# Signal success!
huesignal effect apply pulse -l "your-light-name" -c green

🎯 Why huesignal?

Use Case Example
AI Agent Feedback Coding agents signal task claim (blue), completion (green), errors (red blink)
CI/CD Visualization Build stages light up different colors as pipeline progresses
Pomodoro Timer Breathing effect during focus, pulse when break starts
Meeting Alerts Progressive brightness increase as meeting approaches
Script Status Long-running scripts pulse when done or blink on failure

📦 Installation

Using uv (Recommended)

uv pip install huesignal

From Source

git clone https://github.com/ThomasRohde/huesignal.git
cd huesignal
uv sync
uv run huesignal --version

Using pip/pipx

pip install huesignal     # or: pipx install huesignal

🎨 Effects Reference

Available Effects

Effect Description Best For
pulse Quick brightness flash Notifications, task completion
blink Rapid on/off toggle Errors, alerts, attention-grabbing
breathe Smooth fade in/out Ambient status, "working" indicator
rainbow Color cycle animation Celebrations, demos

Common Options

Option Short Description Example
--light -l Target light name -l desk-light
--color -c Color (name or hex) -c green, -c "#FF5500"
--brightness -b Brightness level -b 0.7 (70%), -b 100 (100%)
--duration -d Effect duration (ms) -d 2000
--count Repeat count (pulse/blink) --count 3
--no-restore Keep final state Don't restore original

Colors

Named colors: red, green, blue, yellow, orange, purple, pink, cyan, white, magenta

Semantic colors: success (green), error (red), warning (orange), info (blue), working (sky blue), celebration (gold)

Hex codes: #FF0000, #00FF00, #0000FF, etc.

Brightness Formats

-b 75       # Percentage (0-100)
-b 0.75     # Decimal (0.0-1.0)  
-b 191      # Raw Hue value (1-254)

🤖 Agent Workflow Patterns

Perfect for AI coding agents to provide visual status:

# Task claimed - blue pulse
huesignal effect apply pulse -c blue -b 0.5 2>/dev/null || true

# Task complete - green pulse
huesignal effect apply pulse -c green -b 0.7 2>/dev/null || true

# Error/blocker - red blinks
huesignal effect apply blink -c red --count 3 -b 1.0 2>/dev/null || true

# Working/thinking - slow breathe
huesignal effect apply breathe -c working -d 3000 2>/dev/null || true

# Celebration - rainbow!
huesignal effect apply rainbow -d 5000 2>/dev/null || true

Tip: Append 2>/dev/null || true in scripts to gracefully handle missing bridge/lights.

Environment Variable

Set a default light to avoid -l on every command:

export HUESIGNAL_LIGHT_NAME="desk-light"
huesignal effect apply pulse -c green    # Uses desk-light automatically

🎼 YAML Programs (Symphony of Lights)

Create choreographed multi-light sequences with YAML programs.

Quick Start

# Run a program
huesignal run examples/celebration.yaml

# Validate without executing
huesignal run my-program.yaml --validate

# Preview timing (requires bridge)
huesignal run my-program.yaml --dry-run

YAML Schema

name: program-name              # Required: Unique identifier
description: What this does     # Optional: Human-readable description

tracks:                         # Required: List of light tracks
  - light: "light-name"         # Required: Light name or pattern (supports *)
    steps:                      # Required: Sequence of actions
      
      # Effect step - apply a visual effect
      - effect: pulse           # Effect name: pulse, blink, breathe, rainbow
        options:                # Optional: Effect-specific options
          color: green
          brightness: 200
          count: 2
        duration_ms: 1500       # Step duration in milliseconds
      
      # Wait step - pause the timeline
      - wait: 500               # Pause in milliseconds
      
      # Set step - direct state change
      - set:
          on: true              # Power state
          brightness: 150       # 1-254
          color: "#FF6600"      # Hex, name, or [x, y] tuple
          transition_ms: 300    # Fade duration

      # Parallel execution - use start_ms for absolute positioning
      - start_ms: 0             # Starts at time 0
        effect: pulse
        duration_ms: 2000
      - start_ms: 0             # Also starts at 0 - runs in parallel!
        effect: breathe
        duration_ms: 2000

Parallel Execution

By default, steps run sequentially. Use start_ms to specify absolute start times for parallel execution:

steps:
  # These run in parallel (both start at 0ms)
  - start_ms: 0
    effect: pulse
    options: { color: blue, count: 3 }
    duration_ms: 3000
  - start_ms: 0
    effect: breathe
    options: { color: cyan }
    duration_ms: 3000
  
  # This runs after (starts at 3000ms)
  - start_ms: 3000
    effect: rainbow
    duration_ms: 2000

Example: Celebration Sequence

name: celebration
description: Victory dance for completed milestones

tracks:
  - light: desk-light
    steps:
      - effect: pulse
        options:
          color: success
          count: 3
        duration_ms: 2000
      - wait: 200
      - effect: rainbow
        duration_ms: 4000

  - light: ambient-light
    steps:
      - wait: 500
      - effect: breathe
        options:
          color: celebration
        duration_ms: 5000

See the examples/ directory for more programs.


📋 Command Reference

Authentication

huesignal auth login                    # Pair with bridge (stores credentials)
huesignal auth login --bridge-ip 192.168.1.100  # Specify bridge IP

Lights

huesignal lights list                   # Show all lights with status
huesignal lights list --filter desk     # Filter by name
huesignal lights show <name>            # Detailed light info
huesignal lights on <name>              # Turn on
huesignal lights on <name> -b 50        # Turn on at 50% brightness
huesignal lights off <name>             # Turn off

Effects

huesignal effect list                   # Show available effects
huesignal effect params <name>          # Show effect parameters
huesignal effect apply <name> [options] # Apply effect
huesignal effect play <file.yaml>       # Run YAML program

Programs (Shorthand)

huesignal run <file.yaml>               # Execute YAML program
huesignal run <file.yaml> --validate    # Validate only (no bridge needed)
huesignal run <file.yaml> --dry-run     # Preview without execution

Samples

huesignal samples list                  # List automation templates
huesignal samples show <name>           # Display a sample

Utilities

huesignal doctor                        # Diagnostic checks
huesignal doctor --verbose              # Detailed diagnostics
huesignal cache clear                   # Clear cached data
huesignal --explain                     # Comprehensive usage examples

🧪 Testing

Unit Tests

pytest tests/                           # Mocked, no bridge required

Integration Tests

export HUESIGNAL_BRIDGE_IP="192.168.1.100"
export HUESIGNAL_APP_KEY="your-app-key"
pytest tests/integration/               # Requires real bridge

⚠️ Integration tests modify light state. Only run against your own bridge.


🔧 Configuration

Environment Variables

Variable Description
HUESIGNAL_LIGHT_NAME Default light for commands when -l is omitted
HUESIGNAL_BRIDGE_IP Override bridge IP (skips discovery)
HUESIGNAL_APP_KEY Override app key (skips keyring)

Credential Storage

Credentials are stored securely in Windows Credential Manager (or system keyring on macOS/Linux).


📚 More Resources


🏗️ Architecture

huesignal uses aiohue for async bridge communication:

  • Full Hue API v2 support — Latest bridge features
  • Async/await — Non-blocking for responsive CLI
  • Battle-tested — Powers Home Assistant

📄 License

MIT — see LICENSE


Make your lights dance. 💡✨

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

huesignal-1.0.0.tar.gz (835.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

huesignal-1.0.0-py3-none-any.whl (63.6 kB view details)

Uploaded Python 3

File details

Details for the file huesignal-1.0.0.tar.gz.

File metadata

  • Download URL: huesignal-1.0.0.tar.gz
  • Upload date:
  • Size: 835.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for huesignal-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c7da13430d62aae94b56f480ddca9af5b99e11596ee12fdc766a62b53ecbdd9b
MD5 e324ded92a4127cd3ddaf64d9d11d7d4
BLAKE2b-256 76f75fa7901a1baff77d3ca1a3fdae55b18990e47cf6ba0b73797dc75f261952

See more details on using hashes here.

Provenance

The following attestation bundles were made for huesignal-1.0.0.tar.gz:

Publisher: publish.yml on ThomasRohde/huesignal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file huesignal-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: huesignal-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 63.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for huesignal-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5b3c0a0973c02b98235e287adc1e6a414fa6c8d29513911d3821b2f492afef6a
MD5 acafde475819452a964c034490499948
BLAKE2b-256 56271791f629128bfee8095a47fd9e41fb16dbb5ec53068e19d121cd14bc26ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for huesignal-1.0.0-py3-none-any.whl:

Publisher: publish.yml on ThomasRohde/huesignal

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page