Author Topic: IP Power 9258  (Read 5924 times)

0 Members and 1 Guest are viewing this topic.

mdsh

  • $upporter
  • Sr. Member
  • *****
  • Posts: 127
  • Karma: 4
    • View Profile
IP Power 9258
« on: September 07, 2013, 01:23:53 AM »
Just incase someone has an IP Power 9258 from (now) Aviosys. Here are the on\off commands for the outlets. Nothing fancy but will save someone some time  :P

mdsh

  • $upporter
  • Sr. Member
  • *****
  • Posts: 127
  • Karma: 4
    • View Profile
Re: IP Power 9258
« Reply #1 on: September 07, 2013, 01:36:06 AM »
also just incase you can remember your IP of you device... like me from time to time this is handy

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: IP Power 9258
« Reply #2 on: September 07, 2013, 11:36:59 AM »
thanks!  :D

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: IP Power 9258
« Reply #3 on: September 07, 2013, 02:28:55 PM »
also just incase you can remember your IP of you device... like me from time to time this is handy

can't ?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: IP Power 9258
« Reply #4 on: September 07, 2013, 03:49:31 PM »
Just in case you find it useful, (or educational) here is a single command to turn any unit on, or off

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="416" name="Turn unit {1} {2}" 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+P6{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+P6{1}=0&amp;&amp;admin&amp;&amp;12345678</cmdString>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <phrase>turn unit</phrase>
  <payloadRange>1,6</payloadRange>
  <payloadList>on, off</payloadList>
</command>

I can't test it, so I hope I didn't make a mistake!

mdsh

  • $upporter
  • Sr. Member
  • *****
  • Posts: 127
  • Karma: 4
    • View Profile
Re: IP Power 9258
« Reply #5 on: September 08, 2013, 01:48:40 AM »
Quote
can't ?
yup sorry meant to read. If you CAN'T remember your IP  ::zzz
Thanks


On the code front thank you very much. Worked like a charm! Just the only thing that gets you is that out of normal habit it might not work. with the unit starting it's numbering P60 = oulet 1 and P61 = outlet 2 etc you out of habit will say "turn unit 1 on" and this will in turn do P61 and power on port 2. Guess I could give each outlet a name P60 = lamps P61 = TV or something to counter this perhaps.

Think I might actually try this now :)

Thanks for the code James. Got me thinking about some other things now  ;D I Love vox!! how did we ever do things without it

mdsh

  • $upporter
  • Sr. Member
  • *****
  • Posts: 127
  • Karma: 4
    • View Profile
Re: IP Power 9258
« Reply #6 on: September 08, 2013, 02:15:23 AM »
Ok... am I just thinking about things wrong here. I created an action [attachment=1] similar to the one James uploaded. Just with a PHRASE ONLY xml payload [attachment=2]. In this payload (attached) I set P60 as lamps and P61 as TV. Within my action I am using it as payload one and the on, off payload is stil my value 2

The actual IP Power device makes its beeps as it normally does when receiving code but doesnt switch on or off. Just stays in its current state.

Is the the best way to approach this or is there perhaps another route I should take with this perhaps?

mdsh

  • $upporter
  • Sr. Member
  • *****
  • Posts: 127
  • Karma: 4
    • View Profile
Re: IP Power 9258
« Reply #7 on: September 08, 2013, 02:29:20 AM »
at least I know more now :)

Did a test with OSD in my action and it does return - <htrml>HTTPCMD_BADPARRAM<html>  :biglaugh
and so the hunt begins to see where I went wrong

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: IP Power 9258
« Reply #8 on: September 08, 2013, 10:01:37 AM »
Take a look in the history window at the scrape action to see what url is actually being sent after substituting the payloads.  This will give you a hint of what you did wrong...

You should be using a phrase/value payload xml.  You are using phrase only so your scrape action is using the name of the device instead of P60, P61 etc.

mdsh

  • $upporter
  • Sr. Member
  • *****
  • Posts: 127
  • Karma: 4
    • View Profile
Re: IP Power 9258
« Reply #9 on: September 09, 2013, 01:27:43 AM »
Thanks James, I will give this a go tonight once I get home. Was thinking it might be something small  ;)

PS love the new profile pic!!

mdsh

  • $upporter
  • Sr. Member
  • *****
  • Posts: 127
  • Karma: 4
    • View Profile
Re: IP Power 9258
« Reply #10 on: September 09, 2013, 05:43:41 AM »
You were right James. Looking at the history it does print LAMPS instead of P60 as eg.

Quickly building a new action... Lets hope  :P

mdsh

  • $upporter
  • Sr. Member
  • *****
  • Posts: 127
  • Karma: 4
    • View Profile
Re: IP Power 9258
« Reply #11 on: September 09, 2013, 06:36:24 AM »
So still no luck... But in the interest of me troubleshooting I just want to confirm that I am approaching this right.

In the attached image am I right in thinking IP power test.xml would be PAYLOAD {1} and the on,off payload is {2} (#2 works just fine). So the xml is configured as Value: P60 and the Phrase is lamps but the history still shows lamps instead of P60 for the URL in the action http://192.168.1.221/Set.cmd?CMD=SetPower+{1}=1

Thanks in advance for any help and for all the help thus far.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: IP Power 9258
« Reply #12 on: September 09, 2013, 08:25:18 AM »
Hi mdsh, can you post the code from your command? So I can also take a look on it.
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: IP Power 9258
« Reply #13 on: September 09, 2013, 08:46:29 AM »
Maybe just need to save and close the editor to apply changes?

You could use "purge cache" and then "build missing grammars".

http://voxcommando.com/mediawiki/index.php?title=Main_Menu#Purge_Cache

I need to look into this.  It might be a bug where VC doesn't recognise that the group needs updating after changing only the payload XML type.
« Last Edit: September 09, 2013, 08:54:29 AM by nime5ter »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: IP Power 9258
« Reply #14 on: September 09, 2013, 06:45:52 PM »
I need to look into this.  It might be a bug where VC doesn't recognise that the group needs updating after changing only the payload XML type.

It's OK.  I checked, and it seems to update automatically, as it should.

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!