Vera - Smarter Home Control Forum

Advanced => Programming => Scene Scripting => Topic started by: futzle on February 09, 2012, 06:38:19 am

Title: Countdown timer plugin (UI5)
Post by: futzle on February 09, 2012, 06:38:19 am
I've just put a plugin onto apps.mios.com that makes scriptable countdown timer devices.  Combined with scenes, this plugin can eliminate the need to use Luup in several real-world scenarios.

Fetch the plugin here: Countdown timer (http://apps.mios.com/plugin.php?id=1588). This plugin is UI5/6 only.

By itself, a countdown timer doesn't do much. When the Start button is pressed, a timer counts down seconds from a (configurable) start value.  Left to its own devices, when the timer hits zero, it stops.

What makes the plugin useful is that the Start button is scriptable: like a virtual switch it can be run as a target action for any scene. Any Vera event can start a timer.

There is also a Cancel button to abort a timer.  That, too, can be triggered by a scene.

For more complicated scening, there is a Restart button that does exactly the same as Start, except that it resets the timer back to its start duration even if it's currently counting down.  Finally, there's a Force button, equivalent to grabbing the kitchen timer and wrenching it down to zero (ding!).

When a timer completes, or if it's cancelled, the timer device triggers an event.  You can use this event to start a scene that can make your Vera do anything that is scenable.

Timers can be Muted, which just prevents them from generating an event.  This might be useful if you want to disable a timer during a certain time of the day: it still counts down but doesn't go Ding.

Tip for creating multiple timers: Apps > Countdown Timer > Create Another.

Some scenarios in the next post.
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on February 09, 2012, 06:39:30 am
Scenarios using the Countdown timer plugin:
Title: Countdown timer example: turn off a light after 5 minutes
Post by: futzle on February 09, 2012, 03:49:42 pm
In this example, imagine that you have a light that you want to turn off five minutes after it is turned on.  If the light is turned off manually before 5 minutes, do nothing.

1. Create a Countdown Timer. Rename it Five minute timer. Go to the configuration tab and change the Duration to 300 seconds.
2. Create a scene. Rename it Light goes on. Edit the scene, setting a trigger for the light device: A device is turned on or off > Device is turned on. Make the scene activate the Start button on the Five Minute Timer.
3. Create a second scene. Rename it Light goes off. Edit the scene, setting a trigger for the light device: A device is turned on or off > Device is turned off. Make the scene activate the Cancel button on the Five Minute Timer.
4. Create a third scene. Rename it Turn light off. Edit the scene, setting a trigger for the Five Minute Timer: Timer completes while not muted. Make the scene activate the Off button on the light device.

Mute the timer to temporarily override the automatic turning off of the light.
Title: Re: Countdown timer plugin (UI5)
Post by: chixxi on February 10, 2012, 04:41:54 am
Nice, that's a very pretty solution for this kind of problem (disarming alarm systems):
http://forum.micasaverde.com/index.php/topic,8996.0.html
Title: Countdown timer example: DIY alarm entry delay
Post by: futzle on February 10, 2012, 04:43:03 am
Though I wouldn't recommend it from a security perspective, you can roll your own alarm system from components. In this example, assume you have a Z-Wave motion sensor, a Z-Wave scene controller like a Minimote and a siren connected to a Z-Wave appliance module.

When you come home and trip the motion sensor, you want thirty seconds' grace to find the Minimote and press a button on it to prevent the siren from going off.

1. Create a Countdown timer device. Rename it to Entry delay and edit the device and set its duration to 30 seconds.
2. Create a scene. Rename it to Sensor tripped. Set a trigger for the motion sensor An armed sensor is tripped. Add an action to Start the Entry delay timer.
3. Create a second scene. Rename it to Minimote pressed. Add an action to Cancel the Entry delay timer. Add an action to Bypass the motion sensor. Configure the Minimote to call this scene when a button its pressed.
4. Create a third scene. Rename it to Sound siren. Set a trigger for the Entry delay Timer completes while not muted. Add an action to Turn on the appliance module that is connected to the siren.

Dedicated security systems also have an exit delay for when you leave the house. This can be achieved with another countdown timer and two more scenes (and one more button on your Minimote). Dedicated security systems also will sound the siren for only a set time (a few minutes) to avoid Disturbing the Peace. This can also be achieved with a countdown timer and two more scenes.
Title: Countdown timer example: automatic security light
Post by: futzle on February 11, 2012, 02:16:31 am
If you have motion sensors in the same room as Z-wave lights then you might want to have detected motion turn on the light.  This may be for security, safety or convenience.  Naturally, when the motion stops you will want the light to turn back off.

MiOS has this functionality built in for security sensors but if you want additional control or want to trigger the light with other sensors you can do it with a countdown timer.

1. Create a Countdown timer device. Rename it to Security timer and edit the device and set its duration to 45 seconds.
2. Create a scene. Rename it to Security light on. Set a trigger for the motion sensor An armed sensor is tripped. Add an action to Turn on the light. Add another action to Restart the Security timer (so that if the sensor trips again, the timer starts counting again from 45 seconds).
3. Create a second scene. Rename it to Security light off. Set a trigger for the Security timer Timer completes while not muted. Add an action to Turn off the light.

Probably you want to have this happen only between certain hours of the day.  Create scenes to Mute and Unmute the Security timer, and set Schedules on them to activate (unmute) or disable (mute) the security light.  Use the Heliotrope (http://apps.mios.com/plugin.php?id=1348) plugin to mute/unmute the timer at sunrise/set.
Title: Re: Countdown timer plugin (UI5)
Post by: gilles on February 11, 2012, 03:41:03 am
Hi Futzle,

really great plugin.

Is there a way to have multiple countdown in only one countdown device.

I'm a "vera padawan", but I find that it will be usefull to concentrate functionnality to device.
In my vera I've got too many virtual devices.

Don't if I'm clear but I think it's important for the future.

Envoyé depuis mon GT-I9000
Title: Re: Re: Countdown timer plugin (UI5)
Post by: futzle on February 11, 2012, 05:14:32 am
Is there a way to have multiple countdown in only one countdown device.

It's one timer per device, on purpose. I wanted to keep the plugin as simple as possible; it's got enough of a learning curve as it is. Since you've probably got to combine it with at least three scenes to achieve anything useful, I'm hoping that users are going to get used to the clutter (our that micasaverde comes up with a better way to hide them).

Then there's the technical matter of the device buttons: multiple timers mean multiple sets of buttons, and how many sets do you stick into the static JSON file?

Edit: spelling
Title: Re: Countdown timer plugin (UI5)
Post by: big517 on February 11, 2012, 06:19:56 am
Can you also add notification support for timer start and restart?
Great plugin!

Title: Re: Re: Countdown timer plugin (UI5)
Post by: futzle on February 11, 2012, 06:52:46 am
Can you also add notification support for timer start and restart?

Sure. It would be handy to understand the intended use case, and why you can't achieve the same thing by having the thing that triggers the timer (re)start do the action itself. (I'm against adding complexity that doesn't add functionality.)
Title: Re: Countdown timer plugin (UI5)
Post by: big517 on February 12, 2012, 07:47:31 am
I just want to make sure it was turned on because looking at the ui in chrome, it doesn't always show it counting down even if it is..

Title: Re: Countdown timer plugin (UI5)
Post by: futzle on February 12, 2012, 03:41:02 pm
I've submitted version 2.0 to apps.mios.com. This version has a full set of events (started, restarted, cancelled, completed) as well as events for when an action has failed (for instance, trying to start an already-started timer). There are also some other bugfixes to do with timers surviving Luup restarts.
Title: Re: Re: Countdown timer plugin (UI5)
Post by: futzle on February 12, 2012, 03:44:46 pm
I just want to make sure it was turned on because looking at the ui in chrome, it doesn't always show it counting down even if it is..

The icon is supposed to change when the timer is counting. The buttons, not so much because none of the buttons directly correspond to the state variables. I think I've seen cases where the icon hadn't updated. I'll pay extra attention if it happens again.
Title: Re: Countdown timer plugin (UI5)
Post by: Otje on February 12, 2012, 04:09:33 pm
I have a question on the timer

I understand you can set a timing per device. But what if you want to have more timers like this to be used?
I can't see how I can get more then one device in Vera. I am new to Vera, maybe that explains, but how can i get more instances of this timer module, such that i can have 5mins timers, 10mins timers etc?
Do i need to install the app more then once?

thanks in advance.
Title: Countdown timer plugin (UI5)
Post by: futzle on February 12, 2012, 05:06:24 pm
It's well hidden in UI5.  Go to Apps > My Apps and click on the words "Countdown Timer". There's a link in the resulting dialog that makes extra instances.
Title: Re: Countdown timer plugin (UI5)
Post by: Otje on February 12, 2012, 05:12:54 pm
 :) i found it.
Indeed, well hidden in UI5.

Thanks alot for your help.
Title: Re: Countdown timer plugin (UI5)
Post by: big517 on February 17, 2012, 07:46:33 am
Is there a way to NOT execute a scene, but still restart timer if the Timer is currently COUNTING DOWN?

For instance, I have my living room setup to turn ON lights when someone enters and the Motion sensor is ARMED, then to turn OFF lights if there is NO Motion Trigger within 30 minutes (using this timer)

1 Scene to TURN ON LIGHTS AND START / RESTART TIMER when occupancy is detected
2 Scene to TURN OFF LIGHTS WHEN TIMER IS COMPLETE

I don't want to stop the timer, but I want control of the lights in that room while the timer is counting down..
So while the room is occupied I can change the lights that were turned on with the motion trigger, however my problem is that the motion trigger keeps firing and resetting the lights which is the unwanted side effect. 

I was thinking about adding LUUP to the TRIGGER portion to RESTART the timer, but NOT Execute the scene if the timer is active, and the only way I could figure this to work is if the timer is currently counting down.  This will allow the scene to still turn the lights on immediately when someone walks into the room initially (counter was not running), and allow them to adjust the lights and occupancy keeps resetting the timer so it will still turn off the lights after the timer completes.  however I'm not sure how to accomplish this other than my idea above which requires LUUP Code, can someone help with this?

Is this even the best way to structure this?

Thank you,
Title: Countdown timer plugin (UI5)
Post by: futzle on February 17, 2012, 08:17:09 am
Interesting scenario. Here are a couple of ideas.

From version 2.0 the plugin has new events, "timer is started" and "timer is restarted". These fire, respectively, when the timer hadn't previously been running, and when it was already running.  In your case, attach the Lights On action to a new scene that is triggered by the "timer is started" event, instead of to the motion sensor detection scene.

To summarize:

Scene A: triggered by motion sensor; sends Restart to timer.
Scene B: triggered by timer start; sends On to light.
Scene C: triggered by timer complete; sends Off to light.

Something else you might want to mess with is muting. You can add a scene triggered by the light being turned off, that mutes the timer so that its events don't fire.  This is a more extreme form of manual control, and you'd likely want to make a scene that unmutes the timer later to reset the automation. Naturally, you can use another Countdown Timer for that...
Title: Re: Countdown timer plugin (UI5)
Post by: big517 on February 18, 2012, 08:55:24 am
That sounds good. I'll give that a shot.

Thanks again for this plugin.

Title: Re: Countdown timer plugin (UI5)
Post by: Otje on February 18, 2012, 10:45:00 am
I noticed something strange when using the timer in scenes.
I create a scene and via a trigger I have the timer restarted, see image below.
Later on when I edit the scene and go to the timer device i do not see the box and red cross anymore, indicating that the trigger is going to restart the timer. Normally i can see it for other devices, but not when I use the timer.

is this normal?
Title: Countdown timer plugin (UI5)
Post by: futzle on February 18, 2012, 03:52:46 pm
It's a UI5 bug in the JavaScript for the scene editor. I reported it to MCV. For what it's worth, it's only a presentation bug, and the action is still there (as you can check by going to the scene Advanced tab).
Title: Re: Countdown timer plugin (UI5)
Post by: Otje on February 18, 2012, 03:55:07 pm
Ok thanks for explaining.
it is indeed only visualisation, the plugin works normal.
Title: Re: Countdown timer plugin (UI5)
Post by: big517 on February 19, 2012, 06:55:14 am
Scene B: triggered by timer start; sends On to light.

Every time I select TIMER STARTS WHILE NOT MUTED, I save, then go back and it's showing "TIMER RESTARTS WHILE NOT MUTED".  It's like I cannot save the correct action... frustrating, UI5 Bug?  Browser? 

EDIT: I've tried multiple browsers, Clearing Cache etc...  I cannot save the trigger as "Timer starts and not muted" which is the first choice on the drop-down.  Every time I save or tab after typing the trigger name it's defaulted back tot he RESTART option...  Is this a bug with the Plugin?
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on February 19, 2012, 04:06:40 pm
Every time I select TIMER STARTS WHILE NOT MUTED, I save, then go back and it's showing "TIMER RESTARTS WHILE NOT MUTED".  It's like I cannot save the correct action... frustrating, UI5 Bug?  Browser? 

Plugin bug, of the embarrassing copy-and-paste kind.  I'm very sorry, totally my fault.

I've submitted version 3.0 of the plugin which should fix this.  You may have to delete the scene with the trigger and re-create it (maybe not).  You also will need to flush your browser's cache.

Anyone who has used the TIMER RESTARTS WHILE NOT MUTED events will likewise have to edit their scene for the event to pick up its new ID.

Thanks for spotting this bug.

Edit: 4.0 fixes another such error which I just found.
Title: Re: Countdown timer plugin (UI5)
Post by: tbearkline on March 19, 2012, 10:40:08 pm
I'm trying to get the plugin working, but having problems setting the timer to start, restart, etc in a scene.  It just does not save??  I can get mute or un-mute but none of the other actions.   :-[  Just updated firmware today to 1.5.36  - using the veralite to fix other issues.  Then added the timer plugin.  The timer works if not in a scene.  Any ideas what might be wrong.  I'm following your Turn off the light after 10 Min.

Ted
Title: Re: Countdown timer plugin (UI5)
Post by: tbearkline on March 19, 2012, 11:43:32 pm
I can tell I'm still learning.  Not sure what was wrong, but each time I tried to set the timer to start it added to the advanced tab.  Something must have be wrong with my first one...  Anyway, it is working great now after I cleaned out all of the triggers in the advanced tab.
Title: Re: Countdown timer plugin (UI5)
Post by: PurdueGuy on March 23, 2012, 02:35:40 am
First of all futzle, thanks!  This is great!

I had some scenes that were automatically turning lights off after I would turn them on, but without a doubt, I would get caught in a dark room when I went back in between on and auto off.  This solved that!

I do have two questions:

1) When I hit "Set duration" do I need to explicitly hit "Reload" or "Save?"  I don't get prompted to save, and I haven't tried a power cycle to see what happens.

2) Is it possible to have the duration either on the device box (near the countdown?), or possibly on the control tab?  I know I can find it on the "Advanced" tab, so it's not a huge deal if not.
Title: Countdown timer plugin (UI5)
Post by: futzle on March 23, 2012, 02:57:19 am
You should press SAVE after editing the duration. Edit: Perhaps this isn't necessary after all, after further thought.

The real estate on the dashboard is a bit limited. Would it be good enough for it to show the duration in the place of the remaining time, when the timer *isn't* counting?

Edit: definitely I can pop the current duration on the Control tab.
Title: Re: Countdown timer plugin (UI5)
Post by: PurdueGuy on March 23, 2012, 03:00:17 am
You should press SAVE after editing the duration.

The real estate on the dashboard is a bit limited. Would it be good enough for it to show the duration in the place of the remaining time, when the timer *isn't* counting?
I figured I needed to press save, but the icon isn't changing for me.  For everything else (like the name of the time), the moment I change something, the blue "RELOAD" changes to a red "SAVE" but not when I change the duration.  So I'm hitting "RELOAD" which I think is working ok.

I think showing the duration in place of the remaining time when not active/counting is a great idea.
Title: Re: Countdown timer plugin (UI5)
Post by: apsdadmcv on April 03, 2012, 04:50:34 pm
This may be the wrong forum or it may be my inexperience with ZWave., but . . . I have downloaded the plug-in and used it before in several areas. But how do I make a copy of the plug in for use in different scenes?
Title: Re: Countdown timer plugin (UI5)
Post by: PurdueGuy on April 03, 2012, 04:58:46 pm
You'll need to create a new device.

UI5 -> Apps tab -> Click "Countdown timer" -> Create another
Title: Re: Countdown timer plugin (UI5)
Post by: richskiddle on April 09, 2012, 02:39:03 pm
I wish I knew this plugin existed earlier, i've just deleted a load of scenes and replaced them with this.
Title: Re: Countdown timer plugin (UI5)
Post by: trouty00 on April 17, 2012, 05:18:18 pm
I have just stumbled upon this as think I have a usecase for my "find the bathroom" scene but I definatey need to address it using luup.

I notice once i trigger a time the variables are not updated in the advanced tab? is this a GUI issue and those variables would actually give me the values if I was to figure out the luup code to check the variable.

on this note do you have any luup fragments to help get me started?
basically start countdown, poll status, remaining time, reset and start counting again etc?

Ta
Stu
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on April 17, 2012, 05:38:53 pm
trouty00,

The Advanced Tab doesn't update in real time in UI4 or UI5, but it's purely visual: behind the scenes the values are updating.

I haven't needed to use Luup on Countdown Timer devices—it would be a design failure of sorts—but here are some snippets of Luup that should work.

Code: [Select]
local deviceId = 123 -- change this

-- String "0" (not counting down) or "1" (counting down).
isCounting = luup.variable_get("urn:futzle-com:serviceId:CountdownTimer1", "Counting", deviceId)

-- time() when the timer will ding. Valid only while counting.
if (isCounting == "1") then dueTimestamp = tonumber(luup.variable_get("urn:futzle-com:serviceId:CountdownTimer1", "DueTimestamp", deviceId)) end

I don't recommend using variable_set() on any of these variables. Any timer-setting should be done through a full-fledged action.

Code: [Select]
-- Actions are: StartTimer, RestartTimer, CancelTimer, ForceComplete
luup.call_action("urn:futzle-com:serviceId:CountdownTimer1", "RestartTimer", {}, deviceId)

Edit: added tonumber() on the DueTimestamp value.
Title: Re: Countdown timer plugin (UI5)
Post by: trouty00 on April 18, 2012, 09:19:07 am
futzle,
          appreciate the sentiment regards if this plugin needed luup then it could be considered a failure but as suggested im struggling with my "find the bathroom" scene and this forum can sometimes be slow to respond (people are busy!) and I think i can use this as a work around, I may end up with twice the amount of code required but if that is what it takes then so be it, always a good learning exercise anyway interfacing with other plugins. What you have provided will certainly get me started!!

just to clarify dueTimestamp will then contain the number of how many seconds which are remaining which I can then place conditions on
Code: [Select]
-- time() when the timer will ding. Valid only while counting.
if (isCounting == "1") then [b]dueTimestamp[/b] = luup.variable_get("urn:futzle-com:serviceId:CountdownTimer1", "DueTimestamp", deviceId) end
Title: Countdown timer plugin (UI5)
Post by: futzle on April 18, 2012, 06:03:16 pm
The "dueTimestamp" variable isn't the number of remaining seconds, but the Unix-epoch time that the timer will hit zero at. You can subtract os.time() from this to get the number of seconds left. It was done this way to avoid clock skew. Also note the additional tonumber() that I added to the code sample today.

(There is a "Remaining" variable on the plugin which is ostensibly the number of seconds remaining, but it's a derived value and there are some pathological edge cases where it will be wrong.)
Title: Re: Countdown timer plugin (UI5)
Post by: trouty00 on April 18, 2012, 06:27:10 pm
futzle, thanks for that, have finally just got my scene working and have posted the code here (http://forum.micasaverde.com/index.php/topic,10089.msg70635.html#msg70635).
Title: Re: Countdown timer plugin (UI5)
Post by: bfromdruten on April 28, 2012, 05:51:50 am
Great plugin. How about the addition of a random amount of extra seconds to the initial duration? In that way you can trigger several countdown timers after each other and schedule lights like your at home during a holiday.

Thanks
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on April 29, 2012, 05:59:49 pm
How about the addition of a random amount of extra seconds to the initial duration?

Yes, I can see how that would be useful.  I'll have to mull it over to think of the best way to implement it invisibly for the majority of uses where randomness would just be additional clutter. It's hard enough for beginners to use this plugin already.

Anyone who wants this: please help by describing specific real-world use cases. There are still unanswered questions like what random number distribution is most useful (uniform, binomial, exponential), and whether this is better done as part of the countdown timer plugin or as a separate plugin.
Title: Re: Countdown timer plugin (UI5)
Post by: PurdueGuy on April 29, 2012, 10:14:14 pm
If you were to implement random times, I would leave the majority of the plugin unchanged.  Could you then add new variable that only appear in the advanced tab, and have something like "Random Delta?"   This "random delta" (if non-zero) would be added to the "duration" already established?

This way, the "duration" is essentially the minimum countdown time, but if and only if, random delta is non-zero, you would calculate a random number between 0 and "random delta" and add that to the "duration" to get "actual duration."

That makes is transparent to new users, but flexible for advanced users.

As for the type, whatever Lua provides internally would be fine.  I assume it's a uniform distribution, but hey, what do I know?   ;D
Title: Re: Countdown timer plugin (UI5)
Post by: bfromdruten on April 30, 2012, 03:05:40 am
PurdueGuy, this is extactly what I was thinking. Just a random addition to the initial countdown value.
Title: Countdown timer example: occupancy light for bathroom
Post by: futzle on May 28, 2012, 06:25:35 pm
In this example, imagine that you have a bathroom with a door sensor, a motion sensor and a light switch. You want the light to go on when the door opens, and to go off one minute after the door closes, unless motion was detected during that minute (in this case, the light stays on indefinitely).

1. Create a Countdown Timer. Rename it One minute timer. Go to the configuration tab and change the Duration to 60 seconds.
2. Create a scene. Rename it Door opened. Edit the scene, setting a trigger for the door sensor device: A sensor (door/window/motion/etc.) is tripped > Device is tripped. Make the scene activate the Cancel button on the One Minute Timer. Also make the scene turn the light on.
3. Create a second scene. Rename it Door closed. Edit the scene, setting a trigger for the door sensor device: A sensor (door/window/motion/etc.) is tripped > Device is not tripped. Make the scene activate the Restart button on the One Minute Timer.
4. Create a third scene. Rename it Motion detected. Edit the scene, setting a trigger for the motion sensor device: A sensor (door/window/motion/etc.) is tripped > Device is tripped. Make the scene activate the Cancel button on the One Minute Timer.
5. Create a fourth scene. Rename it Turn light off. Edit the scene, setting a trigger for the One Minute Timer: Timer completes while not muted. Make the scene activate the Off button on the light device.

Mute the timer to temporarily override the automatic turning off of the light.
Title: Re: Countdown timer plugin (UI5)
Post by: resq93 on June 01, 2012, 12:38:59 pm
I am having trouble with this. For some reason on every scene that I use to set or cancel a timer once I save it and reopen, the start or cancel button is not selected anymore. The only button I can get to "stick" is the mute and unmute buttons. I tried in two browsers, any ideas?

M

EDIT

Nevermind, found this post http://forum.micasaverde.com/index.php/topic,9425.msg63555.html#msg63555 (http://forum.micasaverde.com/index.php/topic,9425.msg63555.html#msg63555) 
Title: Re: Countdown timer plugin (UI5)
Post by: resq93 on June 01, 2012, 02:02:04 pm
I've submitted version 2.0 to apps.mios.com. This version has a full set of events (started, restarted, cancelled, completed) as well as events for when an action has failed (for instance, trying to start an already-started timer). There are also some other bugfixes to do with timers surviving Luup restarts.

Does this countdown survive a power loss/reboot?

M
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on June 02, 2012, 09:19:36 pm
Does this countdown survive a power loss/reboot?

Yes. Internally the plugin stores the timer-complete timestamp, not the remaining seconds, so it should be immune to losing time through any kind of misadventure, including a hard reboot. If the timer-complete timestamp elapses while the power is off, then the event will fire belatedly as soon as the plugin reloads.

Try it and see. If it fails, you found a bug!
Title: Re: Countdown timer plugin (UI5)
Post by: drag0n on June 17, 2012, 05:06:26 am
I am trying to change the timer duration through lua code.
What is the correct syntax?
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on June 17, 2012, 07:07:57 am
I am trying to change the timer duration through lua code.
What is the correct syntax?

I've never done it but it should be something like:
Code: [Select]
local theDeviceId = 123 -- change this
local theNewDuration = 30 -- change this
luup.call_action("urn:futzle-com:serviceId:CountdownTimer1", "SetTimerDuration", { newDuration = theNewDuration }, theDeviceId)
Title: Re: Countdown timer plugin (UI5)
Post by: drag0n on June 17, 2012, 10:58:42 am
thanks!
I am now able to set up a countdown timer with a random timer.

Code: [Select]
local theDeviceId = 109 -- change this
local theNewDuration = math.random(10,20)   -- create random # between 10 and 20
luup.call_action("urn:futzle-com:serviceId:CountdownTimer1", "SetTimerDuration", { newDuration = theNewDuration }, theDeviceId)
Title: Re: Countdown timer plugin (UI5)
Post by: Thomasss on July 23, 2012, 05:41:41 pm
Hi,
I'm sucessfully using the countdown timer for alarm activation and desactivation.
It could be also cool to use it for light management.
Here it the idea : I want to have a push button to add 10 minutes of light by press.
For example, 3 press equal to 30minutes of lights on.

Actually, I need ot use some Lua code to achieve that.
I'm wondering it it could be achievable to add the "add/remove" second to the actions fields.

any way, thanks for this usefull plugin !
Title: Countdown timer plugin (UI5)
Post by: futzle on July 24, 2012, 04:55:36 am
Hi Thomasss, it's a neat idea. As you've noticed, the countdown timer plugin can't do this now. You could do it with Luup code, adding seconds to the DueTimestamp variable. The plugin should pick up the extended timer immediately, even if it is counting.

I'll have to think of the best way to incorporate a feature like this. There is enough clutter on the dashboard already.
Title: Re: Countdown timer plugin (UI5)
Post by: Lonestar10 on August 07, 2012, 03:19:20 pm
I have a garage door sensor that tells me when the door is open or closed.  How can I use the timer to send me a notification if the door is left open longer than ten minutes?

Title: Re: Countdown timer plugin (UI5)
Post by: PurdueGuy on August 07, 2012, 03:28:43 pm
Scene 1
  Trigger - door is opened
  Action - start timer

Scene 2
  Trigger - door is closed
  Action - stop timer

Scene 3
  Trigger - timer expired
  Action - send notification (however you do it)
Title: Re: Countdown timer plugin (UI5)
Post by: Lonestar10 on August 07, 2012, 08:41:44 pm
Perfectly logical on paper.  But I'm stuck at the first step.

I don't see how to tell the door sensor to start the timer when an armed sensor is tripped (open door).

Or how to tell an untripped sensor (closed door) to cancel the timer.
Title: Re: Countdown timer plugin (UI5)
Post by: Brientim on August 07, 2012, 09:16:58 pm
Hello Lonestar10,

This will give you a starting point from a previous thread.

http://forum.micasaverde.com/index.php/topic,10969.msg77430.html#msg77430
Title: Re: Countdown timer plugin (UI5)
Post by: Lonestar10 on August 07, 2012, 11:49:23 pm
Thanks, Brientim.

Your explanation of setting up scenes was very helpful when I read it the first time.  I have several scenes running....and now I have the garage notification scene working as well.

What was confusing me was that the drop-down dialog I was looking for is under the Advanced tab under Scenes.  And that once I added a trigger, other dialog boxes appeared that were appropriate to the device, in this case, the timer.

Thanks again for everyone's help.  And thanks, Futzle, for a great app.

Title: Re: Countdown timer plugin (UI5)
Post by: electricessence on August 08, 2012, 01:01:09 am
This and the Combination Switch/Trigger are great tools.  I was able to create my own door-autolock mechanism that won't autolock the door when the door is open.  And using this, it appropriately takes two minutes before autolock.

The only issue (which I mentioned in another thread) is I need to be able to query the state of the lock in the combination switch for it to be useful in this scenerio.  When I can, life becomes easy.

The Comboswitch conditions:
Door Closed AND Door Unlocked = Start Timer
Door NOT Closed OR Door Locked = Cancel Timer

This would allow me to not use any luup code at all.  Right now, I have to add some door open/closed state checks to the triggers and scenes to ensure the timer isn't running unnecessarily.
Title: Re: Countdown timer plugin (UI5)
Post by: electricessence on August 08, 2012, 01:45:09 am
Here is the luup code I used before I had the timer plug-in:

Code: [Select]
function deferLockScene(package)
  if(lockInsecuredId == package) then
    local veraUri = "urn:micasaverde-com:serviceId:HomeAutomationGateway1"
    luup.call_action(veraUri , "RunScene", {SceneNum = "1"}, 0)
  end
end

lockInsecuredId = os.time() .. ""
luup.call_timer("deferLockScene", 1, "1m", "", lockInsecuredId )

lockInsecuredId ends up being a global variable that it compares the last time this was triggered to the package received by the timeout.

The Timer plug-in defintely makes this obsolete.  But it may be interesting to others.
Title: Re: Countdown timer plugin (UI5)
Post by: M2MExpert on August 11, 2012, 03:02:57 pm
I need some guidance.

I am using the combination switch to monitor my door sensors and trigger the countdown timer. I have three scenes. Shutdown Air, Restart Air, Start Timer.

Combination switch triggers start timer. If it times out it starts Shutdown Air. When it resets it triggers Restart Air and Cancels Countdown Timer in the event that the timer has not timed out before the zones all reset and turn off combination switch.

The problem I have is that even though I select the countdown timer cancel button in Restart Air.... it doesn't seem to stay selected after I save and edit the scene.

I'm trying to figure out why, even though my zones reset before the timer finished my air still goes off.

Title: Re: Countdown timer plugin (UI5)
Post by: futzle on August 11, 2012, 10:22:07 pm
The problem I have is that even though I select the countdown timer cancel button in Restart Air.... it doesn't seem to stay selected after I save and edit the scene.

Start here (http://forum.micasaverde.com/index.php/topic,9425.msg74982.html#msg74982).
Title: Re: Countdown timer plugin (UI5)
Post by: M2MExpert on August 11, 2012, 10:52:16 pm
The problem I have is that even though I select the countdown timer cancel button in Restart Air.... it doesn't seem to stay selected after I save and edit the scene.

Start here (http://forum.micasaverde.com/index.php/topic,9425.msg74982.html#msg74982).

Well that is good news and bad news. It explains the presentation change but makes me even more confused as to why my scenes are not running correctly. Hmmmm.
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on August 11, 2012, 11:49:00 pm
even though my zones reset before the timer finished my air still goes off.

Try to run the Restart Air scene manually by pressing its Run button in the dashboard.  Does it do what you want? If yes, then the problem is the trigger for the scene.  If no, then the problem is the actions for the scene.
Title: Re: Countdown timer plugin (UI5)
Post by: M2MExpert on August 12, 2012, 10:38:15 am
even though my zones reset before the timer finished my air still goes off.

Try to run the Restart Air scene manually by pressing its Run button in the dashboard.  Does it do what you want? If yes, then the problem is the trigger for the scene.  If no, then the problem is the actions for the scene.


I feel silly. I found a timer I had set in the shutdown air scene that turned it off after 10 min no matter what. Unless you drop that menu down you don't realize timers are there. I must have set it while playing with timers and forgot about it.  DUH!
Title: Re: Countdown timer plugin (UI5)
Post by: electricessence on August 13, 2012, 02:32:00 pm
@Futzle:

It would be nice if the events/triggers were like this:
Timer completes (regardless of mute state)
Timer completes while not muted
Timer completes while muted

This is super helpful to create logic routing almost like a switch in a train track.  If one state, go here, other go there...


Title: Re: Countdown timer plugin (UI5)
Post by: M2MExpert on August 13, 2012, 08:24:21 pm
@Futzle:

It would be nice if the events/triggers were like this:
Timer completes (regardless of mute state)
Timer completes while not muted
Timer completes while muted

This is super helpful to create logic routing almost like a switch in a train track.  If one state, go here, other go there...

I could see a good use for that. I also could use a mode that would autoreset. For instance: Counting while a switch was on and it it went off before the counter finished it would autoreset. Would be an easy way to implement a resetting time delay in a scene.
Title: Re: Countdown timer plugin (UI5)
Post by: Intrepid on September 02, 2012, 04:06:50 pm
This is a neat plugin.  For my garage lights and radio, I've been using a delayed off.  This plugin does the same thing except I can see the time left.  and I can mute it if I'm working in there.

Also, it seems to survive a reload, keeping its timer position?  How do it do that.

Very nice.
Title: Re: Countdown timer plugin (UI5)
Post by: conchordian on January 07, 2013, 10:01:15 pm
I use this great plugin for lights, etc. and it occurred to me the other day I should be using it to set my 'has it rained in the last 10 hours virtual switch' (http://forum.micasaverde.com/index.php/topic,10909.0.html) because of your plugin's ability to survive a LUUP reload.

Unfortunately 10 hours is 36000 seconds and the plugin only allows numbers 4 numerals long.

Is there any way around this, please?
Title: Countdown timer plugin (UI5)
Post by: futzle on January 07, 2013, 11:00:46 pm
he plugin only allows numbers 4 numerals long.

You sure? I've got a 14000-second timer and I don't recall having an issue setting it.

I will double-check when I get home.
Title: Re: Countdown timer plugin (UI5)
Post by: conchordian on January 08, 2013, 01:29:29 am
You sure?

Nope, I'm not sure :)  Sorry, it just needed a reload and my 36000 one works.  Thanks again for the plugin.
Title: Re: Countdown timer plugin (UI5)
Post by: asterix406 on February 16, 2013, 01:08:09 pm
Hi

The plugin works great but generates a huge number of log entries. Is there any way to turn these off?

Thanks
Greg
Title: Re: Countdown timer plugin (UI5)
Post by: Thomasss on February 16, 2013, 02:44:10 pm
Hi

The plugin works great but generates a huge number of log entries. Is there any way to turn these off?

Thanks
Greg
Thanks to pointing this out. I'm also wondering how much ressources this plug-in is using.

I've tried to setup an automatic presence detection using that plugin. My idea was to have a counter in each room. Motion sensors trigger reset of the counter and when the counter terminate, it turn off a virtual switch called "prensence room 1".
But the amount of logs indicate me that it was not an optimal solution. I'm better to build luup code to watch some "last tripped value"

Except that little question, this pluggin is working well and is very usefull. Thanks to futzle for all his work.
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on February 16, 2013, 04:12:38 pm
Except that little question, this pluggin is working well and is very usefull. Thanks to futzle for all his work.

Her.

I've been toying with the idea of making the countdown decrement configurable. Currently it's fixed at one second, hence the squillions of log entries. That level of precision isn't always necessary.  If the plugin could be made to sleep for, say, 60 seconds instead, it would cut down the log entries by an order of magnitude or two. Each device instance would have its own precision, naturally.
Title: Re: Countdown timer plugin (UI5)
Post by: RichardTSchaefer on February 16, 2013, 06:31:11 pm
Quote
I've been toying with the idea of making the countdown decrement configurable.

I like this and will likely do the same for PLTS. I might default to something like the Elapsed time / 100 or 1 second ... which ever is larger. I previously only had log entries every 25% ...  I updated the icon at that interval ... but then someone requested time remaining to be similar to Countdown timer ... and now the logs are very verbose when the timer is active.
Title: Re: Countdown timer plugin (UI5)
Post by: sjolshagen on February 16, 2013, 06:39:57 pm
[...] it would cut down the log entries by an order of magnitude or two. Each device instance would have its own precision, naturally.

Is there any reason why the log output couldn't be made 'switchable'? Meaning that there's a on/off switch (button) in the UI which enables/disables the additional (luup.log()) output to the log upon the users specification - probably makes sense to leave it on by default, but being able to turn it off would be great. Specially for those of us with a few plugins & lots of debug output causing pretty frequent log switches.

Of course, a log switch would not be a big deal if MiOS would preserve the old logs for some period of time, but alas...
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on February 16, 2013, 10:43:43 pm
Is there any reason why the log output couldn't be made 'switchable'? Meaning that there's a on/off switch (button) in the UI which enables/disables the additional (luup.log()) output to the log upon the users specification

The output is not from the plugin, it's from the Luup engine when a state variable changes.  The plugin doesn't have the option of disabling these log messages.
Title: Re: Countdown timer plugin (UI5)
Post by: Skyfire76 on February 20, 2013, 03:31:47 pm
Hello futzle, trying to see if I should use your nice looking timer within my scene, but I can't find any documentation or example about how to use it by calling it from some Lua code. Is it possible ? If so, where should I look to find the relative commands (set the timer, start it, cancel it and so on) ?

Thanks in advance.

Regards.

EDIT : Ooops, just noticed there were several pages on this topic, and a few examples around, sorry, lol :D Do you have a full list of all available commands, or can I assume they're all called the same way : RestartTimer, CancelTimer and so on ?
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on February 20, 2013, 03:48:51 pm
Do you have a full list of all available commands, or can I assume they're all called the same way : RestartTimer, CancelTimer and so on ?

You can see the full list of commands in the S_CountdownTimer1.xml file (through Apps > Develop Apps > Luup files).  Here they are:

StartTimer
RestartTimer
CancelTimer
ForceComplete
SetTimerDuration(newDuration)
SetMute(newStatus)
Title: Re: Countdown timer plugin (UI5)
Post by: Skyfire76 on February 20, 2013, 03:51:36 pm
Thank you for the quick answer :) I'll see if I can use it or not (the amount of logs might be an issue as I intend to have 3 or 4 timers for my code, so some tests will be required).

Regards.
Title: Re: Countdown timer plugin (UI5)
Post by: vinceblack on March 16, 2013, 04:06:54 pm
Thanks so much for creating this plugin, it's something I have been in need of.  I am however having issues getting it to work.  I'm trying to setup up scenes so that when a light comes on it will turn off after 15 minutes.  I have followed the directions you have written, but no joy. When the light is turned on the timers starts counting down, but when it hit's zero the light stays on.  If I go under automation and manually run the scene it will turn the light off.  I'm not sure what I am missing.  Running version is 1.5.408.  Thank you...
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on March 16, 2013, 06:01:57 pm
vinceblack, do an experiment for me. While the timer is counting, press its Force button. Does the scene fire?

Is your timer muted or unmuted?
Title: Re: Countdown timer plugin (UI5)
Post by: vinceblack on March 16, 2013, 08:04:41 pm
vinceblack, do an experiment for me. While the timer is counting, press its Force button. Does the scene fire?

Is your timer muted or unmuted?


futzle,  Thanks for quick response. 

When I press force nothing happens either.  I have tried muted as well unmuted.
Title: Re: Countdown timer plugin (UI5)
Post by: vinceblack on March 16, 2013, 08:18:59 pm
vinceblack, do an experiment for me. While the timer is counting, press its Force button. Does the scene fire?

Is your timer muted or unmuted?


futzle,  Thanks for quick response. 

When I press force nothing happens either.  I have tried muted as well unmuted.

Ok,  After stepping away from it and coming back figured out what I did incorrectly.  The third step for Turned Light Off.  I did not set the timer to cancel only  set the light to off.  After making that change everything works great.  Again thanks for the great plugin.
Title: Re: Countdown timer plugin (UI5)
Post by: vinceblack on March 16, 2013, 08:26:00 pm
Ugh! So it appears I lied.  After making the change on the third step and when I click cancel it will fire off the scene and turn the light off, but if I let the timer expire nothing happens.  Again appreciate your help.
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on March 16, 2013, 09:06:55 pm
vinceblack, I'm afraid that you've lost me.  I don't know which instructions you are specifically following; a pointer would help.  (Edit: is it this one (http://forum.micasaverde.com/index.php/topic,9425.msg62531.html#msg62531)?)  Also screenshots of the scenes' configuration screens (particularly the Triggers and Advanced tabs, and the details of the trigger).  The more you can show me what you've done, the more likely I can see your mistake.
Title: Re: Countdown timer plugin (UI5)
Post by: vinceblack on March 17, 2013, 01:56:35 pm
vinceblack, I'm afraid that you've lost me.  I don't know which instructions you are specifically following; a pointer would help.  (Edit: is it this one (http://forum.micasaverde.com/index.php/topic,9425.msg62531.html#msg62531)?)  Also screenshots of the scenes' configuration screens (particularly the Triggers and Advanced tabs, and the details of the trigger).  The more you can show me what you've done, the more likely I can see your mistake.

The instructions are the one you advised on setting up plugin for lights.  Attached are the screen shots for setting up scene. Again thanks for the assistance.
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on March 17, 2013, 04:53:07 pm
Hi vinceblack,

Thanks for the screen captures.  None of the scenes match the instructions given in the howto topic.

Your "Light On" scene also mutes the timer.  It should not affect the timer's mute status at all.  To fix: click the tiny red X while you are editing the scene's actions, so that neither the Mute or Unmute buttons are lit.  Your "Light On" scene also tries to turn on the same light that triggers it, which is pointless but probably harmless.

Your "Light Off" scene also mutes the timer.  Same fix.  It also tries to turn off the same light that triggers it, which is again pointless but probably harmless.

Your "Turned Light Off" scene has the wrong trigger.  Yours has "Timer cancelled while not muted".  The instructions say to use "Timer completes while not muted".  Delete the wrong trigger and add the right one.  Also this scene mutes the timer like your previous scenes do.  Finally, this scene tries to cancel the timer which has just completed, which is pointless but probably harmless.

I recommend that you delete all the scenes and start again.  Don't try to put triggers (scene inputs) into the actions (scene outputs).
Title: Re: Countdown timer plugin (UI5)
Post by: vinceblack on March 23, 2013, 10:17:43 pm
Hi vinceblack,

Thanks for the screen captures.  None of the scenes match the instructions given in the howto topic.

Your "Light On" scene also mutes the timer.  It should not affect the timer's mute status at all.  To fix: click the tiny red X while you are editing the scene's actions, so that neither the Mute or Unmute buttons are lit.  Your "Light On" scene also tries to turn on the same light that triggers it, which is pointless but probably harmless.

Your "Light Off" scene also mutes the timer.  Same fix.  It also tries to turn off the same light that triggers it, which is again pointless but probably harmless.

Your "Turned Light Off" scene has the wrong trigger.  Yours has "Timer cancelled while not muted".  The instructions say to use "Timer completes while not muted".  Delete the wrong trigger and add the right one.  Also this scene mutes the timer like your previous scenes do.  Finally, this scene tries to cancel the timer which has just completed, which is pointless but probably harmless.

I recommend that you delete all the scenes and start again.  Don't try to put triggers (scene inputs) into the actions (scene outputs).

Sorry for late response back.  Not sure why I was trying to turn light on and off that the trigger was doing, corrected the settings. It def. helped to have second eyes, I had fat fingered the settings once I changed timer cancel to timer completed everything worked great.  Again thanks for the help and plugin.
Title: Re: Countdown timer plugin (UI5)
Post by: conchordian on March 24, 2013, 04:30:48 am
I've been toying with the idea of making the countdown decrement configurable. Currently it's fixed at one second, hence the squillions of log entries. That level of precision isn't always necessary.  If the plugin could be made to sleep for, say, 60 seconds instead, it would cut down the log entries by an order of magnitude or two. Each device instance would have its own precision, naturally.

That's a good idea.  As I mentioned, one of my timers is 10 hours, so that's a heap of log entries.
Title: Re: Countdown timer plugin (UI5)...Auto Restart Option ???
Post by: svanni on May 06, 2013, 02:06:18 am
Great app...thank you.

I currently have multiple timers, which have associated scenes that are triggered (when "unmuted").
For each timer, I have a 2nd scene that only restarts the times (regardless of mute status).

If there was an auto restart option, I could eliminate the 2nd scene.

Do I have any other options ???

Thanks in advance.
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on May 06, 2013, 02:25:19 am
svanni, I will add that request to the pile of possible future enhancements. This plugin is a fair way down the list of things needing my attention, so keep your workaround for the moment.
Title: Re: Countdown timer example: turn off a light after 5 minutes
Post by: waltzer11 on September 02, 2013, 09:23:14 am
In this example, imagine that you have a light that you want to turn off five minutes after it is turned on.  If the light is turned off manually before 5 minutes, do nothing.

1. Create a Countdown Timer. Rename it Five minute timer. Go to the configuration tab and change the Duration to 300 seconds.
2. Create a scene. Rename it Light goes on. Edit the scene, setting a trigger for the light device: A device is turned on or off > Device is turned on. Make the scene activate the Start button on the Five Minute Timer.
3. Create a second scene. Rename it Light goes off. Edit the scene, setting a trigger for the light device: A device is turned on or off > Device is turned off. Make the scene activate the Cancel button on the Five Minute Timer.
4. Create a third scene. Rename it Turn light off. Edit the scene, setting a trigger for the Five Minute Timer: Timer completes while not muted. Make the scene activate the Off button on the light device.

Mute the timer to temporarily override the automatic turning off of the light.

Great app. JUST TO SHARE YOU A STORY.  5-MINUTE TIMER:  My wife a lot of times forgets to turn garage lights off. I told her not to worry about it anymore. Told her to intentionally leave lights on and there you go; after 5 minutes lights are off-she was very impressed. One night she was carrying lots of groceries from costco to put them in the freezer which is in the garage. She was still carrying grocery stuff with both hands when the lights turn off. The garage is long about 35 ft. And of course she yelled because she cannot see.

After the above incident, I created the 45-SECOND TIMER: Now the problem got worse because every time we trigger the Z1R000 motion sensor, both the 5-MINUTE TIMER and the 45-SECOND TIMER start counting down simultaneously; and of course the winner is the 45-second timer and the light goes off after 45 seconds. On top of that it won't restart because the Z1R000 is still in "tripped" state. I don't know how to restore it in "not tripped" state immediately (I am not too good with lua code).

TEMPORARILY, i disabled the 45-second timer and increased the 5 to 10-minute timer until I figured out a solution either by myself or with the help from this community forum. Thanks this is a very good app ONE LAST NOTE: the Day or Night plugin is simpler to use than the Heliotrope. The Countdown Timer is much simpler to use than the PLEG - just my 2 cents.
Title: Re: Countdown timer plugin (UI5)
Post by: S-F on September 02, 2013, 09:34:47 am
@waltzer11

Just have the trigger which starts the timer be your motion sensor detecting no motion! Voila.
Title: Re: Countdown timer plugin (UI5)
Post by: avstraq on September 12, 2013, 09:35:55 pm
For those of you who are using this to get notified in case you leave the garage door open, how long do you guys have your timer set at? I have mine set at 3 minutes but wanted to do a quick survey. Thanks!
Title: Re: Countdown timer plugin (UI5)
Post by: waltzer11 on September 13, 2013, 11:19:05 am
@waltzer11

Just have the trigger which starts the timer be your motion sensor detecting no motion! Voila.

if i do what you said, then the 45-second timer will not re-start if no motion is detected.
Title: Re: Countdown timer plugin (UI5)
Post by: emtschei on September 19, 2013, 08:20:00 pm
I've been toying with the idea of making the countdown decrement configurable. Currently it's fixed at one second, hence the squillions of log entries. That level of precision isn't always necessary.  If the plugin could be made to sleep for, say, 60 seconds instead, it would cut down the log entries by an order of magnitude or two. Each device instance would have its own precision, naturally.

That's a good idea.  As I mentioned, one of my timers is 10 hours, so that's a heap of log entries.

Hello futzle

Thank you from my side for this useful plugin. Comes in real handy when defining scenes and events that sort of need to wait.
Some of my timers are set up to count down from 24 hours and hence fill the log with quite a bit of 'clutter'.
I therefore also strongly support your idea of a configurable 'level of precision'.

Thank you
MJ
Title: Re: Countdown timer plugin (UI5)
Post by: emtschei on September 19, 2013, 08:49:15 pm
On the same note as my previous post here I noticed increasing log entries from the countdown timer plugin over the time it runs.

Code: [Select]
06      09/19/13 18:55:02.133   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78827 now: 78827 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.101   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78827 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:0 <0x2d289680>
06      09/19/13 18:55:03.102   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.102   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.103   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.104   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.105   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.106   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.106   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.107   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.108   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.109   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.109   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.121   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.121   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.122   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.123   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.124   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.124   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.125   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.126   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.127   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.127   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.128   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.129   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.134   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.135   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:04.101   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78825 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:0 <0x2d289680>
06      09/19/13 18:55:04.102   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78825 now: 78825 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>

In this example there were 26 entries for one second. I have seen over 30 entries though and it looks like the longer the Lua engine is running the more entries per second are written.
After a reload of the Lua engine everything is back to normal - but only for a while. My LuaUPnP logs get currently switched every 10 minutes. I had an unexpected system reboot this afternoon which I might attribute to the masses of log entries (no hard proof though), maybe some memory leaks or overflow ...

I am curious if others that run lengthy timers experience similar problems.

Btw. I'm running a Vera3 with the latest Fw 1.5.622.
Title: Re: Countdown timer plugin (UI5)
Post by: UKsub on September 28, 2013, 06:46:49 pm
new to this thread as i only discovered and installed the plugin today. Nice app- does exactly what i hoped.
My only concern is, having read the previous posts, are there unnecessary overheads as a result of unwanted log-data that may cause other issues? TBH im not sure what my current setup is putting out into the log file. (i never really check)
thanks
Title: Re: Countdown timer plugin (UI5)
Post by: RichardTSchaefer on September 28, 2013, 07:27:22 pm
If you use a USB stick to hold your log file ... you do not need to worry about it.

If you want to see what is happening in your log file use the following:

http://Your.Vera.IP.Address/cgi-bin/cmh/log.sh?Device=LuaUPnP
Title: Re: Countdown timer plugin (UI5)
Post by: PurdueGuy on September 28, 2013, 09:49:55 pm
I modified the LUA scripts to change the tick rate to once every 10 seconds.
My use cases are mostly to turn lights or fans off after 10-60 minutes, so an extra 9 seconds doesn't bother me.
For those interested, I downloaded the file L_CountdownTimer1.lua in 3 places.

Each three points where:
Code: [Select]
return luup.call_delay("tick", 1, "") == 0
I changed that to:
Code: [Select]
return luup.call_delay("tick", 10, "") == 0
Now the dashboard updates every 10 seconds, and the timers expire close enough to what I want.
Title: Re: Countdown timer plugin (UI5)
Post by: emtschei on October 03, 2013, 10:16:37 am
Thanks, @PurdueGuy, I changed my lua file and yes, I get less clutter in the log ... for a while.
But then, though less messages, I'm back to the same 'logging issues' as stated in my previous post.

Code: [Select]
06 10/03/13 11:04:57.102 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78938 now: 78938 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:04:57.103 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78938 now: 78938 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:04:57.104 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78938 now: 78938 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:04:58.101 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78938 now: 78937 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:0 <0x2cf6d680>
06 10/03/13 11:04:59.101 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78937 now: 78936 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:0 <0x2cf6d680>
06 10/03/13 11:04:59.102 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78936 now: 78936 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:04:59.103 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78936 now: 78936 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:04:59.104 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78936 now: 78936 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:04:59.105 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78936 now: 78936 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:00.101 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78936 now: 78935 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:0 <0x2cf6d680>
06 10/03/13 11:05:00.102 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78935 now: 78935 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:00.103 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78935 now: 78935 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:00.104 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78935 now: 78935 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:00.104 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78935 now: 78935 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:00.105 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78935 now: 78935 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:00.106 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78935 now: 78935 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:00.107 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78935 now: 78935 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:00.108 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78935 now: 78935 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:01.101 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78935 now: 78934 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:0 <0x2cf6d680>
06 10/03/13 11:05:01.102 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78934 now: 78934 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:01.103 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78934 now: 78934 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:01.103 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78934 now: 78934 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:01.104 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78934 now: 78934 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:01.105 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78934 now: 78934 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:01.106 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78934 now: 78934 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:01.107 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78934 now: 78934 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:01.108 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78934 now: 78934 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:01.109 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78934 now: 78934 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:02.101 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78934 now: 78933 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:0 <0x2cf6d680>
06 10/03/13 11:05:02.102 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78933 now: 78933 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:02.103 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78933 now: 78933 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:02.103 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78933 now: 78933 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:02.104 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78933 now: 78933 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:02.105 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78933 now: 78933 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:02.106 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78933 now: 78933 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:02.107 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78933 now: 78933 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:03.101 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78933 now: 78932 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:0 <0x2cf6d680>
06 10/03/13 11:05:03.102 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78932 now: 78932 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>
06 10/03/13 11:05:03.103 Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable: Remaining was: 78932 now: 78932 #hooks: 0 upnp: 0 v:0xd31188/NONE duplicate:1 <0x2cf6d680>

MJ
Title: Re: Countdown timer plugin (UI5)
Post by: RichardTSchaefer on October 03, 2013, 11:41:56 am
It would be interesting to see if the # of repeat messages was correlated to the # of times the countdown timer was triggered since the last Vera Restart.

Title: Re: Countdown timer plugin (UI5)
Post by: emtschei on October 03, 2013, 11:50:59 am
Good point. I'll try to work on it when time permits - over the weekend.
Thanks
MJ
Title: Re: Countdown timer plugin (UI5)
Post by: emtschei on October 05, 2013, 12:23:57 pm
Ok, here's the first report on my trial & error: Seems @RTS is on the right track to the root of the problem.
After 24 hours of not having triggered the motion sensor and therefore not reset the countdown timer I do not have any repeat messages at all. This looks good. I get a countdown message in the log every 10 seconds (as designed since I changed the tick in the lua script as per @Brientim's post below).

On to more testing ... or rather verifying ...

MJ
Title: Re: Countdown timer plugin (UI5)
Post by: AndersH on October 06, 2013, 01:57:04 am
On the same note as my previous post here I noticed increasing log entries from the countdown timer plugin over the time it runs.

Code: [Select]
06      09/19/13 18:55:02.133   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78827 now: 78827 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.101   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78827 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:0 <0x2d289680>
06      09/19/13 18:55:03.102   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.102   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.103   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.104   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.105   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.106   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.106   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.107   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.108   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.109   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.109   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.121   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.121   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.122   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.123   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.124   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.124   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.125   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.126   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.127   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.127   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.128   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.129   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.134   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:03.135   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78826 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>
06      09/19/13 18:55:04.101   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78826 now: 78825 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:0 <0x2d289680>
06      09/19/13 18:55:04.102   Device_Variable::m_szValue_set device: 33 service: urn:futzle-com:serviceId:CountdownTimer1 variable                         : Remaining was: 78825 now: 78825 #hooks: 0 upnp: 0 v:0xcc66f8/NONE duplicate:1 <0x2d289680>

In this example there were 26 entries for one second. I have seen over 30 entries though and it looks like the longer the Lua engine is running the more entries per second are written.
After a reload of the Lua engine everything is back to normal - but only for a while. My LuaUPnP logs get currently switched every 10 minutes. I had an unexpected system reboot this afternoon which I might attribute to the masses of log entries (no hard proof though), maybe some memory leaks or overflow ...

I am curious if others that run lengthy timers experience similar problems.

Btw. I'm running a Vera3 with the latest Fw 1.5.622.

This looks very similar to the problem I have described in another thread. There, it's the smart virtual thermostat that "clutters" the log with thousands of lines, and makes the log grow to megabyte size within minutes.
http://forum.micasaverde.com/index.php/topic,16750.0.html (http://forum.micasaverde.com/index.php/topic,16750.0.html)

I haven't yet been able to tell when it happens, but it can be OK for log periods (hours) and then the problem will reappear.
I also have countdown timers in my system. Perhaps this is a more general problem, not particular to one plugin?
Title: Re: Countdown timer plugin (UI5)
Post by: emtschei on October 07, 2013, 01:49:50 pm
Ok, here's the first report on my trial & error: Seems @RTS is on the right track to the root of the problem.
After 24 hours of not having triggered the motion sensor and therefore not reset the countdown timer I do not have any repeat messages at all. This looks good. I get a countdown message in the log every 10 seconds (as designed since I changed the tick in the lua script as per @Brientim's post below).

On to more testing ... or rather verifying ...

MJ

I created a new instance of the Countdown timer plugin and also reverted the changed Lua code to issue a log line for every second (as per original plugin).
The new device is not referenced in any scene or trigger. Start/Restart/Cancel were done manually using the device buttons.

Here's what I found:
@RTS was right. I restarted the timer at various intervals and with each restart an additional log entry per tick was produced. Please see attachment.
After cancelling the timer the output got quiet, as expected.
A new start of the timer using either Start or Restart (after it got cancelled) reverted the log output to one entry per tick.
This behavior can be reproduced.
I also verified this phenomenon with a much smaller timer value of only 10 seconds. Same result.

As @AndersH pointed out below, he noticed a similar behavior. Maybe it has to do with the Countdown timer plugin - but maybe not.

I'd appreciate if the more knowledgeable members here could bring in their theories and maybe @futzle as the creator of the plugin has any insights.

Thank you
MJ
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on October 07, 2013, 04:43:56 pm
I've been watching this discussion with interest, but didn't really have enough to go on till now.

emtschei, I think you nailed it: "Restart" is the culprit.  I'm astonished that multiple luup.call_timer() doesn't crash LuaUPnP.  But I think I found the part in my logic where I fail to check that the delay has already been scheduled, and schedule another one anyway.

Try the attached replacement for L_CountdownTimer1.lua.  Does it resolve the multiple entries?
Title: Re: Countdown timer plugin (UI5)
Post by: RichardTSchaefer on October 07, 2013, 04:59:28 pm
Quote
I'm astonished that multiple luup.call_timer() doesn't crash LuaUPnP

I was worried about this at one time as well ... but now I depend on it for PLEG.
I have lots of scheduled timers running in parallel with different times.
Title: Re: Countdown timer plugin (UI5)
Post by: emtschei on October 07, 2013, 05:15:31 pm
Thank you, @futzle. You're my man ... well, my woman.
I am happy I could provide some input to put you on the right track. And I'm glad you found the bug. Much appreciated.
So far this looks good in the logs. See attachment.

Now, if we just could have the logging interval (tick) as a setting in the device control tab (device independent) that would be splendid ;).

Oh, and credit goes to @RTS. He suggested to check on correlation between timer resets and log entries. Thank you too, Richard.

MJ
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on October 07, 2013, 11:25:16 pm
I will submit the fixed version up to apps.mios.com real soon. I'm still thinking of the best way to code granularity into the delay so that it Just Works. I think I will adopt the suggestion floated here to delay either n % or m seconds, whichever is less.
Title: Re: Countdown timer plugin (UI5)
Post by: RichardTSchaefer on October 07, 2013, 11:45:56 pm
I did the % in PLTS ... it has the bad side effect of strange countdown values being displayed ... need something like we used to do in the days of figuring nice label values for graphs ... need nice interval values for display.
Title: Re: Countdown timer example: turn off a light after 5 minutes
Post by: waltzer11 on October 28, 2013, 01:30:20 pm
In this example, imagine that you have a light that you want to turn off five minutes after it is turned on.  If the light is turned off manually before 5 minutes, do nothing.

1. Create a Countdown Timer. Rename it Five minute timer. Go to the configuration tab and change the Duration to 300 seconds.
2. Create a scene. Rename it Light goes on. Edit the scene, setting a trigger for the light device: A device is turned on or off > Device is turned on. Make the scene activate the Start button on the Five Minute Timer.
3. Create a second scene. Rename it Light goes off. Edit the scene, setting a trigger for the light device: A device is turned on or off > Device is turned off. Make the scene activate the Cancel button on the Five Minute Timer.
4. Create a third scene. Rename it Turn light off. Edit the scene, setting a trigger for the Five Minute Timer: Timer completes while not muted. Make the scene activate the Off button on the light device.

Mute the timer to temporarily override the automatic turning off of the light.

works fine-lights turn on/off with the peset timer. i tried to set it up for my garage door but encountered some problems creating the 3rd scene. after the countdown, garage door does not close. i have a garage door plugin installed, ZFM-80 and SM103 sensor. any help will be appreciated.
Title: Re: Countdown timer example: turn off a light after 5 minutes
Post by: futzle on October 28, 2013, 04:52:31 pm
encountered some problems creating the 3rd scene. after the countdown, garage door does not close.

So what does happen?  At what point does reality diverge from your expectations?  Have you double-checked the scene that is triggered by the completion of the timer?  Have you made sure the timer is not muted?

If I am to help you debug this I'll need a great deal more information.
Title: Re: Countdown timer example: turn off a light after 5 minutes
Post by: waltzer11 on October 28, 2013, 07:12:05 pm
encountered some problems creating the 3rd scene. after the countdown, garage door does not close.

So what does happen?  At what point does reality diverge from your expectations?  Have you double-checked the scene that is triggered by the completion of the timer?  Have you made sure the timer is not muted?

If I am to help you debug this I'll need a great deal more information.
created a countdown timer and named it 11-minute garage door timer (660 seconds duration), and created the following scenes:
(1) scene name garage door is open. trigger door is locked or unlocked > device is opened. in the advanced tab, i made the scene activate the start button in the 11 minute timer
(2) scene name garage door is closed. created a trigger a door is locked or unlocked > device is closed. in the advanced tab, i made the scene activate the cancel button in the 11 minute timer
that's it - i am not sure how to create the 3rd scene just like the turn off light and timer completes while not muted thanks for your prompt response and i hope you can provide me with some guidance.
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on October 28, 2013, 07:46:11 pm
So I'm assuming that in this Garage Door plugin there is a button on the dashboard that closes the door. I will call this button "Close".

Create a scene. Edit its triggers. Add a trigger for the 11-minute timer: "timer completes while not muted". Give this trigger an arbitrary name.

Continue editing the scene. Go to the Devices tab and find the Garage Door device. Click on its "Close" button. It will light up.

Finish editing the scene. SAVE.

If I have answered a question different to the one you think you've asked, please advise me where I've gone off the rails. You haven't actually said yet what you want to happen so I am making educated guesses.
Title: Re: Countdown timer plugin (UI5)
Post by: waltzer11 on October 29, 2013, 04:27:24 pm
So I'm assuming that in this Garage Door plugin there is a button on the dashboard that closes the door. I will call this button "Close".

Create a scene. Edit its triggers. Add a trigger for the 11-minute timer: "timer completes while not muted". Give this trigger an arbitrary name.

Continue editing the scene. Go to the Devices tab and find the Garage Door device. Click on its "Close" button. It will light up.

Finish editing the scene. SAVE.

If I have answered a question different to the one you think you've asked, please advise me where I've gone off the rails. You haven't actually said yet what you want to happen so I am making educated guesses.
that's it, you did it. my garage door now auto closes after 11 minutes. my mistake was i kept going to the "advanced" tab instead of what you said "devices".  thank you very much for your help. great app!!
Title: Re: Countdown timer plugin (UI5)
Post by: waltzer11 on October 31, 2013, 04:43:42 pm
So I'm assuming that in this Garage Door plugin there is a button on the dashboard that closes the door. I will call this button "Close".

Create a scene. Edit its triggers. Add a trigger for the 11-minute timer: "timer completes while not muted". Give this trigger an arbitrary name.

Continue editing the scene. Go to the Devices tab and find the Garage Door device. Click on its "Close" button. It will light up.

Finish editing the scene. SAVE.

If I have answered a question different to the one you think you've asked, please advise me where I've gone off the rails. You haven't actually said yet what you want to happen so I am making educated guesses.
hi, any idea why the 11-minute timer keeps closing and opening the garage door about 2 to 3 times?
Title: Re: Countdown timer plugin (UI5)
Post by: PurdueGuy on October 31, 2013, 04:55:56 pm
How long does it take your garage door to open/close?

With the garage door plugin, if the door is open, when you click "close" it will immediately switch to closed, even while the door is still traveling.  After some amount of time (maybe 10 or 20 seconds?), if the door isn't closed yet, that status will revert to open again.

That might be starting a new timer, that isn't being canceled properly when the door closes?

For this reason, I don't base my garage door timers on the lock device, but instead I base them directly on the sensor device (in my case, an alarm system sensor exposed in Vera).
Title: Re: Countdown timer plugin (UI5)
Post by: waltzer11 on October 31, 2013, 10:23:46 pm
How long does it take your garage door to open/close?

With the garage door plugin, if the door is open, when you click "close" it will immediately switch to closed, even while the door is still traveling.  After some amount of time (maybe 10 or 20 seconds?), if the door isn't closed yet, that status will revert to open again.

That might be starting a new timer, that isn't being canceled properly when the door closes?

For this reason, I don't base my garage door timers on the lock device, but instead I base them directly on the sensor device (in my case, an alarm system sensor exposed in Vera).

very good point and your analysis makes a very good sense. i would say my sears craftsman garage opener travels about 10 - 15 seconds. the reason why i enable my 11 miniute timer all day (regardless of day or night) is because there were instances that we left during the day and the wife gets paranoid if we closed the garage door or not and she will call the neighbor for her peace of mind. i arm my SM103 garage sensor at 8pm. i will modify the scene and tie the countdown timer to the SM103; this means t hat i have to arm it (the sensor) all day. i wonder if arming the sensor all day and night affects battery life.
Title: Re: Countdown timer plugin (UI5)
Post by: PurdueGuy on October 31, 2013, 11:25:30 pm
very good point and your analysis makes a very good sense. i would say my sears craftsman garage opener travels about 10 - 15 seconds. the reason why i enable my 11 miniute timer all day (regardless of day or night) is because there were instances that we left during the day and the wife gets paranoid if we closed the garage door or not and she will call the neighbor for her peace of mind. i arm my SM103 garage sensor at 8pm. i will modify the scene and tie the countdown timer to the SM103; this means t hat i have to arm it (the sensor) all day. i wonder if arming the sensor all day and night affects battery life.
Arming the sensor won't affect battery life at all.

However, why do you have to arm it?  You can use the "sensor is tripped" trigger for normal operation.
That would allow you to use separate triggers when you want to do something special (such as arming when on vacation and getting notices).
Title: Re: Countdown timer plugin (UI5)
Post by: waltzer11 on November 01, 2013, 11:36:29 am
very good point and your analysis makes a very good sense. i would say my sears craftsman garage opener travels about 10 - 15 seconds. the reason why i enable my 11 miniute timer all day (regardless of day or night) is because there were instances that we left during the day and the wife gets paranoid if we closed the garage door or not and she will call the neighbor for her peace of mind. i arm my SM103 garage sensor at 8pm. i will modify the scene and tie the countdown timer to the SM103; this means t hat i have to arm it (the sensor) all day. i wonder if arming the sensor all day and night affects battery life.
Arming the sensor won't affect battery life at all.

However, why do you have to arm it?  You can use the "sensor is tripped" trigger for normal operation.
That would allow you to use separate triggers when you want to do something special (such as arming when on vacation and getting notices).

i just learned something new from you. stupid me - i armed all my window/door sensors at night and bypass in the morning. ok i will modify all these scenes. thanks a lot.
Title: Re: Countdown timer plugin (UI5)
Post by: guest141575 on March 13, 2014, 08:39:10 am
Wouldn't it be nice to be able to pause the Countdown Timer? With a "pause" and a "resume" button/function I would be able to use it to control a device by usage time. I would be able to allow the usage of an appliance for a certain amount of time daily.
Title: Re: Countdown timer plugin (UI5)
Post by: airedale on March 19, 2014, 11:50:19 am
Do you have a full list of all available commands, or can I assume they're all called the same way : RestartTimer, CancelTimer and so on ?

You can see the full list of commands in the S_CountdownTimer1.xml file (through Apps > Develop Apps > Luup files).  Here they are:

StartTimer
RestartTimer
CancelTimer
ForceComplete
SetTimerDuration(newDuration)
SetMute(newStatus)

What is the proper LUA to call StartTimer?
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on March 19, 2014, 05:23:16 pm
What is the proper LUA to call StartTimer?

Something like:
Code: [Select]
luup.call_action("urn:futzle-com:serviceId:CountdownTimer1", "StartTimer", {}, TIMER_DEVICE_ID)I haven't actually tested that but I've just applied what I know about the luup.call_action() function and what is in the service file for this device.
Title: Re: Countdown timer plugin (UI5)
Post by: airedale on March 19, 2014, 11:23:05 pm
Thanks! I was missing the empty {}. I thought I didn't need to put them in there if they didn't have any data.

I greatly appreciate the help.
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on March 19, 2014, 11:47:33 pm

I was missing the empty {}.

Computer scientists are really anal about the distinction between an empty thing and an absent thing.
Title: Re: Countdown timer plugin (UI5)
Post by: BatterBits on June 06, 2014, 04:49:33 pm
Forgive me - I'm new to all this, I've tried various things, but can't seem to get it to work.

I'm trying to set a timer for my garage door. At the end of 60 minutes, I want it to notify me that the garage door is open, and restart the timer - so that in effect, it will nag me every 60 minutes, to go and close the garage door.

I can get the door (opening) sensor to trigger the timer, and have another trigger (door closed) to cancel the timer. At the end of the first period it will notify me, but how do I get it to restart the timer?

Thanks

Ian
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on June 06, 2014, 07:40:17 pm

At the end of the first period it will notify me, but how do I get it to restart the timer?

Make a scene with one trigger (timer completes while not muted) and one action (presses Restart on the timer).

I don't know for sure if this will work: owing to the way that Vera triggers scenes it might not like the feedback loop in this scene. If so, introduce a 1 second delay (using Vera's standard scene delay mechanism) for the Restart and see if that improves things.
Title: Re: Countdown timer plugin (UI5)
Post by: BatterBits on June 07, 2014, 03:12:56 pm
Thanks, that has worked - at least, it has now I've taken the incorrect action to cancel the timer off another scene! - being able to see the logs is of great benefit!

Took a while, but I figured it out in the end - thanks for a great plugin.

Regards,

Ian.
Title: Re: Countdown timer plugin (UI5)
Post by: peterv on June 12, 2014, 12:27:27 am
How do I add additional counters? Do I have to read through 9 pages of this thread to find out or is it something that could be added to the original post?

Thank you

Edit: It is under Apps -> My Apps -> click on the plugin of which you want to create duplicate device and there is a button "Create another"

Still could be added to the first post.
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on June 12, 2014, 05:49:26 pm
Still could be added to the first post.

I did that today, though I point out that this is how you "add another" for all plugins, so it isn't really something specific to the Countdown Timer.  I accept that adding additional devices is something you are more likely to do with this plugin than others.
Title: Re: Countdown timer plugin (UI5)
Post by: tedp on July 11, 2014, 02:52:02 am
I just added this plugin to send a notification if I leave my garage door open for more than 30 minutes. Would it be an easy feature to allow  an "auto-restart" mode once the timer expires? The idea is that it would periodically trigger a notification until the door is closed which in turn will cancel the timer to stop the notifications via a trigger. I can do this with an extra scene to explicitly restart the timer on completion, but if it's easy, it can save some scene clutter.

Thx!
Title: Re: Countdown timer plugin (UI5)
Post by: pguraedy on July 15, 2014, 07:02:43 pm
So, I have a countdown timer working for me, but I need to add several others. After I do the "create another", I do see a new countdown timer device, but can't set the duration. Additionally, in the Advanced tab, there are no variables. The original countdown timer device had "duration" along with a bunch of other variables.

Any thoughts on what I'm missing here?
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on July 15, 2014, 10:23:50 pm

I do see a new countdown timer device, but can't set the duration.

I've had this happen. Liberal use of Save/Reload and browser refreshes have always worked for me in the end.

If not, I'll need some specific information about your firmware version and what browser you are using.
Title: Re: Countdown timer plugin (UI5)
Post by: pguraedy on July 15, 2014, 10:29:45 pm
Thanks. Multiple refreshes and reloads took card if it.
Title: Re: Countdown timer plugin (UI5)
Post by: conchordian on July 23, 2014, 03:25:37 am
I'm having a weird problem where 'loading icon' flashes for a second, every second, but only while a timer is running.  Doesn't seem to affect things, that I can see, but I wonder why it's having trouble finding the icon?
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on July 23, 2014, 06:24:03 am
I'm having a weird problem where 'loading icon' flashes for a second, every second, but only while a timer is running.

The icon is on my server (futzle.com).  I'll look through the logs and see if there's anything going on. Does your browser have Internet access? Does clearing the browser's cache have any effect? What browser are you using? What Vera firmware?

Edit: "Bandwidth exceeded".  I might have to shift those icons to somewhere else.  I'm getting a lot of requests, and it looks like they are not cached.  (Well done, MCV.)

Edit 2: A special shoutout to the person who accesses their Vera at 10.168.1.25.  You are using as much bandwidth as the rest of the users of Countdown Timer put together.  I am in awe of the complexity of your Vera's configuration.

Edit 3: But meanwhile I've blocked a few IPs from my site.  It should clear up in a few days.  I'll look at longer-term solutions.
Title: Re: Countdown timer plugin (UI5)
Post by: conchordian on July 24, 2014, 09:59:12 pm
Thanks very much.  It's all good again now.  It would be good if the icons could be stored on the Vera itself...I wonder why it's done remotely?
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on July 24, 2014, 10:13:22 pm

It would be good if the icons could be stored on the Vera itself...I wonder why it's done remotely?

Because the hoops I have to go through to put icons into the awful apps.mios.com interface are too much to bear. Also there is no path that works on both UI5 and UI6.

You are welcome to edit the plugin's device XML file to point to a local path, and install the icon files directly on your Vera. I leave this for you as an exercise, if you feel strongly enough about it.
Title: Re: Countdown timer plugin (UI5)
Post by: conchordian on July 25, 2014, 10:14:08 pm
Sorry, I thought it was how the Vera was designed, I didn't realise you'd made it that way for a reason.  Thanks for the plugin once again.
I might have a go just for the exercise, as you say.
Title: Re: Countdown timer plugin (UI5)
Post by: Vera Plus user on August 20, 2014, 06:50:36 am
Can I use it with full functionality on UI7?
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on August 29, 2014, 01:23:36 am
Can I use it with full functionality on UI7?

From version 7, yes.

There might be some hoops to jump through to set the timer's duration: if the "Set Duration" button doesn't work then you can set the number in the device's Advanced tab.  Try it and let me know how you go.
Title: Re: Countdown timer plugin (UI5)
Post by: birchey on September 01, 2014, 09:47:09 pm
Hi Futzle

Looks like a great plugin but i cannot install. Never had any issue with apps before but it seems to put the unit in a permanent busy state.

I am running vera lite with firmware 1.5.622

It keeps stating downloading plugin 1588 and remaining busy. I have had to un-install  to stop the permanent busy state.

Could you point me in the right direction?

Apologies if i have posted this in the wrong place.

Thanks Greg
Title: Re: Countdown timer plugin (UI5)
Post by: supsen on September 02, 2014, 02:08:23 pm
It keeps stating downloading plugin 1588 and remaining busy.

I too had the same problem on 2 Vera3's in my home.  I had difficulty reaching the page at first to uninstall it, so I had to disconnect my internet to uninstall. I saw it constantly looped trying to update the plugin.  Once uninstalled, I went to apps.mios.com and used that site to install the plugin, version 7.  No issues with it now, thankfully.
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on September 02, 2014, 06:01:25 pm
Looks like a great plugin but i cannot install. Never had any issue with apps before but it seems to put the unit in a permanent busy state.
I am running vera lite with firmware 1.5.622
It keeps stating downloading plugin 1588 and remaining busy. I have had to un-install  to stop the permanent busy state.

There was once a bug where if there were two versions of a plugin published on apps.mios.com then people's Veras would get in an infinite loop.  I would _hope_ that MCV fixed this bug, but perhaps not?

I'll dig up the relevant thread and link to it here.

Edit: Here it is: http://forum.micasaverde.com/index.php/topic,10679.0.html  MCV doesn't look like they've fixed the bug.  There is apparently a workaround, and it is to avoid using the local Vera interface to install the plugin: Go to apps.mios.com, log in using your cp.mios.com password, select your Vera and install the plugin (version 6.0) from there.  This supposedly prevents the restart loop.
Title: Re: Countdown timer plugin (UI5)
Post by: birchey on September 02, 2014, 10:47:18 pm
Looks like a great plugin but i cannot install. Never had any issue with apps before but it seems to put the unit in a permanent busy state.
I am running vera lite with firmware 1.5.622
It keeps stating downloading plugin 1588 and remaining busy. I have had to un-install  to stop the permanent busy state.

There was once a bug where if there were two versions of a plugin published on apps.mios.com then people's Veras would get in an infinite loop.  I would _hope_ that MCV fixed this bug, but perhaps not?

I'll dig up the relevant thread and link to it here.

Edit: Here it is: http://forum.micasaverde.com/index.php/topic,10679.0.html  MCV doesn't look like they've fixed the bug.  There is apparently a workaround, and it is to avoid using the local Vera interface to install the plugin: Go to apps.mios.com, log in using your cp.mios.com password, select your Vera and install the plugin (version 6.0) from there.  This supposedly prevents the restart loop.

Thanks for the replies apps.mios.com was the answer. I installed version 6, but then tried version 7 as suspen suggested and its installed correctly. It just didnt want to work from the local vera interface. Thanks for the support both of you futzle fantastic plugin great work.
Title: Re: Countdown timer plugin (UI5)
Post by: doctorelectron on October 10, 2014, 06:37:36 am
Is it possible to create new instances/multiple countdown timers using the HTTP/UPnP interface rather than manually using APPS>Countdown Timer>Plugin control>Create another in UI5?
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on October 10, 2014, 07:37:54 am

Is it possible to create new instances/multiple countdown timers using the HTTP/UPnP interface rather than manually using APPS>Countdown Timer>Plugin control>Create another in UI5?

I imagine so. That's what the web interface is doing after all. You could use Firebug to capture the URL that is invoked when you press the Create Another button. Or you could watch the Luup log to see the action and the parameters that are listed when you press the Create Another button. Or you could look it up on the MCV wiki, which lists a luup.create_device function that looks a bit like what you want, though it's only for UI6 and up.
Title: Re: Countdown timer plugin (UI5)
Post by: doctorelectron on October 10, 2014, 10:15:51 am
Thanks futzle. 

On investigation, it was easier than I expected by using ".../data_request?id=action&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=CreatePluginDevice&PluginNum=1588"
Title: Re: Countdown timer plugin (UI5)
Post by: ballroller on November 04, 2014, 01:54:47 pm
Ignore below and my apologies. I hadn't updated this system to UI5 yet. Sorry.

Hi Futzle- trying to install this on Vera2 UI5, and the only thing it's creating is a "_receiver" and a notation under "Mios Plugin dfdsfsd". But it doesn't have any options or allow me to do anything with it. Tried versions 6,7,8 and none work.

Any idea what I'm doing wrong?

Thanks!
Title: Re: Countdown timer plugin (UI5)
Post by: DeltaNu1142 on February 12, 2015, 08:57:02 am
I apologize if it's been addressed here somewhere, as I only reviewed the first and last pages. I'm wondering if anyone has developed a count UP timer... specifically for viewing the amount of time that has passed since something happened. In particular, I'd be interested in viewing this on a mobile application (like HomeWave)... less so in viewing on the browser UI.
Title: Re: Countdown timer plugin (UI5)
Post by: aa6vh on February 12, 2015, 10:38:56 am
No need for a count up timer. You can always just time stamp when something happens, then if you want to know the elapsed time, simply subtract that timestamp from the current time.

The real complex part of this is getting the results available to an external application. You would have to write a service on Vera that would listen to requests, and respond with the results.

There are some that have done similar stuff, so it can be done. But being such a complex task, it would not be for the faint at heart.
Title: Re: Countdown timer plugin (UI5)
Post by: asggold on February 22, 2015, 02:14:07 pm
I have read though most of the full post but had a quick question about using this to notify and if it is possible:

What I am looking to do is use this countdown timer to start when I run a scene and send me a notification if certain things are not done as requested by the scene.  Basically, I would like to have a notification sent to me if after I click any "Mode" other than "Home" my Alarm does not arm.

Do you know if this is possible using this plugin on UI7?

Thanks!
Title: Re: Countdown timer plugin (UI5)
Post by: conchordian on March 02, 2015, 12:10:16 am
You are welcome to edit the plugin's device XML file to point to a local path, and install the icon files directly on your Vera. I leave this for you as an exercise, if you feel strongly enough about it.

I thought I had this down pat, but the icon won't show up now, for some reason.  I edited the D_CountdownTimer1.json file, but it doesn't seem to work.  Any ideas, please?
Title: Re: Countdown timer plugin (UI5)
Post by: RexBeckett on March 02, 2015, 03:26:35 am
Try: "flashicon": "icons\/hourglass.png", for UI5

or "default_icon": "hourglass.png", for UI7.

Title: Re: Countdown timer plugin (UI5)
Post by: conchordian on March 02, 2015, 03:44:02 pm
Try: "flashicon": "icons\/hourglass.png", for UI5

or "default_icon": "hourglass.png", for UI7.

Thank you, the top one worked.
Title: Re: Countdown timer plugin (UI5)
Post by: Theboob on May 26, 2015, 11:40:04 pm
Hi Futzle. Not sure if this bug was mentioned, but here goes. I'm using UI7 (for what it's worth). If I set the duration on the Variables panel, and click in some other field, it indeed says that it has updated the variable. However, if I leave the panel and come back in, it still has the old value.

If I reload the page (CTRL R with IE), it does have the newer value.

Title: Re: Countdown timer plugin (UI5)
Post by: futzle on May 27, 2015, 01:04:45 am

Not sure if this bug was mentioned, but here goes. I'm using UI7 (for what it's worth).

There are innumerable bugs like that in UI7. After all this time there still isn't any direction from MCV about how plugins are supposed to force a variable value change to be saved, and for the plugin to be notified that it has to reload the value. Unfortunately I can't do anything about it because it's on MCV's side of the plugin contract.
Title: Re: Countdown timer plugin (UI5)
Post by: RichardTSchaefer on May 28, 2015, 09:43:00 am
What contract ?
Title: Re: Countdown timer plugin (UI5)
Post by: BigE-TX on June 18, 2015, 08:55:19 pm
Hummm.  Just trying to setup a siren tied to a door switch using countdown timer.  Have created open scene, close scene, & siren scene.  Open starts timer unmuted, closing door cancels both the timer and turns off alarm [presuming it was on to start with].  The challenge I have is with the countdown itself in UI7.  Under the device advanced screen I clicked on variables tab and input 600 [presumably seconds] for the duration and saved it; however, the alarm seems to go off after about 10 seconds -coincidentally the same number I originally input in the set duration of the device control screen [it now shows to be empty].  Is this the new norm in UI7 or am I configuring it incorrectly?  Any thoughts?
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on June 18, 2015, 09:18:14 pm

Is this the new norm in UI7 or am I configuring it incorrectly?

There is a certain amount of ritual in getting a variable change to stick in UI7. What I do is to edit the variable on the Advanced tab, then go straight to Apps > Develop Apps > Serial port configuration > Reload Luup. That'll restart the plugin and cement the new value I entered.
Title: Re: Countdown timer plugin (UI5)
Post by: RichardTSchaefer on June 18, 2015, 11:02:44 pm
@futzle

There is one more step to improve success.
Wait one minute after a change before changing the browser page.
There is some bug in Vera that at times causes the AJAX requests to take at least 1 minute to complete.
If you change browser tabs ... it cancels the ajax request before it is completed. This is a Vera/Proxy issue.

Then the rest as you indicated.
Title: Re: Countdown timer plugin (UI5)
Post by: BigE-TX on June 19, 2015, 03:42:22 pm
 ;D

Thanks guys, this worked like a charm to give my 10 minute timer an update from 10 seconds!  My new ZW080 siren now goes off after the garage frig/freezer door(s) are left open for 10 minutes.  I figure the siren should pay for itself in one or two episodes (which happen every year or so).  Tech support remotely assisted with inclusion ultimately resulting in an alarm icon rather than the light bulb I got with the general zwave inclusion process; noticed a aeon siren under the alarm section of add devices, but appears to bear letters for foreign frequency version. [capture3] so I am not entirely certain that is what we need.

Unfortunately I do not see configuration setting support in scenes for the device to allow for changes to volume level and tone.  Forum threads reference several work-arounds and suggested patches using lua code.  I also see ways to permanently change to the tone and volume using par 37 and establishing multipliers of 256 and adding 1/2/3 to that creating the desired selection rather than the default of 259 [tone1 + volume level 3] incorrectly mentioned in threads as default 13[capture 4].  They also mention things about random alarms in the middle of the night during heals; not something I wish to experience [poor WAF].  Ultimately would be nice to change alert based on which event is generating it...guess I can wait for UI7 patches.

I also  plan on adding some additional logic to the existing zwave temperature sender in the frig compartment to set scenes for the alarm.  For now, next step is the caddx sub-forum.  Thinking I may be able to use some more assistance... ::) as I am a bit stumped with an on-going challenge.
Title: Re: Countdown timer plugin (UI5)
Post by: rafale77 on June 19, 2015, 04:54:12 pm
Thanks for this. I was thinking about creating a timer like this myself until I found this.
I am using it to automatically set the vera house mode to vacation mode (which triggers many other things) after it senses I am in away mode for more than the timer time.
This becomes a 3 scene system:
1. scene 1 to trigger the timer when I go away
2. scene 2 to cancel the timer when I come back home
3. scene 3 to set the house mode to vacation after the timer expires.

Any idea to make it simpler?
Title: Re: Countdown timer plugin (UI5)
Post by: a-lurker on June 19, 2015, 06:20:30 pm
@futzle

Slight bug in the json file:

http://forum.micasaverde.com/index.php/topic,30310.msg238520.html#msg238520
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on June 20, 2015, 03:06:02 am
Slight bug in the json file:

So there is.  Thanks.
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on June 22, 2015, 06:54:05 am
Source code for this plugin is now at https://github.com/futzle/MiOS-CountdownTimer

I've updated the JSON file to fix the duplicate that a-lurker and amg0 reported.  I haven't yet updated the version on apps.mios.com.
Title: Re: Countdown timer plugin (UI5)
Post by: tomgru on July 31, 2015, 02:53:01 pm
Any chance this got updated very recently to a new version?  My vera3 with U15 went into infinite reboot mode this morning, and it seemed to happed every time it loaded this plugin (from status windows). I uninstalled, and the vera quick rebooting.

But i can't find it via the apps/install tab from within the Vera UI, and from the apps portal, there is no version information.
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on July 31, 2015, 08:14:01 pm
Any chance this got updated very recently to a new version?

There hasn't been an update to this plugin in more than a month.  There might be more hints about what's wrong in the Luup log.
Title: Re: Countdown timer plugin (UI5)
Post by: a-lurker on August 01, 2015, 01:07:21 am
@futzle

I'm having the same problem. Looks like the count_down_timer app is no longer in the app store. Also the count_down_timer app files are no longer in Vera in  /etc/cmh-ludl

So my Vera know it needs the app, can't find it in Vera, so goes to the app store and it's not there either. Vera freaks out and restarts.

amg0 says there was a recent app store crash:

http://forum.micasaverde.com/index.php/topic,30310.msg243121.html#msg243121

Maybe that's the problem. Any chance of posting the count_down_timer *.lzo files. Perhaps manually copying them across will fix the issue? Looks like a MCV created problem as I haven't changed anything in Vera - it just started restarting continually by itself.

See also these recent threads:

http://forum.micasaverde.com/index.php/topic,33220.msg243195.html#msg243195

http://forum.micasaverde.com/index.php/topic,33220.msg243195.html#msg243195
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on August 01, 2015, 01:14:14 am
Any chance of posting the count_down_timer *.lzo files. Perhaps manually copying them across will fix the issue?
All the files are on GitHub (https://github.com/futzle/MiOS-CountdownTimer).  You can use pluto-lzo (http://forum.micasaverde.com/index.php/topic,7589.msg100249.html#msg100249) to compress them.
Title: Re: Countdown timer plugin (UI5)
Post by: tomgru on August 01, 2015, 01:29:23 am
I ended up doing a restore from a backup done yesterday, after deleted the countdown timer plugin today.  All seems normal now.  Maybe the app store came up in the meantime.   

Glad to know i'm not nuts. 
Title: Re: Countdown timer plugin (UI5)
Post by: a-lurker on August 01, 2015, 03:08:13 am
OK - I compressed the files and copied them across. However Vera kept deleting them each time it restarted; presumably in preparation for a newly downloaded set that it can't download (???). I turned off the plugin's auto update flag and everything came good. I note that an AltUI update was also queued up waiting to be downloaded.

Futzle - is this related, do you think?

http://forum.micasaverde.com/index.php/topic,10679.msg74451.html#msg74451
Title: Re: Countdown timer plugin (UI5)
Post by: kenray536 on August 01, 2015, 12:15:42 pm
I had the same problem. It kept on trying to update plugin #1588 which translated to the countdown timer plugin. It would cause my Vera to lock up after awhile and become unresponsive. When I would l login I would get an error message saying something similar to "Luup engine is taking longer than expected....."

I turned off the auto-update in the app settings and left the current version 8.0 installed. It's working fine for me now, but I was worried for a second. Does anyone know is version 8.0 the latest version?
Title: Re: Countdown timer plugin (UI5)
Post by: tdinardo on August 01, 2015, 03:10:41 pm
20 minutes of frustration to get Vera to uninstall the add-in. Went to apps.mios.com to attempt a reinstall, but apps.mios.com still shows it as installed. Hopefully they unbreak the store sometime soon....
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on August 01, 2015, 06:41:59 pm
This is happening to me too.  I can't look at it now but I will in the next 24 hours.  I too did nothing to my Vera so something automatic has happened.  The irony...

Edit: Here's what I did to fix it. Essentially I dissociated my Countdown Timer devices from the plugin, and then removed references to the plugin from the app store list.  Finally I put the plugin's source files back onto the Vera.


With these steps, the plugin is now acting as if it were manually installed.  It's holding good for me after 15 minutes.

MCV: You need to fix the store.  Anyone who installs this plugin afresh will get stuck in this loop and blame me.
Title: Re: Countdown timer plugin (UI5)
Post by: brettow on August 02, 2015, 10:28:53 pm
I had the same problem. It kept on trying to update plugin #1588 which translated to the countdown timer plugin. It would cause my Vera to lock up after awhile and become unresponsive. When I would l login I would get an error message saying something similar to "Luup engine is taking longer than expected....."

I turned off the auto-update in the app settings and left the current version 8.0 installed. It's working fine for me now, but I was worried for a second. Does anyone know is version 8.0 the latest version?

This worked for me also. ;D
Title: Re: Countdown timer plugin (UI5)
Post by: Don Diego on August 03, 2015, 05:10:19 am
I had the same problem. It kept on trying to update plugin #1588 which translated to the countdown timer plugin. It would cause my Vera to lock up after awhile and become unresponsive. When I would l login I would get an error message saying something similar to "Luup engine is taking longer than expected....."

I turned off the auto-update in the app settings and left the current version 8.0 installed. It's working fine for me now, but I was worried for a second. Does anyone know is version 8.0 the latest version?

This worked for me also. ;D

All--

 I had the same problem. I turned off the auto update and that worked for me too. Hope someone lets us know when the problem fixed.

   Don
Title: Re: Countdown timer plugin (UI5)
Post by: pierda on August 08, 2015, 04:23:04 pm
I had the same problem. It kept on trying to update plugin #1588 which translated to the countdown timer plugin. It would cause my Vera to lock up after awhile and become unresponsive. When I would l login I would get an error message saying something similar to "Luup engine is taking longer than expected....."

I turned off the auto-update in the app settings and left the current version 8.0 installed. It's working fine for me now, but I was worried for a second. Does anyone know is version 8.0 the latest version?

Also had the same problem and your fix worked - many thanks.
Title: Re: Countdown timer plugin (UI5)
Post by: tdinardo on August 09, 2015, 10:47:38 pm
How do we get MCV to fix the store? It's ridiculous that this is still broken.
Title: Re: Countdown timer plugin (UI5)
Post by: TheKorn on August 17, 2015, 06:17:05 am
On another note (thank goodness I have auto-update turned off!), is restart no longer working?  I have a scene on a motion detector where I kick restart instead of start upon detection (to keep a lamp on longer than the motion detector would normally keep it on).  It I test the scene by hitting play with the timer off, the countdown timer starts at the top as expected.  But if I re-run the scene (which should reset the timer), it just keeps counting down where it is rather than resetting the timer.

Vera edge running version 8.0 of countdown timer and firmware 1.7.1248.

Thanks!

(I've also tried hitting cancel, delay 1s, then hitting restart...  same results.  Haven't tried longer delays between cancel & restart.)
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on August 17, 2015, 06:01:15 pm
On another note (thank goodness I have auto-update turned off!), is restart no longer working?  I have a scene on a motion detector where I kick restart instead of start upon detection (to keep a lamp on longer than the motion detector would normally keep it on).  It I test the scene by hitting play with the timer off, the countdown timer starts at the top as expected.  But if I re-run the scene (which should reset the timer), it just keeps counting down where it is rather than resetting the timer.

Clicking the Restart button on the Countdown Timer device works for me.  Try that.  If that works, but the scene doesn't, then the problem is in the interaction between the scene and the timer device.  Also watch the Luup log while you run the scene and see if there are any errors reported.

Re-creating the scene might help.  I had some duplicate IDs in the JSON file of the plugin, and while I've fixed them all now, I don't know how a scene or trigger created before the fix will behave.
Title: Re: Countdown timer plugin (UI5)
Post by: TheKorn on August 17, 2015, 06:24:16 pm
Clicking the Restart button on the Countdown Timer device works for me.  Try that.

Sorry for the fire drill; while looking at logs to write this reply I realized I had put in some lua code into the scene that prevents running the scene if the lights are already on.  So when the motion sensor trips a second time, the lua code runs, checks if the lights are on and bails.  That's why the restart isn't working, it wasn't actually getting called.  D'oh!

How do I check if a countdown timer has time on it via luup?  Or alternatively, just determine that the countdown timer is still active and not expired?

Thanks!
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on August 17, 2015, 06:29:47 pm
How do I check if a countdown timer has time on it via luup?  Or alternatively, just determine that the countdown timer is still active and not expired?

Code: [Select]
luup.variable_get("urn:futzle-com:serviceId:CountdownTimer1", "Counting", deviceNumber)will return "0" if the timer is inactive and "1" if it is active.  Other interesting variables are "Muted", "Remaining" and "DueTimestamp".
Title: Re: Countdown timer plugin (UI5)
Post by: TheKorn on August 17, 2015, 06:32:27 pm
Code: [Select]
luup.variable_get("urn:futzle-com:serviceId:CountdownTimer1", "Counting", deviceNumber)will return "0" if the timer is inactive and "1" if it is active.  Other interesting variables are "Muted", "Remaining" and "DueTimestamp".

Thanks much!
Title: Re: Countdown timer plugin (UI5)
Post by: hcoyote on August 23, 2015, 02:14:00 am
This is happening to me too.  I can't look at it now but I will in the next 24 hours.  I too did nothing to my Vera so something automatic has happened.  The irony...

Edit: Here's what I did to fix it. Essentially I dissociated my Countdown Timer devices from the plugin, and then removed references to the plugin from the app store list.  Finally I put the plugin's source files back onto the Vera.

<cut instructions>

With these steps, the plugin is now acting as if it were manually installed.  It's holding good for me after 15 minutes.

MCV: You need to fix the store.  Anyone who installs this plugin afresh will get stuck in this loop and blame me.

This is still happening.  :-(

I happened to install fresh and immediately broke my Edge.

Thanks for posting the instructions on backing it out.

Would be nice if MCV had an easier way to disable plugins in the event of repeated startup failures.
Title: Re: Countdown timer plugin (UI5)
Post by: vituz on August 30, 2015, 09:03:56 am
I don't know what's wrong with this app... I installed it on my micasaverde and it went into a loop... it's always trying to download plugin #1588... then it says "please wait", then it starts again... I then wanted to uninstalled the app but it did not show in my apps... so I tried rebooting... now the app shows but I cannot uninstall it (I click uninstall and nothing happens). What can I do?
Title: Re: Countdown timer plugin (UI5)
Post by: vituz on August 30, 2015, 09:14:43 am
I finally solved it... I managed to untick "auto-update" and at that point I was able to uninstall. I hope it helps anybody who might face this...
Title: Re: Countdown timer plugin (UI5)
Post by: tomgru on May 05, 2016, 03:00:23 pm
Any changes to this that might have been realized through auto updates with the app?  I'm having some reboot issues, and seeing a lot of log posted about this.  just curious.

Bump... still curious???
Title: Countdown timer plugin (UI5)
Post by: futzle on May 09, 2016, 07:09:00 am
This plugin has literally not changed in 11 months.  I can't speak for the Vera plugin runtime in general.

Edit: spelling
Title: Re: Countdown timer plugin (UI5)
Post by: cw-kid on September 23, 2016, 12:39:16 pm
Hi

I am running a VeraEdge on UI7 with the latest firmware.

I installed the Count Down Timer plug-in today and set its duration to 60s. I was expecting when the timer is started it would count down from 60 to 0 and then finish.

However for some reason when it reaches 0 it then starts over again counting down from 60 seconds and it does this over and over.

Any ideas ?

Thanks
Title: Re: Countdown timer plugin (UI5)
Post by: cw-kid on September 23, 2016, 01:20:48 pm
Hi

I've just manually uploaded the plug-in files to Vera from the Github page here (https://github.com/futzle/MiOS-CountdownTimer).

The plug-in version was the same however at v 8.0.

I am assuming this is a bug? and it should not keep on restarting the timer over and over but it should just complete and finish.

Thanks
Title: Re: Countdown timer plugin (UI5)
Post by: cw-kid on September 23, 2016, 02:30:04 pm

If I remove the trigger from the scene that the count down timer has completed.

And then on the count down timer device itself, if I manually press the start button it stops at 0 and does not restart the counter.

So the restarting over and over thing seems to be related to the trigger. I used the Timer completes while not muted option.

If I add the trigger back in to my scene then when the counter reaches 0 my scene is run, BUT the count down timer is restarted again Why ?

Very strange indeed.

As a work around in the scene that is triggered by the count down timer, I have added a 30 sec delay and an action to then cancel the timer.

Thanks
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on September 23, 2016, 06:57:19 pm
If I add the trigger back in to my scene then when the counter reaches 0 my scene is run, BUT the count down timer is restarted again Why ?

At a guess, I'd say that the scene that is run by trigger is restarting the timer, either directly (as part of its actions) or indirectly (the scene modifies other devices, which trigger another scene that restarts the timer). Causal loops are possible with the Countdown Timer, because sometimes you might want to have the effect you're seeing deliberately. But you have to be careful to allow an escape from the feedback.

Watch the Luup log when the timer runs out. It should tell you what is getting triggered to restart the timer.
Title: Re: Countdown timer plugin (UI5)
Post by: cw-kid on September 24, 2016, 09:35:50 am
Hi

I made a mistake, it seems my "Burglar Alarm Delayed" scene was also starting the timer, along with the first scene "Burglar Alarm" causing a loop.

I have removed it from the delayed scene and now its working and the timer stops after 60 seconds and does not restart again.

Maybe I added it by mistake, but I have also seen Vera add actions in to scenes that I never put there, which is weird.

Thanks
Title: Re: Countdown timer plugin (UI5)
Post by: Quixote on October 01, 2016, 11:25:19 pm
Hi guys,

Please forgive me for not reading the 13 pages of the thread before posing a question. I've been manually programming IR pronto codes for two evenings now and I find that my attention span is pretty much non-existent at this point (the beer probably doesn't help).

I recently bought a cheap RGB LED light strip controller with 20 meters of lights, and I'm working on building a new light hood for one of my fish aquariums. So far I've programmed the necessary IR codes into my Vera for a USB-UIRT. My plan is to change the colors at intervals to sort of simulate a sunrise, so I'll move through dark blue to light blue, eventually end up at white and then cycle down at the end of the day through some yellow, amber and reds.

What I hope to accomplish is to build a system that I can set to cycle through the routine on its own with no intervention when I'm not home for a few days, but when I'm present I'd like to be able to start the cycle manually since the time that I wake up varies and the tank is beside my bed. I don't feel like being woken up by lights shining in my face. At this point, I'd like to set something up that's simple and when I'm feeling more energetic I'll probably take a look at PLEG.

Would this plugin be the answer and if so, can you give me an idea of where to start? Right now I just have a bunch of scenes for (one each color).

Thanks!
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on October 01, 2016, 11:42:13 pm
A Countdown Timer could be part of a complete solution, but your desire to have it run unattended when you're not at home, and on demand when you are at home, puts it out of reach of "something simple".  You'll need to supplement it with some Virtual Switches or similar to tell Vera whether it should act on its own or on your command.  I'm sure that most people reading would be thinking at this stage: Use PLEG; it's designed for this.

I do use Countdown Timers for a wakeup routine myself, with Philips Hue lamps (but that detail should be irrelevant).  I have four timers of different durations (1 minute, 5 minute, 15 minute, 60 minutes), and one scene that Starts all of the timers synchonously.  Then I have four more scenes, each of which triggers on a different timer's Timer Completes While Not Muted, sending different colours and brightnesses to the lamps.  It shouldn't be too hard to fit this model to your existing scenes.

Where this starts to break down is scalability: you need several timers, one scene to start them all, and one scene for each of the timers' completions.  Which is one of the reasons why PLEG exists.
Title: Re: Countdown timer plugin (UI5)
Post by: RichardTSchaefer on October 02, 2016, 09:12:42 am
I was a big fan/user of Futzle's Countdown Timer and Combination plugin and lots of connecting scenes when I bought my first Vera.
Without them I would have probably moved on to something else.
You needed them when I started in UI4 if you wanted to do any meaningful automation.
As I continued to automate things in my house, the memory consumption (because of the number of plugin instances) and the complexity caused by the number of scenes that glued things together is what motivated the design of PLTS first, then shortly after PLEG.

PLTS was motivated by the Countdown Timer Plugin and the fact that many of my Countdown timers needed a Combination plugin to handle non trivial triggers and a collection of connecting scenes.
I wanted one device to encapsulate all of this logic.

PLEG was motivated by the Combination Plugin and the fact that many of my Combination plugins drove logic independent of any Countdown Timer.
Then I realized that many of my "Countdown" timers did not need a user interface ... they were only for automation ... and I added timers to PLEG.
PLEG then became the dominant plugin, and you would use PLTS if you needed a timer with a User Interface.


 
Title: Re: Countdown timer plugin (UI5)
Post by: Quixote on October 02, 2016, 06:08:19 pm
Thank you both for your replies.
I'm taking off for a week or so, so I guess in the meantime I'll just set up something super simple that acts at specific times, just so the fish won't be in the dark all week. While I'm on my trip I'll take a look at the PLEG documentation and see if I can figure it out on my own. At first glance at the PDF, it seems like something that has a bit of a learning curve. I may need a few pointers in the beginning, but I'm sure I'll get the hang of it.

Thanks again -- especially for these plugins that you've made available to us. It's guys like you two that make Vera especially useful.
Title: Re: Countdown timer plugin (UI5)
Post by: RichardTSchaefer on October 02, 2016, 09:13:52 pm
Quote
It's guys like you two
In this context ... guys is a person of each gender.
Title: Re: Countdown timer plugin (UI5)
Post by: Quixote on October 06, 2016, 05:51:34 pm
I meant "people like you two."
:D
Title: Re: Countdown timer plugin (UI5)
Post by: 1937BCS on December 30, 2016, 04:13:01 pm
I updated to the latest firmware on my Vera Plus, and my countdown timers are not working properly. Sometimes they work, but mostly they countdown partially and then go to zero with no effect on the scene. I have 5 countdown timers, so I'm in a panic.

Support tells me to open a ticket because it's a 3rd party plugin (didn't know there was anything else). They see in the logs that the timer is resetting itself, but they need time to research it (translation--nothing will be done).

Was this timer only meant for UI5 and not work on UI7? I've been using the counters for a couple of years. I appreciate if someone can give me advise and/or a workaround.
Title: Re: Countdown timer plugin (UI5)
Post by: futzle on January 01, 2017, 05:10:43 am
Was this timer only meant for UI5 and not work on UI7? I've been using the counters for a couple of years. I appreciate if someone can give me advise and/or a workaround.

I wish I had good news for you, but I don't. Countdown timers make use of the luup.call_timer() function to tick down to zero. If recent releases of UI7 break the reliability of luup.call_timer() then the plugin can't do its job.

It would be instructive to see what's being reported in the logs when the timer stalls. If there's a genuine error message then I've got a chance to see what's going wrong.

I'm on an older release of UI7 and the plugin works for me, but I haven't got a compelling reason to upgrade.
Title: Re: Countdown timer plugin (UI5)
Post by: 1937BCS on January 11, 2017, 12:18:44 am
How do you stop the "firmware update" message? I'm not going to update my other unit, but that message pops up ever time I sign in.
Title: Re: Countdown timer plugin (UI5)
Post by: cw-kid on January 12, 2017, 01:44:25 pm
I have a VeraEdge UI7 firmware version 1.7.2406, after reading the comment about the count down timers not working properly I thought I'd better check mine as I use it for a delayed burglar alarm trigger.

I just tested the alarm and the count down timer worked, counted down to zero and then my scene ran OK.

@1937BCS So are you saying its an intermittent problem ?

Thanks
Title: Re: Countdown timer plugin (UI5)
Post by: rafale77 on January 12, 2017, 09:42:38 pm
Yeah I have observed my 2 timers in the past few days and have not seen any problem...