A small containerized application that controls a LIFX light based on your Microsoft Teams presence and Discord voice channel activity. The light color changes to indicate your current status across these platforms, helping others know when you're in meetings, sharing your camera, or streaming.
- Controls LIFX light based on:
- Microsoft Teams presence (Available, Busy, Do Not Disturb, Away)
- Discord voice channel activity (Camera, Screen Share, Streaming)
- Priority-based status handling (configurable through environment variables)
- Web interface for configuration and monitoring
- REST API endpoints for integration with other services
- Docker support for easy deployment
- Node.js v16+ (for development)
- Docker and Docker Compose (for deployment)
- LIFX smart light
- LIFX API key
- Microsoft Graph API token
- Discord bot token and application
-
LIFX API Key:
- Get from https://cloud.lifx.com/settings
- Create a new token with read/write access
-
Microsoft Graph API:
- Register application in Azure AD
- Grant necessary permissions for presence API
- Generate access token
-
Discord Bot:
- Create application at https://discord.com/developers/applications
- Create bot and get token
- Enable required intents (Presence, Server Members, Message Content)
- Get your Discord user ID (Developer Mode -> Right click your name -> Copy ID)
-
Clone the repository:
git clone <repository-url> cd status-light
-
Install dependencies:
npm install
-
Create .env file:
# API Keys LIFX_API_KEY=your_lifx_api_key MS_GRAPH_API_KEY=your_microsoft_graph_token DISCORD_API_KEY=your_discord_bot_token DISCORD_USER_ID=your_discord_user_id # Service Settings SERVICE_PRIORITY=teams,discord POLLING_INTERVAL=5000 # Teams Light Colors TEAMS_AVAILABLE=green TEAMS_BUSY=red TEAMS_DO_NOT_DISTURB=purple TEAMS_AWAY=yellow TEAMS_OFFLINE=off # Discord Light Colors DISCORD_STREAMING=blue DISCORD_CAMERA_ON=purple
-
Start the development server:
npm run dev
-
Build and start using Docker Compose:
docker-compose up -d
-
View logs:
docker-compose logs -f
SERVICE_PRIORITY: Comma-separated list of services in priority order (e.g., "teams,discord")POLLING_INTERVAL: How often to check for status changes (in milliseconds)- Color settings:
- Can be any color name supported by LIFX
- Setting a status to "off" will turn the light off for that state
-
Enable these privileged intents:
- PRESENCE INTENT
- SERVER MEMBERS INTENT
- MESSAGE CONTENT INTENT
- GUILD VOICE STATES
-
Required bot permissions:
- Read Messages/View Channels
- View Server Insights
- Send Messages
- Read Message History
- Connect to Voice Channels
- View Voice Channel Status
Permission integer for easy setup: 274877975552
/api/services- Get current status of all services/api/health- Service health check/api/logs- View recent logs/api/config/keys- Update API keys
Access the web interface at http://localhost:3000 to:
- View current status
- Update API keys
- Monitor logs
- Check service health
- Console shows essential startup and error logs
- Detailed logs available via web interface or API
- Log files stored in
logsdirectory:error.log: Error messagesdetailed.log: Detailed debug information
The service uses the priority order defined in SERVICE_PRIORITY to determine which status to display when multiple services are active. For example, with SERVICE_PRIORITY=teams,discord:
- Teams status takes precedence if active
- Discord status is used if Teams is inactive
- Light turns off if no service is active
-
Light not responding:
- Verify LIFX API key
- Check light is online in LIFX app
- Confirm light name matches configuration
-
Discord status not updating:
- Verify bot is in server
- Check bot permissions
- Confirm correct user ID in configuration
-
Teams status not updating:
- Verify Graph API token
- Check token permissions
- Ensure token hasn't expired