Author Topic: confirm doesn't work if triggered by event  (Read 4774 times)

0 Members and 1 Guest are viewing this topic.

Dave

  • $upporter
  • Sr. Member
  • *****
  • Posts: 139
  • Karma: 31
    • View Profile
confirm doesn't work if triggered by event
« on: March 03, 2012, 12:34:53 PM »
Today I was playing around some commands that need a confirmation, when I noticed that it does not work if I trigger the command by an event.
In this case VC behaves like no confirmation was needed and directly executes the command.
If I trigger the same command by a phrasee everything works fine.
I tried it with an older version (i guess 0.934) and with 0.944, but it makes no difference.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: confirm doesn't work if triggered by event
« Reply #1 on: March 03, 2012, 01:01:54 PM »
Why would you need to confirm it if it is triggered by an event?

The idea of the confirmation is to avoid the possibility of VC misunderstanding you and doing something undesirable.  In the case of an event, there is no reason to think there could be any confusion.

Dave

  • $upporter
  • Sr. Member
  • *****
  • Posts: 139
  • Karma: 31
    • View Profile
Re: confirm doesn't work if triggered by event
« Reply #2 on: March 03, 2012, 01:28:32 PM »
hmmm, that makes sense. and probably there are better ways to realize what i want to do :bonk

what i actually (want to) do is that:
if i say "good night" vc sends an event to eg and runs a phyton script to get the time.
if it is past 10pm eg sends an event to vc to close xbmc and turn off my lights and tv. (i know i could use  eg to close xbmc than the xbmc commandgroup would still be activated).
else eg sends an event to vc to ask me if i am really going to bed. if i confirm that the event to turn everything off is called...

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: confirm doesn't work if triggered by event
« Reply #3 on: March 03, 2012, 01:47:53 PM »
well there is really no easy way to do this at the moment, but I should point out that you don't need to call eventghost to check the time.

I supposed could probably modify VC to enable confirmation for event triggered commands as well, but I'm not really sure it makes sense to do that.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: confirm doesn't work if triggered by event
« Reply #4 on: March 03, 2012, 02:26:29 PM »
well there is really no easy way to do this at the moment, but I should point out that you don't need to call eventghost to check the time.

I supposed could probably modify VC to enable confirmation for event triggered commands as well, but I'm not really sure it makes sense to do that.
Why doesn't do this with VC? see pics, or I understand it not realy  ;)

PS: The commands are not complete, this is an example how can do it!

Kalle
***********  get excited and make things  **********

Dave

  • $upporter
  • Sr. Member
  • *****
  • Posts: 139
  • Karma: 31
    • View Profile
Re: confirm doesn't work if triggered by event
« Reply #5 on: March 03, 2012, 03:15:49 PM »
thanks Kalle, but "<" doesn't work with {shorttime} because it's not a number.
but anyway i figured out how to do it. i had to use a bunch of if-statements and the (A)contains(B)-condition for every single time.
now i need a confirmation if it's between 6 am and 9:59pm and it works without confirmation if it's between 10pm and 5:59am.  ;D

edit: if anyone is interested in what i did:
« Last Edit: March 03, 2012, 03:28:16 PM by Dave »

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: confirm doesn't work if triggered by event
« Reply #6 on: March 03, 2012, 03:29:56 PM »
thanks Kalle, but "<" doesn't work with {shorttime} because it's not a number.
but anyway i figured out how to do it. i had to use a bunch of if-statements and the (A)contains(B)-condition for every single time.
now i need a confirmation if it's between 6 am and 9:59pm and it works without confirmation if it's between 10pm and 5:59am.  ;D

edit: if anyone is interested in what i did:
cool, nice work  :clap

Kalle
« Last Edit: March 03, 2012, 05:23:45 PM by Kalle »
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: confirm doesn't work if triggered by event
« Reply #7 on: March 03, 2012, 10:41:22 PM »
so I just realized.  if you trigger a command using an event, it will ignore the fact that the command is marked as a "confirm" command.

but... if you trigger the command using VC.TellVox it will ask for confirmation before executing the command.  So we have the best of both worlds.

Also, you don't need to use all those if then blocks.  You can do it all in a single block.  Something like this:

Dave

  • $upporter
  • Sr. Member
  • *****
  • Posts: 139
  • Karma: 31
    • View Profile
Re: confirm doesn't work if triggered by event
« Reply #8 on: March 04, 2012, 04:00:16 AM »
Thanks James, this works great and is so much easier than my solution ::bow

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: confirm doesn't work if triggered by event
« Reply #9 on: March 04, 2012, 09:41:48 AM »
{DtCustom} is not a very well documented feature but it comes in handy.

I just added a bit of info on the wiki: http://voxcommando.com/mediawiki/index.php?title=Custom_DateTime_codes

jamesst

  • $upporter
  • Jr. Member
  • *****
  • Posts: 25
  • Karma: 0
    • View Profile
Re: confirm doesn't work if triggered by event
« Reply #10 on: March 11, 2012, 05:55:16 PM »
Hi, unfortunaly I don't get how to use VC.TellVox for confirmation, can someone plase post te configuration file how to achive this what Dave is trying to do .

Thanks

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: confirm doesn't work if triggered by event
« Reply #11 on: March 11, 2012, 06:36:03 PM »
Hi, unfortunaly I don't get how to use VC.TellVox for confirmation, can someone plase post te configuration file how to achive this what Dave is trying to do .

Thanks

I'm attaching a sample but read this too and hopefully it will make sense.

VC.TellVox emulates actually saying a command and VC will interpret the parameter as though you had said it.

so if you have:

- Command 'A' that is triggered by the phrase "just do it"

- Command 'B' has the action :      VC.TellVox     just do it

then when command 'B' runs it will be as though you had said "just do it".

if you want command 'A' to require confirmation, you edit command 'A' in the LCB (command builder) and put a check-mark in the "confirm" box.  If you do that, it will require confirmation whether you actually say the command or you use VC.tellvox

How the confirmation works is defined by how you set it up in VC Options.

Remember that VC.TellVox works just like speaking, so if VC is in Off mode it won't work and if in Standby it will only work if you use a prefix or command 'A' is set to "always on".

Tellvox is very powerful because you can send payloads as well.

You can do something like this:      VC.TellVox      play artist David Bowie
and it will work just like you said it, using the payload as it should.
(Be careful to make sure that you spell everything correctly when using tellvox.)

jamesst

  • $upporter
  • Jr. Member
  • *****
  • Posts: 25
  • Karma: 0
    • View Profile
Re: confirm doesn't work if triggered by event
« Reply #12 on: March 12, 2012, 05:23:30 PM »
Thanks James,

Actually it is quite simple, I was probably too lazy in the first time . Sorry.
Anyway thanks for your example.