Author Topic: looping with events  (Read 2598 times)

0 Members and 1 Guest are viewing this topic.

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
looping with events
« on: February 06, 2016, 06:12:27 PM »
I'm trying to use tasker to trigger an event for Scrolling (Left, Right, Up, Down) but when the event triggers it only executes the command once (XJson.Btn.KB) but if I use VC.Tellvox then the command will loop (I prefer using an event as it seems to have a little less delay before execution)

according to the wiki an event should work with looping
http://voxcommando.com/mediawiki/index.php?title=Logical_Command_Builder#Looping

this is the command that I'm using
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.4-->
<command id="286" name="scroll" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="True" loopDelay="300" loopMax="50" description="">
  <action>
    <cmdType>XJson.Btn.KB</cmdType>
    <params>
      <param>{1}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>scroll</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\4directions.xml</payloadFromXML>
  <event>Scroll</event>
</command>

these are the two different VC api calls I'm using with tasker

executes only once
Code: [Select]
/Api/vc.triggerevent&&Scroll&&Right
executes and loops
Code: [Select]
/Api/vc.tellvox&&Scroll Right

Simeon Tuitt

  • Contributor
  • ***
  • Posts: 79
  • Karma: 0
    • View Profile
    • Simeon Tuitt Home Automation
Re: looping with events
« Reply #1 on: February 06, 2016, 07:53:46 PM »
Hi PegLegTV,

I am glad to see you posted this as I was about to post something myself similar, I have been trying to set tasker up to send a command to vox using the tasker UDP SENDER triggered by location so when I leave home tasker sends a command via VC.TellVox command.

I have noticed that with TTS also turned on to speak the alarm is activated I gEt a viscious looping that makes vox say every TTS separated by | over and over. Vox then loops saying the alarm armed TTS message until it crashes.

I have tried all sorts of variations to get commands from tasker to vox and the only one that works is when I have VC.TellVox in the command builder and the VC.TellVox command in the UDP sender for tasker. I have tried removing the TTS speak command from command builder and just use VC.TellVox but it then doesn't do anything.

If I only have VCTellVox it in tasker it doesn't trigger the command action on vox.

I have tried using VC.TriggerEvent also and that doesn't work for triggering vox to perform the command action when sent from tasker.

I will have a go at posting my command tree shortly.

If you have any suggestions for how I can send a command from tasker to vox it would be appreciated, I just need to send enable alarm to vox from tasker.

I have followed the wiki and experimented but the loopingbefore crashing is where I am at right now.

Cheers.
Sim  8)
Simeon Tuitt Is An Information Product Creator From The UK Who Took His Skills From Online Business Automation And Applied It To Automating A Smart Home.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: looping with events
« Reply #2 on: February 06, 2016, 08:32:18 PM »
@Simeon, hopefully PegLegTV can help you figure out how to use Tasker and VoxCommando. However, the problem you're describing sounds completely different than what PegLegTV is describing above.

If you plan to post more information to try to get some help with your issue, I suggest you post it in the support section, not in this thread. The Tasker + VC support board would be a good place to post your question. http://voxcommando.com/forum/index.php?board=60.0

You should:

1. post the command xml *just* for the specific command that is not executing as you expect it to (not your whole command tree). This can be copy and pasted in a code block, using the # symbol to create a code block.
2. attach a VC log that demonstrates the looping problem you've described, and
3. ideally, also the xml for your Tasker command so that people can see how you've composed your command in Tasker that is not doing what you want.


Also, when describing the problem, try to distinguish between when you're referring to "actions" within a command, and the command itself. VC.TellVox and TTS.Speak are actions, not commands. A command is made up of a series of actions.

It can be difficult for us to understand and diagnose a problem when these terms are confused.
« Last Edit: February 06, 2016, 08:46:53 PM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: looping with events
« Reply #3 on: February 07, 2016, 02:23:01 AM »
@Simeon Tuitt, it would also be helpful to know how you are having tasker determine that you are leaving the house and if you are using a dns (speculating sense you are are using UDP when leaving the house)

depending how tasker is determining that you are leaving the house it could be causing tasker to send the same UDP packet over and over, and causing VC to Crash

in my second video on making a home control app using Tasker I show how to use http.get to trigger an event in VC, if you are still on your local network when tasker tells VC that you are leaving the house then you could use http.get to trigger an event (like I am doing in the video) or you can use vc.tellvox either one should work

using http.get in Tasker to trigger and event in VC
https://youtu.be/C_ZJQ2C73Sg?t=685

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: looping with events
« Reply #4 on: February 21, 2016, 07:10:32 PM »
I'm trying to use tasker to trigger an event for Scrolling (Left, Right, Up, Down) but when the event triggers it only executes the command once (XJson.Btn.KB) but if I use VC.Tellvox then the command will loop (I prefer using an event as it seems to have a little less delay before execution)

There is a new version of VC on the download page.  I have not announced it yet but it includes changes to looping and confirmation to commands that are triggered by events.

http://voxcommando.com/mediawiki/index.php?title=ChangeLog#Version_2.2.1.6

If you get a chance please try it out and let me know.

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: looping with events
« Reply #5 on: February 21, 2016, 07:17:16 PM »
Sweet  ;D, Will do, It may be a little later this evening when I get a chance to test it out but I'll let you know

PegLegTV

  • $upporter
  • Hero Member
  • *****
  • Posts: 500
  • Karma: 43
    • View Profile
Re: looping with events
« Reply #6 on: February 21, 2016, 09:17:52 PM »
Just tested using Tasker to trigger the event and scrolling (Looping) works great  :clap, Thanks for going over the top  :D