Download the PHP package oguzhantogay/philips-hue-client without Composer
On this page you can find all versions of the php package oguzhantogay/philips-hue-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download oguzhantogay/philips-hue-client
More information about oguzhantogay/philips-hue-client
Files in oguzhantogay/philips-hue-client
Package philips-hue-client
Short Description A modern, fully-featured PHP client for Philips Hue smart lights
License MIT
Informations about the package philips-hue-client
Philips Hue Client for PHP
A modern, fully-featured PHP client for Philips Hue smart lights. Control lights, rooms, scenes, and schedules with an elegant API. Framework-agnostic with built-in support for Laravel, Symfony, and standalone PHP applications.
โจ Features
- ๐จ Complete Hue API v2 Support - Lights, groups, scenes, schedules, sensors
- ๐ Auto Bridge Discovery - Automatic bridge detection using mDNS/N-UPnP
- ๐ก Intuitive API - Fluent interface for natural command chaining
- ๐ฌ Scene Management - Create, modify, and activate scenes
- ๐ญ Built-in Effects - Color loops, breathing, alerts, and custom animations
- โก Event Streaming - Real-time updates via Server-Sent Events (SSE)
- ๐ ๏ธ CLI Tool - Command-line interface for quick control
- ๐ REST API Server - Full REST API with Swagger documentation
- ๐ฆ Framework Integration - Ready-made adapters for popular frameworks
- ๐งช Fully Tested - Comprehensive test coverage with mocked responses
- ๐ Resource Monitoring - Track energy usage and light statistics
- ๐ Secure - Supports Hue's enhanced security mode
- ๐ Performance - Connection pooling, caching, and retry mechanisms
- ๐ณ Docker Ready - Container support for easy deployment
- ๐ Rate Limiting - Prevents API abuse and protects bridge
- ๐พ Smart Caching - Automatic caching with configurable TTL
๐ Requirements
- PHP 8.0 or higher
- Philips Hue Bridge (v2 or newer)
- Network access to Hue Bridge
- ext-json
- ext-curl (optional, for better performance)
๐ Installation
Install via Composer:
๐ง Quick Start
Bridge Discovery & Authentication
Basic Light Control
Room/Group Control
Scenes
Advanced Effects
Schedules
Real-time Events (SSE)
๐ ๏ธ CLI Usage
The package includes a powerful CLI tool:
๐ REST API Server
The package includes a full REST API server with Swagger documentation:
Quick Start
The API will be available at:
- API Base URL:
http://localhost:8080/api
- Swagger Documentation:
http://localhost:8080/docs
- Health Check:
http://localhost:8080/api/health
API Endpoints
Bridge Management
GET /api/health
- Bridge connectivity statusGET /api/bridge/info
- Bridge informationGET /api/bridge/config
- Bridge configuration
Lights
GET /api/lights
- List all lightsGET /api/lights/{id}
- Get specific lightPUT /api/lights/{id}/state
- Set light statePATCH /api/lights/{id}/state
- Update light state partiallyPUT /api/lights/{id}/name
- Rename light
Groups & Rooms
GET /api/groups
- List all groupsGET /api/rooms
- List all roomsGET /api/zones
- List all zonesGET /api/groups/{id}
- Get specific groupPOST /api/groups
- Create new groupPUT /api/groups/{id}/action
- Control groupDELETE /api/groups/{id}
- Delete group
Scenes
GET /api/scenes
- List all scenesGET /api/scenes/{id}
- Get specific scenePOST /api/scenes
- Create new scenePUT /api/scenes/{id}/activate
- Activate sceneDELETE /api/scenes/{id}
- Delete scene
Schedules
GET /api/schedules
- List all schedulesGET /api/schedules/{id}
- Get specific schedulePOST /api/schedules
- Create new schedulePUT /api/schedules/{id}
- Update scheduleDELETE /api/schedules/{id}
- Delete schedule
Sensors
GET /api/sensors
- List all sensorsGET /api/sensors/{id}
- Get specific sensorPUT /api/sensors/{id}/state
- Update sensor state
Example API Usage
Environment Configuration
Create a .env
file (copy from .env.example
):
๐ Framework Integration
๐ Laravel Integration
Installation & Setup
Configuration
Environment Variables
Service Provider Registration
Usage Examples
Artisan Commands
๐ก Symfony Integration
Installation & Setup
Bundle Registration
Configuration
Environment Variables
Service Usage
Console Commands
Standalone/Vanilla PHP
๐ณ Docker Development
Quick Start with Docker
Development Environment
One-Click Development
๐งช Testing
๐ Performance Features
Connection Pooling
Caching & Retry
Rate Limiting
The REST API automatically rate limits requests to protect your bridge:
- Limit: 100 requests per minute per IP
- Headers:
X-RateLimit-Limit
,X-RateLimit-Remaining
- Error: HTTP 429 when exceeded
๐ Examples
Check the /examples
directory for complete examples:
Basic Examples
basic-control.php
- Simple light controlparty-mode.php
- Multi-room party effectsrest-api-client.php
- REST API usage examplesworking-example.php
- Complete working exampleinteractive-test.php
- Interactive testing
Framework Integration Examples
laravel-controller.php
- Laravel controller integrationsymfony-controller.php
- Symfony controller integration
Creative & Advanced Examples
music-sync-party.php
- ๐ต Music-synchronized party lighting with beat detectionsecurity-system.php
- ๐ Home security integration with motion alertsgaming-mood-lighting.php
- ๐ฎ Gaming lighting with health bars and achievementsweather-based-lighting.php
- ๐ค๏ธ Weather-responsive ambient lightingbiometric-health-integration.php
- ๐ Health monitoring with biometric datasmart-home-automation.php
- ๐ Complete smart home automation hub
๐ Community Showcase
Built something awesome? Share it with us!
Project | Description | Author |
---|---|---|
Hue DJ Controller | Sync lights with DJ mixer | @username |
Smart Office Bot | Slack bot for office lighting | @username |
Gaming Immersion | React to game events | @username |
๐ฌ Join the Discussion
- ๐ Report bugs
- ๐ก Request features
- ๐ฌ General discussion
- ๐ Get help
๐ค Contributing
Contributions are welcome! Please see CONTRIBUTING.md for details.
๐ License
The MIT License (MIT). Please see License File for more information.
๐ Links
๐ Support
If you find this package useful, please consider:
- โญ Starring the repository
- ๐ Reporting bugs
- ๐ก Suggesting new features
- ๐บ Buying me a coffee
Made with โค๏ธ by Oguzhan Togay
All versions of philips-hue-client with dependencies
ext-json Version *
clue/buzz-react Version ^2.0
doctrine/instantiator Version ^1.5.0
guzzlehttp/guzzle Version ^7.0
nesbot/carbon Version ~2.66.0
psr/log Version ^1.1|^2.0|^3.0
react/event-loop Version ^1.0
slim/psr7 Version ^1.0
slim/slim Version ^4.0
symfony/console Version ^6.0|^7.0
symfony/finder Version ^6.0|^7.0