LinuxMCE Forums

General => Users => Topic started by: nosebreaker on April 30, 2009, 05:00:00 pm

Title: Power off MD at midnight? (timed events issue)
Post by: nosebreaker on April 30, 2009, 05:00:00 pm
I'd like to have all media directors shut off at midnight if they are still powered on (except the core of course).  I got lights to shut off but for some reason the MD's don't shut down with the timed event.  I can power them off from an orbiter just fine.  Any thoughts?
Title: Re: Power off MD at midnight? (timed events issue)
Post by: hari on April 30, 2009, 05:24:27 pm
iirc they take a different command to power down than on/off..
Title: Re: Power off MD at midnight? (timed events issue)
Post by: seth on April 30, 2009, 06:50:22 pm
I think this would be a great feature. Have them power off, and then at a specific time in the morning, power back up.
How green would that be?

I am going to check into this tonight, and see if I can come up with something as well. Please post back any findings here, during you experimentation. I will as well.

Regards,

Seth
Title: Re: Power off MD at midnight? (timed events issue)
Post by: Dale_K on April 30, 2009, 07:46:34 pm
I am actually doing this and have been for a while.  I'll post my timed event setup when I get home tonight.
Title: Re: Power off MD at midnight? (timed events issue)
Post by: seth on May 01, 2009, 01:58:02 pm
I look forward to your setup. This is something I have not been able to implement yet. I would like to use it. It would greatly reduce the monthly electric bill, and also possibly reduce some heat in certain cases.

Perhaps over the weekend I will give it a try.

Regards,

Seth
Title: Re: Power off MD at midnight? (timed events issue)
Post by: bulek on May 04, 2009, 03:29:41 pm
I am actually doing this and have been for a while.  I'll post my timed event setup when I get home tonight.

Please add content to Wiki and let us know about it....

Regards,

Bulek.
Title: Re: Power off MD at midnight? (timed events issue)
Post by: donpaul on May 04, 2009, 03:38:51 pm
You have to use the core general info plugin, and halt the device:
(http://donpaul.info/1.png)

OR, if you use the suspend feature, then use the app server plugin to spawn the suspend script:
(http://donpaul.info/2.png)

The use wake to turn it back on:
(http://donpaul.info/3.png)
Title: Re: Power off MD at midnight? (timed events issue)
Post by: tschak909 on May 04, 2009, 06:45:48 pm
Beautiful! :)

As an exercise, let's see if we can make a "Wizard" that you can select from the pulldown, to select MDs to turn on and off.

-Thom
Title: Re: Power off MD at midnight? (timed events issue)
Post by: Marie.O on May 04, 2009, 06:49:58 pm
And don't forget not to turn off if stuff is currently playing ...
Title: Re: Power off MD at midnight? (timed events issue)
Post by: donpaul on May 07, 2009, 03:20:52 am
Beautiful! :)

As an exercise, let's see if we can make a "Wizard" that you can select from the pulldown, to select MDs to turn on and off.

-Thom

Now that would be cool!
Title: Re: Power off MD at midnight? (timed events issue)
Post by: bulek on May 07, 2009, 12:06:47 pm
And don't forget not to turn off if stuff is currently playing ...
Hi,

just curious, how can I determine if MD is currently playing anything and act upon that (or not act).... ?

Thanks in advance,

regards,

Bulek.
Title: Re: Power off MD at midnight? (timed events issue)
Post by: Marie.O on May 07, 2009, 12:32:00 pm
just curious, how can I determine if MD is currently playing anything and act upon that (or not act).... ?

TCP Port 12000 on the MD contains timestamps with information about what is playing atm.
Title: Re: Power off MD at midnight? (timed events issue)
Post by: tschak909 on May 07, 2009, 01:32:01 pm
That's the time code port for the Xine Player, and does not work in all cases.

-Thom
Title: Re: Power off MD at midnight? (timed events issue)
Post by: bulek on May 07, 2009, 04:17:40 pm
Hi,

I was more thinking about doing this under event handler or scenarios. For instance, don't make speech announcement if I'm playing video....

Possible ?

Thanks in advance,

regards,

Bulek.
Title: Re: Power off MD at midnight? (timed events issue)
Post by: donpaul on May 09, 2009, 02:14:33 am
Hi,

I was more thinking about doing this under event handler or scenarios. For instance, don't make speech announcement if I'm playing video....

Possible ?

Unfortunately, I don't think it is possible. There is no way to check if video is playing. Maybe that can be added, but the functionality isn't there right now.
Title: Re: Power off MD at midnight? (timed events issue)
Post by: tschak909 on May 09, 2009, 07:08:24 am
events are emitted, and are stateless, so doing this as an event is not an option.

-Thom
Title: Re: Power off MD at midnight? (timed events issue)
Post by: donpaul on May 09, 2009, 08:28:08 am
events are emitted, and are stateless, so doing this as an event is not an option.

-Thom

Currently ;-)

If there was a way to set something (like we can currently set the room to "8th Dimension") when media is played, then we could only fire said event if that setting is _not_ (like if the room is not "8th Dimension"). Then when media stops playing, fire said event. Hope that made sense, probably not.

I suspend all MD anyway - playing media or not - at "lights out". Just thinking out loud for the benefit of others.
Title: Re: Power off MD at midnight? (timed events issue)
Post by: tschak909 on May 09, 2009, 02:58:45 pm
Oh no, I was merely stating that we'll have to implement a concept of states.

This will be _interesting_ because of the wide variety of devices LMCE can control, and the fact that most of these devices LMCE can't be sure if it really IS on or OFF....

I'd like this very much, actually.

-Thom
Title: Re: Power off MD at midnight? (timed events issue)
Post by: donpaul on May 09, 2009, 03:51:13 pm
Oh no, I was merely stating that we'll have to implement a concept of states.

This will be _interesting_ because of the wide variety of devices LinuxMCE can control, and the fact that most of these devices LinuxMCE can't be sure if it really IS on or OFF....

I'd like this very much, actually.

-Thom

I agree. I think it's important and would open up the possibility for a smarter home and more complicated events.
Title: Re: Power off MD at midnight? (timed events issue)
Post by: colinjones on May 09, 2009, 11:18:14 pm
What would be nice is if someone took on the task of coding a "logic module" type DCE device. Something that could store (in SQL), set and read an arbitrary number of user defined states, could intercept any events, and issue any DCE commands. And critically, from the web admin, or just a .conf file, you could build sequence logic blocks and add them as config entries to the device for it to process. Then it could act as a programable sequencer module.

Each block of "code" (could be a basic script-like definition the the event/command to trigger it, states to check, and resulting actions based on this testing) would be loaded up by the device on reload and subscribe to the necessary events, etc (not sure if you can do synchronous even interception, which would kind of be important for several different purposes) and then behave as a much more sophisticated programable sequencer for any part of LMCE.... we would finally be able to access the true power of the DCE messaging system :)
Title: Re: Power off MD at midnight? (timed events issue)
Post by: Marie.O on May 10, 2009, 12:52:16 am
At the moment a lot of logic is in the Event_Plugin ...
Title: Re: Power off MD at midnight? (timed events issue)
Post by: colinjones on May 10, 2009, 01:29:21 am
At the moment a lot of logic is in the Event_Plugin ...

Understood, but I am more talking about a generic framework device that allows users easily to add short config "scripts" that provide logic and sequencing facilities by accessing the events generated by the event plugin, other devices, commands, statuses stored in the database, even the ability to check for the existance of particular files, etc, and then trigger some action based on that, like sending other events or commands or even executing bash scripts, and so on. Like a simple state machine. The "Generic Sequencing Device"! A central, house-wide plugin, that has the framework for all this, and a user can simply configure the specifics by adding a "script".... does that make sense?
Title: Re: Power off MD at midnight? (timed events issue)
Post by: nosebreaker on May 12, 2009, 04:49:39 pm
Well, I guess for now I am just going to use rsh or a cron job to have it shut down at midnight then.  Any easy way to wake it up or send it a "magic packet"?
Title: Re: Power off MD at midnight? (timed events issue)
Post by: tschak909 on May 12, 2009, 06:48:06 pm
General Info Plugin > Wake Device.

-Thom
Title: Re: Power off MD at midnight? (timed events issue)
Post by: totallymaxed on May 12, 2009, 07:22:52 pm
Hi,

I was more thinking about doing this under event handler or scenarios. For instance, don't make speech announcement if I'm playing video....

Possible ?

Unfortunately, I don't think it is possible. There is no way to check if video is playing. Maybe that can be added, but the functionality isn't there right now.

Well we hide events from the Orbiter when certain media types are playing... so I would guess we can tell when these media types are playing and if they are then optionally have some behaviour that either  waits until the media type is no longer in use on that MD or just goes ahead and powers off the MD.

Andrew
Title: Re: Power off MD at midnight? (timed events issue)
Post by: seth on May 12, 2009, 07:55:54 pm
 :)
Here is a snip from my "House to sleep mode" Lighting scenario in the master bedroom, (for when I turn in for the night)
1st Image.
And here is the "Timed Event" that I use to wake up the MD's (Power them on)
2nd Image

This is the ultimate home control system. It NEVER ceases to amaze me with its seemingly infinite potential.

Regards,

Seth
Title: Re: Power off MD at midnight? (timed events issue)
Post by: donpaul on May 13, 2009, 04:40:26 am
Well, I guess for now I am just going to use rsh or a cron job to have it shut down at midnight then.  Any easy way to wake it up or send it a "magic packet"?

Use the general info plugin -> halt to shutdown the device.
Title: Re: Power off MD at midnight? (timed events issue)
Post by: donpaul on May 13, 2009, 04:43:34 am
:)
Here is a snip from my "House to sleep mode" Lighting scenario in the master bedroom, (for when I turn in for the night)
1st Image.


Does the MD really turn off with your event? Because that never worked for me (and I just tried it again to verify). I had to use the general info -> halt to shutdown the MD.