Author Topic: Really easy one  (Read 3452 times)

0 Members and 1 Guest are viewing this topic.

Casmo

  • $upporter
  • Contributor
  • *****
  • Posts: 85
  • Karma: 0
    • View Profile
Really easy one
« on: June 13, 2014, 04:36:51 PM »
I've tried, really I have but I can't seem to see the wood for the trees.. All I want to do is create an action that plays a specific song. All the play song commands I've looked at involve variables and payloads, I can't seem to strip it back without messing up the syntax.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Really easy one
« Reply #1 on: June 13, 2014, 04:51:13 PM »
You'll need to look up the song ID value for the song that you want to play. You can look it up in the xbmcSongs payload xml file, if you like.

Clone your "Play song {1}" command in your command tree.

In the new clone, revise the command name and phrase to say whatever you want (e.g. "Play my one very special song. You know the one.")

Obviously, you don't need the payload xml file or anything like that if you have one specific song that you want it to play, as the payload xml allows us to use one command to ask for multiple, similar things.

In the macro, replace the payload reference {1} with the id of the specific song that you want XBMC to play.

That should be it, depending on your ultimate goal.
« Last Edit: June 13, 2014, 05:37:30 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)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Really easy one
« Reply #2 on: June 13, 2014, 05:15:51 PM »
If you want, you can also get rid of all the actions except the Player.Open action.

You'll just need to replace the playlist item in the Player.Open action with your songid item.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 1.9.5.5-->
<command id="487" name="Play special song" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>XJson.Raw</cmdType>
    <params>
      <param>Player.Open</param>
      <param>"item": {"songid": yoursongidvaluegoeshere}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Play my special song</phrase>
</command>

As I say, it's a question of the ultimate goal. But if you do the first step described in my previous post, it's easier to then compare the syntax between lines and begin eliminating extra bits.
« Last Edit: June 13, 2014, 05:19:14 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)

Casmo

  • $upporter
  • Contributor
  • *****
  • Posts: 85
  • Karma: 0
    • View Profile
Re: Really easy one
« Reply #3 on: June 13, 2014, 05:27:28 PM »
Excellent, thank a lot. Will give it a go just as soon as she relinquishes control of the tv...

Casmo

  • $upporter
  • Contributor
  • *****
  • Posts: 85
  • Karma: 0
    • View Profile
Re: Really easy one
« Reply #4 on: June 13, 2014, 06:16:58 PM »
Excellent. Now by just saying "giggity" or "business time", the lights turn red and purple, dim and Barry Whites 'Im  Gonna love you just a little more, baby' starts playing.. Oh how I love voxcommando

SuperKronz

  • $upporter
  • Jr. Member
  • *****
  • Posts: 22
  • Karma: 4
    • View Profile
Re: Really easy one
« Reply #5 on: June 13, 2014, 07:06:46 PM »
 >:D W00T! >:D

Casmo

  • $upporter
  • Contributor
  • *****
  • Posts: 85
  • Karma: 0
    • View Profile
Re: Really easy one
« Reply #6 on: June 13, 2014, 07:55:25 PM »
It's more of a presentation piece, let's be honest. As expected, my wife laughed uncontrollably, called me an idiot and went to bed... Ah home automation.

Thanks again nime!

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Really easy one
« Reply #7 on: June 13, 2014, 08:30:06 PM »
Excellent. Now by just saying "giggity" or "business time", the lights turn red and purple, dim and Barry Whites 'Im  Gonna love you just a little more, baby' starts playing.. Oh how I love voxcommando

Conditions are perfect!

&feature=kp