Author Topic: IP Power 9258  (Read 5921 times)

0 Members and 1 Guest are viewing this topic.

mdsh

  • $upporter
  • Sr. Member
  • *****
  • Posts: 127
  • Karma: 4
    • View Profile
Re: IP Power 9258
« Reply #15 on: September 10, 2013, 04:38:23 AM »
Hi Kalle, hope I did this right.

Code: [Select]
<?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
« Last Edit: September 10, 2013, 04:41:10 AM by mdsh »

mdsh

  • $upporter
  • Sr. Member
  • *****
  • Posts: 127
  • Karma: 4
    • View Profile
Re: IP Power 9258
« Reply #16 on: September 10, 2013, 04:39:40 AM »
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

  • $upporter
  • Sr. Member
  • *****
  • Posts: 127
  • Karma: 4
    • View Profile
Re: IP Power 9258
« Reply #17 on: September 10, 2013, 05:11:11 AM »
 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

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: IP Power 9258
« Reply #18 on: September 10, 2013, 06:30:16 AM »
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.

Code: [Select]
<?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

  • $upporter
  • Sr. Member
  • *****
  • Posts: 127
  • Karma: 4
    • View Profile
Re: IP Power 9258
« Reply #19 on: September 10, 2013, 06:39:06 AM »
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

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: IP Power 9258
« Reply #20 on: September 10, 2013, 07:27:06 AM »
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

  • $upporter
  • Sr. Member
  • *****
  • Posts: 127
  • Karma: 4
    • View Profile
Re: IP Power 9258
« Reply #21 on: September 11, 2013, 02:01:36 AM »
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!