For anyone who uses Android and XBMC, you're probably familiar with YATSE. It is pretty much the best remote control/widget/streaming app for XBMC. Among other things, it features broadcast intents, allowing it to be controlled and automated by apps like AutoMagic.
Its API is documented over here: http://yatse.leetzone.org/redmine/proje ... t/wiki/Api
I have built a couple Flows for this app.
One catches the "Status Change" broadcasts YATSE puts out, dumps basically all available info to local variables, and then processes the results with a script.
The other flow contains disconnected examples of basically every command you can send to your media center through YATSE.
I tried to make my examples as complete and easy to understand as possible, to save others a lot of work

I personally am using this to automate some sync functions in YATSE, to ensure my TV shows have the correct "watched" status. This facilitates the "watch next episode" functionality.
Also I have a Pebble watch, and use Pebble Remote for arbitrary automation functionality, so this stuff all kinda works together.