Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

How do I reset and restart a timer?

Do you have questions about writing plugins or scripts in Python? Meet the coders here.
Post Reply
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

How do I reset and restart a timer?

Post by Mastiff »

I am working on my RollerTrol blinds, and I have regular Nexa plug-in modules for power to the 12V power supplies to them. So if the power supply is off I need to turn it on and then wait 5 seconds (the blinds for some reason need a bit of time to "charge up" the power before they react reliably to commands) and then fire the command. But I don't want those 12V PSUs running all the time, both so I don't have something that is using power unnecessary and for fire safety reasons, so I start a timer that counts down from five minutes to 0 and then turns off the power supplies (so far I'm only using a regular trigger event:

Code: Select all

eg.plugins.EventGhost.TriggerEvent(u'Main.Gardinstr\xf8m av', 300.0)
But I don't think this can be reset, right? So how would I do to reset? Because sometimes I want to open/close one or two of the blinds again, and sometimes I want toopen them all again, and so on. So I have a variable set when the power is turned on, and that saves me the 5 seconds wait before sending the blinds command. But if power is turned off by the timer while the blinds are on the way up or down, that's annoying. ;) So how do I reset the timer and give myself 5 more minutes if I send another command within those 5 minutes?
User avatar
Luca Brasi
Experienced User
Posts: 262
Joined: Sat Oct 11, 2008 12:39 pm

Re: How do I reset and restart a timer?

Post by Luca Brasi »

You could have a look at the Standby Time plugin. Its purpose is to handle standby times but the actual standby is triggered by another eg action.
So you could use it to trigger your wanted action and use its Trigger Standby Timer action for the reset.
I think the plugin is a default in eg but not sure.
Win10 x64 Prof. / Eventghost latest / MCE Plugin / MCE RC6 Receiver / Logitech Harmony Hub / MediaPortal / kodi
Mastiff
Experienced User
Posts: 872
Joined: Thu May 03, 2012 10:43 am

Re: How do I reset and restart a timer?

Post by Mastiff »

Thanks, I'll check that out! :mrgreen:
Post Reply