Author Topic: Stopwatch / timer in events?  (Read 726 times)

Domodude

  • Guest
Stopwatch / timer in events?
« on: April 01, 2012, 08:55:03 pm »
Is it possible to put timers in events? It's different from 'timed events'.
Example: turn of mirror heating in the bathroom after it was turned on 30 minutes ago.

posde

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3207
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Stopwatch / timer in events?
« Reply #1 on: April 01, 2012, 09:04:49 pm »
yes.

There is a pause or sleep command in DCERouter that you can select.

EDIT: Just looked: Delay is the name of the command.

Domodude

  • Guest
Re: Stopwatch / timer in events?
« Reply #2 on: April 02, 2012, 12:32:48 pm »
There is a pause or sleep command in DCERouter that you can select. Delay is the name of the command.
Awesome! Not sure why I did not notice this, but I will try this tonight  :)

posde

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3207
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Stopwatch / timer in events?
« Reply #3 on: August 23, 2015, 07:44:25 pm »
Although this is a fairly old topic, we had a feature request for this in trac.

While doing a LinuxMCE install on Cyprus the user requested a similar feature. And after thinking a bit about it, we found out, that this can be achieved with a dedicated egg timer device. The egg timer receives the device in question to be turned on, as well as the amount of time in seconds before it should be turned off. What is different from the use of Delay is, that if the event that started the egg timer (or different event that would extend the egg timer) happens, the egg timer gets extended and does not turn off after the first period of time.

If anyone is interested in testing this new device, please download http://deb.linuxmce.org/possy/eggtimer into /usr/pluto/bin, and add the Egg Timer device below your CORE.

Feedback is greatly appreciated.

phenigma

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1252
    • View Profile
Re: Stopwatch / timer in events?
« Reply #4 on: August 26, 2015, 06:21:00 am »
This is awesome!  I have not had a chance to test this but I have been looking for this type of thing for some time.  For me I see it as a perfect use case with motion detectors and lighting.  As long as motion is detected the on-time is extended.  When the detection no longer occurs for a period of time it is turned off.  Very handy!

J.

posde

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3207
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Stopwatch / timer in events?
« Reply #5 on: August 26, 2015, 09:47:51 am »
As always, feedback is appreciated. If everybody is happy with it, we might make it a must-have device and can amend the security plugin for the camera and lighting with it.

posde

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3207
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: Stopwatch / timer in events?
« Reply #6 on: Today at 10:31:12 am »
There has been an update to the binary, as well as to the device template.

You now have the ability to define a sensor to verify before turning OFF the device in question.

The way the egg timer works is:

* Send Start Egg Timer to the device with the parameters DeviceToLink (the light that will be turned on at the beginning), Timeout (the time after which the light will be turned off), VerifyStateDeviceID (the Device ID of the sensor that should be verified at the end of the timeout if it is tripped. If it is, the timer will be extended by the initial timeout.

* Send Cancel Egg Timer if you want to cancel the above timer before the end has been reached with a parameter defining if the OFF command should happen or not.

The reason for the new VerifyStateDeviceID are people that work the whole time, thus never stopping the motion sensor being tripped. Now it will continue to keep the light on.

Again, the binary is currently downloadable from http://deb.linuxmce.org/possy/eggtimer - and there is a small wiki page about it:

http://wiki.linuxmce.org/index.php/Egg_Timer

Feedback is appreciated.

PS: If you do not see the VerifyStateDeviceID when sending the Start Egg Timer command, make sure to sqlCVS upgrade the DCE repo.