Author Topic: Help on Payloads  (Read 2919 times)

0 Members and 1 Guest are viewing this topic.

stig125

  • Jr. Member
  • **
  • Posts: 20
  • Karma: 0
    • View Profile
Help on Payloads
« on: February 02, 2017, 07:50:15 AM »
I am currently integrating RAKO lighting into being voice controlled. I am fine with getting the lights to work by using a launchCMD and issuing a wGet "Rakobridge/rako.cgi?room=5&com=3" which would light the lounge with scene 1.

what I would like to do is have the following for example

Lounge sc 1 "Rakobridge/rako.cgi?room=5&com=3" - make the lounge cosy
Lounge sc 2 "Rakobridge/rako.cgi?room=5&com=4" - make the lounge darker
Lounge sc 3 "Rakobridge/rako.cgi?room=5&com=5" - make the lounge brighter

Dining  sc1  "Rakobridge/rako.cgi?room=6&com=3"    as above etc for all rooms
Dining  sc2  "Rakobridge/rako.cgi?room=6&com=4"
etc.. etc

then depending on the voice command issued the action would be a wGet with the appropriate text for that room and scene. would this be a payload sort of thing? and if so, can you issue a LanchCMD with just wGet {1}, wGet{2} etc

Or.. is this best achieved another way? mapping?

Thanks to anyone reading this
Wal







nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Help on Payloads
« Reply #1 on: February 02, 2017, 08:53:37 AM »
Payload XML makes sense. There are various ways you could organize it. The simplest would be to associate the full file path value to each full phrase (minus "make the").

Another option would be to create 2 payload XML files, one mapping room name phrases to their number values, and the other mapping light level phrases to their numerical values. I would probably go with the second option, as that permits more flexibility with phrasing, and if there are other things you can do with the room values then you can re-use that payload file in other commands.

In this case, I would probably leave the file path hard coded in the action (the launch action, or a scrape action if that works with your system): Rakobridge/rako.cgi?room={1}&com={2}

It does seem as though a Scrape action should work, though, so you might want to test using that instead of wget if you haven't yet.
« Last Edit: February 02, 2017, 08:58:13 AM 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)

stig125

  • Jr. Member
  • **
  • Posts: 20
  • Karma: 0
    • View Profile
Re: Help on Payloads
« Reply #2 on: February 02, 2017, 10:36:53 AM »
Hey.. thanks so much for the reply and the information.
It's difficult starting out with VC as you kind of know what you want, but not a way to achieve it that is quick, scalable and easy.

Getting the lounge lights to come on at all was a great step forwards for me, but it just leads to the inevitable.. 'is there a better way to do this'...lol

I can test these methods as soon as I get home.

Once again, thanks so much for your help

Wal

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Help on Payloads
« Reply #3 on: February 02, 2017, 11:04:22 AM »
Maybe it would be helpful conceptually to look at how commands are structured in the default Vera Home Automation configuration.

You could run a new instance of VC with that config just to browse the command tree and poke around. This may be simplest.

Or, since the Command  Tree Editor permits you to open multiple windows, you could temporarily unzip the Vera HA config file (Your VC folder\Resources\configs\English\Vera HA.zip) on your desktop or whatnot, and then open its voicecommands.xml file in your editor.

... You can also view the ShowHelp html page for that config via our wiki: http://voxcommando.com/mediawiki/index.php?title=Default_VoxCommando_Configurations

Anything in {curly brackets} is a payload. But you can't see from that which of the payloads rely on payload XML versus a payload list or range.
« Last Edit: February 02, 2017, 11:07:33 AM 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)