Welcome Guest Search | Active Topics | Members | Log In | Register

Light control Options · View
flay
Posted: Tuesday, May 08, 2012 6:30:18 PM
Groups: Member

Joined: 1/2/2008
Posts: 36

Rank:
Rank based on contribution points and purchased points. Click to see details. (2144)
more and more got dedicate cinema room.
a simple light control implementation would be great.
Like takeoff downlight at video start, 10% dimming at pause ect ....

Nexa, Z-wave ....
mastricx
Posted: Thursday, May 24, 2012 5:30:40 AM
Groups: Member

Joined: 1/15/2011
Posts: 5
Location: Albany, NY

Rank:
Rank based on contribution points and purchased points. Click to see details. (2503)
I think this is more of a function of Media Center, I recall seeing this before as I have an INSTEON and SmartLinc setup.
coldzero
Posted: Friday, June 01, 2012 5:02:07 PM
Groups: Member

Joined: 4/15/2010
Posts: 14

Rank:
Rank based on contribution points and purchased points. Click to see details. (2500)
You can do this already in MyMovies. What you want to look at is here:

http://www.mymovies.dk/how-to/written-documentation.aspx?Page=My%20Movies%203%20User%20Customization

Under Event Handlers. If you do a little scripting you can send the commands for various actions to your automation software and have it do whatever you want it to do.
coldzero
Posted: Friday, June 01, 2012 5:39:04 PM
Groups: Member

Joined: 4/15/2010
Posts: 14

Rank:
Rank based on contribution points and purchased points. Click to see details. (2500)
using System;
using System.IO;
using System.Text;
using System.Windows.Forms;


public class DefaultEventHandler : MyMovies.ProgramEventHandler
{
//Return the name of the event handler
public string Name
{
get { return "Default Event Handler"; }
}

//Return the version of the event handler
public double Version
{
get { return 1.0; }
}

//Return a description of the event handler
public string Description
{
get { return "Default Event Handler"; }
}

//Use this function to perform actions when My Movies is launched
public void Launched()
{
WriteLog("DefaultEventHandler.Launched");
//System.Windows.Forms.MessageBox.Show("It Works!");

}

//Use this function to perform actions when playback is started
public void PlayStarted(MyMovies.ProgramEventHandler.PlayElement itmPlayElement, MyMovies.ProgramEventHandler.PlayEnvironment itmPlayEnvironment, MyMovies.ProgramEventHandler.PlayType itmPlayType, string strMediaPath)
{
WriteLog("DefaultEventHandler.PlayStarted");

//Run the scripts that will lower the lights
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents = false;
proc.StartInfo.FileName = "C:\\Program Files (x86)\\HomeSeer HS2\\Scripts\\dim_lights.bat";
proc.Start();

}

//Use this function to perform actions when playback is stopped. If intros or trailers is enabled, this is only fired when the actual items playback is stopped.
public void PlayStopped()
{
WriteLog("DefaultEventHandler.PlayStopped");
//Run the scripts that will raise the lights
System.Diagnostics.Process proc = new System.Diagnostics.Process();
proc.EnableRaisingEvents = false;
proc.StartInfo.FileName = "C:\\Program Files (x86)\\HomeSeer HS2\\Scripts\\raise_lights.bat";
proc.Start();
}

//Use this function to be informed when a title is added to the users collection
public void TitleAdded(int intTitleId, int intEventSource, int intSourceType)
{
WriteLog("DefaultEventHandler.TitleAdded");
System.Windows.Forms.MessageBox.Show("It Works!");

//intEventSource 1: By user
//intEventSource 2: By folder monitoring
//intEventSource 3: By disc copy
//intEventSource 4: By Media Changer monitoring
//intEventSource 5: By folder import
//intEventSource 0: By unknown source
}

private void WriteLog(string strString)
{
StreamWriter strLogger = new StreamWriter(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\My Movies\\DefaultEventHandler.log", true, Encoding.Default);
strLogger.WriteLine(DateTime.Now.ToString("yyyy-MM-dd HHMoney in mouthmLips are sealeds . ff") + " - " + strString);
strLogger.Close();
}
}

Is the event handler code I wrote that just let me mess with those two raise_lights and dim_lights batch files after this was compiled. This is in C#, which I don't know very well so there might be a better way of doing this but this should get you on the right track at least.
etc6849
Posted: Monday, December 17, 2012 7:05:53 PM
Groups: Member

Joined: 11/4/2011
Posts: 34

Rank:
Rank based on contribution points and purchased points. Click to see details. (2500)
Thanks coldzero. I'm going to do something similar, but with Premise. I'll have to use an HTTP GET to initiate the script in Premise, but I'm hoping that's not too hard in c#.

Here's some more links on the subject if anyone is planning to do something similar:
http://experts.windows.com/frms/windows_entertainment_and_connected_home/f/25/p/99771/528027.aspx

http://www.mymovies.dk/how-to/written-documentation.aspx?Page=My%20Movies%203%20User%20Customization

PS: It's too bad My Movies can't just keep a tcp socket open and just post ascii when these events occur. This seems like a burdensome way to integrate My Movies into my system.
Users browsing this topic
guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

Powered by Yet Another Forum.net version 1.9.0 (NET v2.0) - 10/10/2006
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.