Is there a way to run a custom script when using emby theater / cinema mode? In short, I would like the script to dim my lights (run an Insteon scene) when using emby theater and when the main feature beings. Ideally the script would allow the "previews" to first play, then the "custom intro", then the script executes as the main feature starts.
1) Cinema Mode Trailers (x2) <-- do nothing; wait
2) Custom Intro trailer (x1) <-- do nothing; wait
3) Main Feature <-- execute script
Ideally emby would also be able to pass some environmental information (i.e. connected client and device) to the script when it is called. For example, I would only want this script to run iff user == x && client == y. (I don't need the lights to dim [or turn on] if I am watching from my laptop remotely or in a different room.)
Writing the python or perl script would be quite trivial as I already know how to interface that with my home lighting system. I just want theater mode / cinema mode to trigger that script and pass the proper variables at the correct time (after trailers and custom intro, but before main feature.)
A current workaround may be to use prowl (or some other message server) and watch for events. If the events are detailed enough, I can pattern to find the client and device, and match do detect when the the main feature starts and then execute the python script, but this is not as elegant as it may take a different machine to watch the events.
Any pointers or thoughts anyone may be able to give would be most appreciated.