Hey everyone, I wanted to share a project I’ve been working on that combines my love for home automation with my passion for home theater. I’ve managed to integrate my Emby media server with openHAB to control my lights based on what I’m watching! ![]()
![]()
The Goal
I wanted to create a system where my lights automatically adjust depending on whether I’m watching a movie, a TV show, or listening to music. For example, when I start a movie, the lights should dim or turn off, and when I pause or finish, they should return to their previous state. It’s all about enhancing the viewing experience while keeping things convenient.
The Setup
Here’s what I used:
- Emby Media Server running on a Synology NAS
- openHAB installed on a Raspberry Pi
- Smart Lights controlled via Zigbee
- Emby Scripter-X Plugin for scripting
How It Works
- Emby Scripter-X Plugin: This plugin allows me to trigger scripts when certain events happen, like starting or stopping playback.
- openHAB Items: I created two items in openHAB—one to track the playback state and another for the media type (movie, episode, audio).
- Shell Scripts: I wrote simple shell scripts to send commands to openHAB when playback starts or stops. These scripts handle turning lights off or on and adjusting their brightness.
- Rules in openHAB: Based on the media type, openHAB executes different actions. For movies, lights dim; for TV shows, they dim slightly; and for music, they stay on but softer.
The Outcome
It’s been working amazingly! I no longer have to manually adjust the lights every time I start something. The system is seamless and enhances the overall experience. Plus, it’s been a great learning project that combined my interests in both media servers and smart home tech.
Looking for Feedback
I’d love to hear if anyone else has done something similar or has ideas for improvements. Maybe adding support for different rooms or integrating with a sound system? Let me know your thoughts! ![]()
Cheers,
[Your Name]