Author Topic: Radiosure plugin  (Read 7507 times)

0 Members and 2 Guests are viewing this topic.

MrWolf

  • $upporter
  • Sr. Member
  • *****
  • Posts: 209
  • Karma: 4
    • View Profile
Radiosure plugin
« on: December 01, 2013, 12:02:47 PM »
Oi oi,

I've been using Radiosure for listening to internet radio for a while, it's nice and loads up over the top of XBMC nicely and has some nice skins to help suit your existing media players.

There is an eventghost plugin for it that I have had some use out of for switching to favourite stations.

So why would I want to waste James' precious time making a Vox commando plugin? I hear you cry in unison.

Well, the plugin in Eventghost isn't perfect.  If I add a favourite it puts it in the list alphabetically and pushes everything under it down a slot meaning that when I say Play Kerrang radio I actually get something else because the slots have changed.

More importantly though I can't figure out how to use the "get currently playing station/title" to get it to do anything.  It may just be my lack of programming knowledge and you guys might be able to tell me how to get it to speak the {LastResult} because that command doesn't work in Eventghost as far as I can tell.

You guys have any advice?

-P
Home automation guides for idiots like me by an idiot (me)...
https://www.youtube.com/user/wolfsweb

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Radiosure plugin
« Reply #1 on: December 01, 2013, 02:00:55 PM »
I don't think I will make a plugin for it, but maybe I can help you out a bit.

I don't have any problems getting the now playing info in EventGhost using this macro:
Code: [Select]
<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1600">
    <Macro Name="Get currently playing station/title" Expanded="True">
        <Action>
            RadioSure.GetPlayingTitle()
        </Action>
        <Action>
            Speech.TextToSpeech(u'VW Bridget', 0, u'{eg.result}', 0, 100)
        </Action>
    </Macro>
</EventGhost>

Does that not work for you?

I have also create some VC commands that will allow you to automatically create a payloadXML file for your favourites and then play them by name.  You will need to modify the paths to the radio sure executable and the radio sure xml file for this to work:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="radio sure" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="169" name="play radio station {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Window.Close</cmdType>
      <cmdString>radiosure</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Launch.RawParam</cmdType>
      <cmdString>D:\radiosure\RadioSure.exe&amp;&amp;/source="{1}"</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>play radio station</phrase>
    <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">radfavs.xml</payloadFromXML>
  </command>
  <command id="229" name="update radio sure favourites" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape</cmdType>
      <cmdString>D:\radiosure\RadioSure.xml</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <cmdString>&lt;Favorites&gt;(.*?)&lt;/Favorites&gt;</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <cmdString>&lt;Source&gt;(.*?)&lt;/Source&gt;&lt;Title&gt;(.*?)&lt;/Title&gt;&amp;&amp;---&amp;&amp;{Match.1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>{LastResult}</cmdString>
      <cmdRepeat>0</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)&lt;(B)</ifType>
      <ifParams>0&amp;&amp;{#M}</ifParams>
      <then>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <cmdString>I am storing {#M} stations in your payload x m l file</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>PayloadXML.Clear</cmdType>
          <cmdString>radfavs.xml</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.MatchToEvent</cmdType>
          <cmdString>Rs.AddFav&amp;&amp;99</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.RestartQuick</cmdType>
          <cmdString />
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <cmdString>Sorry, there seems to be a problem.</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>update radio sure favourites</phrase>
  </command>
  <command id="230" name="adfav" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Results.RegEx</cmdType>
      <cmdString>(.*?)---&amp;&amp;&amp;&amp;{1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.SetVar</cmdType>
      <cmdString>val&amp;&amp;{Match.1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <cmdString>---(.*)&amp;&amp;&amp;&amp;{1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>PayloadXML.AddPair</cmdType>
      <cmdString>radfavs.xml&amp;&amp;{Var.val}&amp;&amp;{Match.1}&amp;&amp;True</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>{Match.1}</cmdString>
      <cmdRepeat>0</cmdRepeat>
    </action>
    <event>Rs.AddFav</event>
  </command>
</commandGroup>

MrWolf

  • $upporter
  • Sr. Member
  • *****
  • Posts: 209
  • Karma: 4
    • View Profile
Re: Radiosure plugin
« Reply #2 on: December 05, 2013, 07:19:44 AM »
Sorry for the excessively delayed reply.

The first works great thanks!  :hugs  I just didn't know the code to get last result for Eventghost it would seem.

The second bit doesn't seem to work for me.      When I run "Update radiosure favourites Alexander tells me "Sorry, there seems to be a problem".  Looking at the radfavs.xml file it contains nothing but {Match.1} in value and phrase, so I'm guessing something is missing.

Attached is a screenshot of the Vox log, not sure if it helps.

I updated the code for my folder locations etc and it looks like this...

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="radio sure" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="169" name="play radio station {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Window.Close</cmdType>
      <cmdString>radiosure</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Launch.RawParam</cmdType>
      <cmdString>C:\Users\Chloe\AppData\Local\RadioSure\RadioSure.exe&amp;&amp;/source="{1}"</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>play radio station</phrase>
    <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">radfavs.xml</payloadFromXML>
  </command>
  <command id="229" name="update radio sure favourites" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape</cmdType>
      <cmdString>C:\Users\Chloe\AppData\Local\RadioSure\RadioSure.xml</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <cmdString>&lt;Favorites&gt;(.*?)&lt;/Favorites&gt;</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <cmdString>&lt;Source&gt;(.*?)&lt;/Source&gt;&lt;Title&gt;(.*?)&lt;/Title&gt;&amp;&amp;---&amp;&amp;{Match.1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>{LastResult}</cmdString>
      <cmdRepeat>0</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)&lt;(B)</ifType>
      <ifParams>0&amp;&amp;{#M}</ifParams>
      <then>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <cmdString>I am storing {#M} stations in your payload x m l file</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>PayloadXML.Clear</cmdType>
          <cmdString>radfavs.xml</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.MatchToEvent</cmdType>
          <cmdString>Rs.AddFav&amp;&amp;99</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.RestartQuick</cmdType>
          <cmdString />
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <cmdString>Sorry, there seems to be a problem.</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>update radio sure favourites</phrase>
  </command>
  <command id="230" name="adfav" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Results.RegEx</cmdType>
      <cmdString>(.*?)---&amp;&amp;&amp;&amp;{1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.SetVar</cmdType>
      <cmdString>val&amp;&amp;{Match.1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <cmdString>---(.*)&amp;&amp;&amp;&amp;{1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>PayloadXML.AddPair</cmdType>
      <cmdString>radfavs.xml&amp;&amp;{Var.val}&amp;&amp;{Match.1}&amp;&amp;True</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>{Match.1}</cmdString>
      <cmdRepeat>0</cmdRepeat>
    </action>
    <event>Rs.AddFav</event>
  </command>
</commandGroup>

Thanks,

-P
Home automation guides for idiots like me by an idiot (me)...
https://www.youtube.com/user/wolfsweb

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Radiosure plugin
« Reply #3 on: December 06, 2013, 09:59:03 AM »
Hmm. Perplexing.

I did try your code and it's working fine for me. Could you try again with logging enabled, and then attach your voxLog.txt file and also your RadioSure.xml file? Maybe they'll provide some more useful clues.
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)

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Radiosure plugin
« Reply #4 on: December 26, 2013, 08:50:43 AM »
Mr. Volfie...

Are you using an old version of VC?

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Radiosure plugin
« Reply #5 on: January 06, 2014, 01:59:20 PM »
Are you using an old version of VC?

For the sake of other users, if not Mr. Wolf, I'll just clarify that for the above "update Radio Sure favourites" command to work properly you will need VC Version 1.1.50 or later because one of the regex actions uses multiple pattern matching, which was introduced in that version.
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)

MrWolf

  • $upporter
  • Sr. Member
  • *****
  • Posts: 209
  • Karma: 4
    • View Profile
Re: Radiosure plugin
« Reply #6 on: January 18, 2014, 01:33:49 PM »
Right, Another very long delay on my part, so apologies for being such an ignoramus.

I updated and your code works great.  I have only one issue now, and that is if I update the favourites it over-writes the phrase I set in my XML file.

i.e. if I create a phrase to play Kerrang radio which I simply put in as "Kerrang" when I update the favourites list it revert back to "Kerrang - [UK only]", which obviously I won;t remember to say when asking Alexander to "Launch Kerrang".

Probably a huge ask, but is it possible to make it so the script doesn't over-write the phrase part of the XML?

-P
Home automation guides for idiots like me by an idiot (me)...
https://www.youtube.com/user/wolfsweb

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Radiosure plugin
« Reply #7 on: January 18, 2014, 02:15:16 PM »
Can't you change the names to voice friendly ones in Radiosure?  Sorry, it has been so long and I've since uninstalled and forgotten everything about Radiosure.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Radiosure plugin
« Reply #8 on: January 18, 2014, 02:43:09 PM »
If you are using subset-matching then you could still just say "Kerrang"

An alternative to the method I use above would be to use maps.

http://voxcommando.com/mediawiki/index.php?title=Actions#Set

The 4th parameter of Map.Set allows you to set the options to "overwrite" to false, so it won't overwrite values if the key already exists in the map.

If you wanted to use this method, you would need to then manually export your map to a payloadXML file.  Also you would need to manually delete any playlists that you wanted to get rid of.

It is up to you to decide which would be more work, but if you can just rename it in Radiosure that would be best.

Another option would be to modify the command that adds to the payloadXML file and scan the file to see if the key already exists.  But it would be a kind of clunky way to do it, and kind of slow if you have a long list.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Radiosure plugin
« Reply #9 on: January 18, 2014, 02:56:22 PM »
If you want to try it this is the "clunky" way.  It should work fine except that I no longer have Radiosure so I can't test it.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="radio sure" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="169" name="play radio station {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Window.Close</cmdType>
      <cmdString>radiosure</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Launch.RawParam</cmdType>
      <cmdString>D:\radiosure\RadioSure.exe&amp;&amp;/source="{1}"</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>play radio station</phrase>
    <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">radfavs.xml</payloadFromXML>
  </command>
  <command id="229" name="update radio sure favourites" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape</cmdType>
      <cmdString>D:\radiosure\RadioSure.xml</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <cmdString>&lt;Favorites&gt;(.*?)&lt;/Favorites&gt;</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <cmdString>&lt;Source&gt;(.*?)&lt;/Source&gt;&lt;Title&gt;(.*?)&lt;/Title&gt;&amp;&amp;---&amp;&amp;{Match.1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <cmdString>{LastResult}</cmdString>
      <cmdRepeat>0</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)&lt;(B)</ifType>
      <ifParams>0&amp;&amp;{#M}</ifParams>
      <then>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <cmdString>I am storing {#M} stations in your payload x m l file</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <cmdString>I am storing {#M} stations in your payload x m l file</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>PayloadXML.Clear</cmdType>
          <cmdString>radfavs.xml</cmdString>
          <cmdRepeat>0</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.MatchToEvent</cmdType>
          <cmdString>Rs.AddFav&amp;&amp;99</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.RestartQuick</cmdType>
          <cmdString />
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <cmdString>Sorry, there seems to be a problem.</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>update radio sure favourites</phrase>
  </command>
  <command id="230" name="adfav" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Results.RegEx</cmdType>
      <cmdString>(.*?)---&amp;&amp;&amp;&amp;{1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.SetVar</cmdType>
      <cmdString>val&amp;&amp;{Match.1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <cmdString>---(.*)&amp;&amp;&amp;&amp;{1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.SetVar</cmdType>
      <cmdString>name&amp;&amp;{Match.1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>PayloadXML.GetPhrase</cmdType>
      <cmdString>radfavs.xml&amp;&amp;{Var.val}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>LastActionSuccess</ifType>
      <ifParams>&amp;&amp;</ifParams>
      <then>
        <action>
          <cmdType>OSD.AddText</cmdType>
          <cmdString>{Var.val} already exists</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>OSD.AddText</cmdType>
          <cmdString>Creating entry for: {Var.val}</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>PayloadXML.AddPair</cmdType>
          <cmdString>radfavs.xml&amp;&amp;{Var.val}&amp;&amp;{Var.name}&amp;&amp;True</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <event>Rs.AddFav</event>
  </command>
</commandGroup>

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Radiosure plugin
« Reply #10 on: January 18, 2014, 04:07:21 PM »
I've tested jitterjames's xml and, unsurprisingly, it works perfectly.  ;D

Still, since I didn't know he was on the case, I also whipped up a solution earlier this afternoon. It is slightly different than The Voxmeister's but accomplishes the same thing. We're both comparing newly captured radio favourites with those that already exist in the payloadXML file, and then adding only those entries that can't be found in the existing list. That way, if you've manually changed a phrase in the exisiting payloadXML file it won't get overwritten.

I decided to post my XML as well, in case any VC users (particularly new users) are interested in comparing the different ways that the same things can be accomplished in VC. Obviously, some ways are better than others.  :biglaugh

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="radio sure-v. nime5ter" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="169" name="play radio station {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Window.Close</cmdType>
      <cmdString>radiosure</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Launch.RawParam</cmdType>
      <cmdString>[yourcorrectfilpath]\RadioSure.exe&amp;&amp;/source="{1}"</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>play radio station</phrase>
    <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">radfavs.xml</payloadFromXML>
  </command>
  <command id="229" name="update radio sure favourites" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Scrape</cmdType>
      <cmdString>C:\Users\[yourUserName]\AppData\Local\RadioSure\RadioSure.xml</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <cmdString>&lt;Favorites&gt;(.*?)&lt;/Favorites&gt;</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <cmdString>&lt;Source&gt;(.*?)&lt;/Source&gt;&lt;Title&gt;(.*?)&lt;/Title&gt;&amp;&amp;---&amp;&amp;{Match.1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)&lt;(B)</ifType>
      <ifParams>0&amp;&amp;{#M}</ifParams>
      <then>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <cmdString>Adding new stations. There will be a total of {#M} stations in your payload x m l file.</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>Results.MatchToEvent</cmdType>
          <cmdString>Rs.AddFave&amp;&amp;99</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.RestartQuick</cmdType>
          <cmdString />
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <cmdString>Sorry, there seems to be a problem.</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>update radio sure favourites</phrase>
  </command>
  <command id="230" name="add new favourite" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Results.RegEx</cmdType>
      <cmdString>(.*?)---&amp;&amp;&amp;&amp;{1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.SetVar</cmdType>
      <cmdString>value&amp;&amp;{Match.1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <cmdString>---(.*)&amp;&amp;&amp;&amp;{1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>File.Read</cmdType>
      <cmdString>radfavs.xml</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>(A)Contains(B)</ifType>
      <ifParams>{LastResult}&amp;&amp;{Var.value}</ifParams>
      <then>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <cmdString>{Match.1} is already in your payloadXML</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <cmdString>Adding {Match.1} to your payloadXML</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>PayloadXML.AddPair</cmdType>
          <cmdString>radfavs.xml&amp;&amp;{Var.value}&amp;&amp;{Match.1}&amp;&amp;True</cmdString>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <event>Rs.AddFave</event>
  </command>
</commandGroup>
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)

MrWolf

  • $upporter
  • Sr. Member
  • *****
  • Posts: 209
  • Karma: 4
    • View Profile
Re: Radiosure plugin
« Reply #11 on: February 10, 2014, 05:52:17 PM »
Yep, you guys nailed it as always.  Thanks again!

-P

xxx
Home automation guides for idiots like me by an idiot (me)...
https://www.youtube.com/user/wolfsweb