News:

HOT TIP! Commands and groups can be copied and pasted directly from your command editor to the forum, and vice versa. This makes sharing command XML on the forum much easier!

Main Menu

IP Power 9258

Started by mdsh, September 07, 2013, 01:23:53 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

mdsh

#15
Hi Kalle, hope I did this right.

<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="test IP" enabled="True" prefix="" priority="0" requiredProcess="" description="">
 <command id="389" name="turn outlet on off" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
   <if ifBlockDisabled="False" ifNot="False">
     <ifType>(A)==(B)</ifType>
     <ifParams>{2}&amp;&amp;on</ifParams>
     <then>
       <action>
         <cmdType>Scrape</cmdType>
         <cmdString>http://192.168.1.221/Set.cmd?CMD=SetPower+{1}=1&amp;&amp;admin&amp;&amp;12345678</cmdString>
         <cmdRepeat>1</cmdRepeat>
       </action>
     </then>
     <else>
       <action>
         <cmdType>Scrape</cmdType>
         <cmdString>http://192.168.1.221/Set.cmd?CMD=SetPower+{1}=1&amp;&amp;admin&amp;&amp;12345678</cmdString>
         <cmdRepeat>1</cmdRepeat>
       </action>
     </else>
   </if>
   <action>
     <cmdType>OSD.ShowText</cmdType>
     <cmdString>{LastResult}</cmdString>
     <cmdRepeat>1</cmdRepeat>
   </action>
   <phrase>turn socket</phrase>
   <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">IP power test.xml</payloadFromXML>
   <payloadList>on,off</payloadList>
 </command>
</commandGroup>


This is my code as per my last post with the attached picture.

Thank you guys very much for the help. I feel a bit silly but did try an make sure I coded right  :bonk
Also my xml phrase\value payload I just put in Value = P60 and Phrase = 1 as a test

mdsh

Hi James, I tried a purge as well as a rebuild grammer with no luck. Just looking at my code again tonight to see where I might have gone wrong

mdsh

 8) ITS SORTED GUYS!!!! Thanks again for all your help.

Suppose it was something I did wrong after all. So what I did was test my code (By the way Kalle I have both my arguments in my logic saying POWER ON at the end the =1 bit that I saw now as well and fixed) inside of the builder. So I was putting the value 1 in the payload one section and then either on or off in the payload two section of the builder. This returned the wrong values as mentioned before. But after doing a purge and then a grammer rebuild and a full restart of VC and it still not working I read that wiki link James posted more and that put me onto the TellVOX.exe. I typed my command out in this eg, turn socket {1} {2} - turn socket 1 on

This worked after all and then I went on to test it with voice and all seems fine!

Sorry for all the head scratching I might have caused you guys but thanks again for the help! I do appreciate it very much

Kalle

No problem  ;)
I insert here a group (you need also the attached payload and put it in your VC mainfolder), that will show you a second way with only one payload and it show you also how you can use a action with payload friendly {PF.1} value.

<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="False" name="test IP new" enabled="True" prefix="" priority="0" requiredProcess="" description="">
 <command id="408" name="turn outlet on off" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
   <action>
     <cmdType>Scrape</cmdType>
     <cmdString>http://192.168.1.221/Set.cmd?CMD=SetPower+{1}&amp;&amp;admin&amp;&amp;12345678</cmdString>
     <cmdRepeat>1</cmdRepeat>
   </action>
   <action>
     <cmdType>OSD.ShowText</cmdType>
     <cmdString>{PF.1}</cmdString>
     <cmdRepeat>1</cmdRepeat>
   </action>
   <action>
     <cmdType>TTS.Speak</cmdType>
     <cmdString>I turn the {PF.1}</cmdString>
     <cmdRepeat>1</cmdRepeat>
   </action>
   <phrase>turn, switch</phrase>
   <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">IP power test new.xml</payloadFromXML>
 </command>
</commandGroup>
***********  get excited and make things  **********

mdsh

Yeeessssss..... that is very clever Kalle!! Im sure I would have eventually gotten to that point!  :biglaugh

Thanks for sharing and again thanks to you guys for helping me troubleshoot!

Kalle

Also interesting for you is a map table, take a look in this video (especially after 5 min)

http://www.youtube.com/watch?v=k-kwIkmPDtI
***********  get excited and make things  **********

mdsh

Thanks Kalle, I was this video from James and started using maps but still in the mindset of using two payloads. So when I actually got to the point of creating an action I ran into a few hurdles. But yes definitely the way you posted with the P60=1 or P60=0 all in one payload makes way more sense and would work really well with the maps I think as well.

Thanks for all the help Kalle!