Author Topic: Want to use vox as an alarm clock need explanation of (A)Contains(B)  (Read 10199 times)

0 Members and 1 Guest are viewing this topic.

MrWolf

  • $upporter
  • Sr. Member
  • *****
  • Posts: 209
  • Karma: 4
    • View Profile
Re: Want to use vox as an alarm clock need explanation of (A)Contains(B)
« Reply #15 on: April 20, 2012, 02:59:06 PM »
Did anyone ever get this working in its entirety or thereabouts?

It would be cool to be able to say "Set an alarm for 18:30" and it play music at that point.

If you did then can I have the XML?

-P
Home automation guides for idiots like me by an idiot (me)...
https://www.youtube.com/user/wolfsweb

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Want to use vox as an alarm clock need explanation of (A)Contains(B)
« Reply #16 on: April 20, 2012, 03:03:47 PM »
yes, I explain how to do it in this very thread...

http://voxcommando.com/forum/index.php?topic=653.msg4655#msg4655

MrWolf

  • $upporter
  • Sr. Member
  • *****
  • Posts: 209
  • Karma: 4
    • View Profile
Re: Want to use vox as an alarm clock need explanation of (A)Contains(B)
« Reply #17 on: April 20, 2012, 03:32:40 PM »
I could be being thick (fairly usual).  But this would only work for a static alarm clock, or one that I intended to update on a minimal basis.

The scenario I'm thinking is if me and my good lady decide to take a nap, but we want to get up in an hour, I would say "Chloe, set an alarm for 18:30".

Since I posted I started fiddling, and have so far managed to get her to set an alarm for in 15 seconds time by using SetEventTimer and then having a payload range of 10,15,20,25,30,35,40,45,50,55.  She then puts the lights on dim and plays a playlist in XBMC

I can obviously say to her, "Chloe set an alarm for 900" and she would wake me up in 900 seconds/15 minutes, but what's the easiest way to tell her 15 minutes and her understand me?

Sorry to ask, I can guarantee this is covered somewhere in the Wiki, but whilst I've got your attention :)

-P
Home automation guides for idiots like me by an idiot (me)...
https://www.youtube.com/user/wolfsweb

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Want to use vox as an alarm clock need explanation of (A)Contains(B)
« Reply #18 on: April 20, 2012, 03:48:36 PM »
there is currently no great way to set an alarm on the fly for a specific time.  You could probably do something with EG fairly easily (if you know how to use EG).

but if you want to be able to say:

do something in:
-5 minutes
-10 minutes
-15 minutes
...
- an hour

then you can do this with a custom payloadXML file.  exactly what you are already doing really, but with a payloadXML file instead of a payloadList which you are currently using.  You would put the phrase(s) in the right column and the equivalent time in seconds in the left column.

MrWolf

  • $upporter
  • Sr. Member
  • *****
  • Posts: 209
  • Karma: 4
    • View Profile
Re: Want to use vox as an alarm clock need explanation of (A)Contains(B)
« Reply #19 on: April 20, 2012, 04:44:01 PM »
Mate this is perfect.

I already had a static alarm with Eventghost and I'm a 9-5 guy so I only really wanted a nap timer and now I have one.

No worries if not, but if I set an alarm for an hours time but then wake up after 30 minutes and decide to watch TV is there any way to stop the countdown so that it doesn't trigger the alarm?

Your software truly is genius brother.

-P
Home automation guides for idiots like me by an idiot (me)...
https://www.youtube.com/user/wolfsweb

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Want to use vox as an alarm clock need explanation of (A)Contains(B)
« Reply #20 on: April 20, 2012, 04:49:58 PM »
there is no way (currently) to kill an event timer once it has been started.  In theory I should be able to make a command that could clear ALL created event timers.  Killing them by name would require more work.

However, what you can do quite easily is set a variable when you start the timer.  Let's say that when you first create the timer you also make a variable called DoWakeEvent and set the value to true.  then when the event triggers the wake action you can check to see if this variable is set to true.  If you want to cancel the timer before it goes off, you just need to set this variable again to anything other than true.

You'll need the latest version of VC for this since I added the ability to set user variables quite recently.

edit:
You can create the var like this:
Code: [Select]
Results.SetVar      DoWakeEvent      True
and you can access your variable later (like in an if then else block) using {Var.DoWakeEvent }  assuming that you named it "DoWakeEvent ".
« Last Edit: April 20, 2012, 04:58:26 PM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Want to use vox as an alarm clock need explanation of (A)Contains(B)
« Reply #21 on: April 20, 2012, 04:53:13 PM »
you might also be able to check if the computer is already doing certain activities before executing the wakeup actions.  That's a vague statement because I don't know enough about what "watch TV" really means on your system or if there is a way for VC to know about it.