Hey, if it works, it works.
Sometimes, keyboard emulation is the only way.
Ideally, the Pandora addon should allow us to pass it a parameter when we call it, but you would have to ask the developer of the addon about that. As far as we can tell, this addon doesn't accept any parameters, but who knows.
I did figure out another way, also hackish, but it works. James noticed that the addon has a setting where you can get it to automatically load the last station you played on launch. If you select it, then that station's ID is stored in the addon's user settings file.
It would be nice if we could adjust that setting using a json method, but nothing is jumping out in the documentation. However, I was able to create a command that changes the station by overwriting that settings.xml file, replacing the old station ID with a new one. Hackish, but it worked on my tests. Not sure how robust a solution it is.
A bigger problem, however, is getting the station IDs for all of your stations. Those IDs are the same numbers that you see when you're logged in on the Pandora website and choose one of your stations. If there is a Pandora page that lists all of your stations on one page, in theory you could scrape that to get all the IDs. I don't know much about the service, as I don't use it.
There's no obvious way to get that level of data from XBMC either. (I'm not saying it's impossible -- maybe on the XBMC forum can help you with that.)
But if you want to create your payload XML list manually (or at least create a small payloadXML file with a few of your favourite Pandora stations), here's the command that I used to change between my two stations. It requires an understanding of payloads that you mention you don't yet have.
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.0.0.3-->
<command id="471" name="play Pandora station" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>XJson.Raw</cmdType>
<params>
<param>Addons.ExecuteAddon</param>
<param>"addonid":"script.audio.pandora"</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>File.Read</cmdType>
<params>
<param>C:\Users\[your user name]\AppData\Roaming\XBMC\userdata\addon_data\script.audio.pandora\settings.xml</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>Results.RegExReplace</cmdType>
<params>
<param>"last_station_id".value="\d*"</param>
<param>"last_station_id" value="{1}"</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>File.Write</cmdType>
<params>
<param>C:\Users\[your user name]\AppData\Roaming\XBMC\userdata\addon_data\script.audio.pandora\settings.xml</param>
<param>{LastResult}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>play pandora station</phrase>
<payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">XbmcPayloads\pandora.xml</payloadFromXML>
</command>
You will need to:
1. Edit the file path to your own user path in the command. (In 2 of the command actions -- File.Read, and File.Write)
2. Enable the addon setting to "launch last station played" or whatever it says, in XBMC.
3. Create your own Pandora.xml payload xml file. That's the file that associates your radio station names with the IDs that XBMC needs in order to select the right station.
Start by copying and pasting my command into your tree. Save your tree, exit the command tree editor and then go back in ("Edit"). You'll get a message saying you're missing the payload xml file "pandora.xml". The command will be there, but the pandora.xml payload line will be red.
Double-click the red line, click "new/edit", and start creating your payload xml file. The radio station IDs are the "value", the radio station names or whatever are the "phrase". If you want to have different ways of asking for the same station, put commas between your phrases.
More on payloads:
Payloads:
http://voxcommando.com/mediawiki/index.php?title=PayloadsLast section of:
http://voxcommando.com/mediawiki/index.php?title=Logical_Command_Builder