Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - nime5ter

Pages: [1] 2 3 ... 8
1
VoxCommando Basics and Core Features / MOVED: Need help
« on: December 26, 2017, 08:42:05 AM »

2
XML Exchange / Prepare for upcoming snowstorms
« on: March 24, 2017, 11:51:07 AM »
In his recent VoxWear (VoxWav for Android Wear 2.0) video, James demonstrates one of our new favourite commands: "Check snow cast."

I came up with this command a few months ago and it turns out to be very handy. I realise it's a bit silly to post a winter command when for most of you it's already springtime (or perhaps fall, if you're in the other hemisphere).

I thought I'd post it because it's a simple, fun command concept that can be adapted to other scenarios.

Where we live, it's helpful to monitor snow conditions a few days in advance. We periodically lose power during bad weather. Depending on how much snow is expected, we need to prepare for snow clearing, make sure we have firewood, charged batteries, candles, fresh water supplies etc.

This command, of course, uses the Weather Underground plugin. It also uses the Python plugin to add up some numbers. I retrieve the expected snowfall values for the next three days, add them up. If the amount is greater than zero, the command tells me what's in the cards. Otherwise, Vox gives us the "all clear".

The command could be triggered by an event to run automatically on a schedule. We just use a voice command.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.3.5-->
<command id="62" name="Check snow cast" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>WUnder.GetCustom</cmdType>
    <params>
      <param>{D0.snow_allday}+{D1.snow_allday}+{D2.snow_allday}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>PY.ExecString</cmdType>
    <params>
      <param>result = {LastResult}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)&lt;(B)</ifType>
    <ifParams>0&amp;&amp;{LastResult}</ifParams>
    <then>
      <action>
        <cmdType>WUnder.GetCustom</cmdType>
        <params>
          <param>{D0.snow_allday} cm of snow expected today, {D1.snow_allday} cm expected tomorrow, and {D2.snow_allday} on {D2.weekday}.</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>Looks like there's snow in the forecast. </param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>{LastResult}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>OSD.ShowText</cmdType>
        <params>
          <param>{LastResult}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>No snow is expected in the next few days.</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <phrase>Check snow cast</phrase>
</command>




3
We're offering a "March Madness" promotion.

The new VoxWav Pro version 2.8.1 is on sale at the Google Play store for $1 Canadian (0.75 US, 0.70 Euros) for the rest of the week: March 12 to 19.

By popular demand, the new version includes 2 homescreen widgets. No need to open the app anymore -- just tap on the microphone from your homescreen to send voice commands to VoxCommando.

VoxWav Pro 2.8.1. now also accepts broadcast intents from other apps like Tasker. Watch the video for more info.



Note that if you already had VoxWav Pro installed, there are a couple VW settings you should double-check to use the widgets most effectively. These are explained in the video.

Happy spring, everybody.

[Apologies, I originally made a mistake regarding the dates of the promotion. The correct dates are March 12 to March 19.]

4
XML Exchange / Get movie soundtrack info (a Kodi + Tunefind solution)
« on: December 11, 2016, 02:43:58 PM »
For Kodi users, assuming your Kodi events are working properly in VC, the following command group retrieves movie soundtrack information from Tunefind -- no API key needed.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.3.0-->
<commandGroup open="True" name="Tunefind movie scrape (no API key needed)" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="493" name="store now playing movie info" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="This command should execute automatically when you start watching a movie in Kodi.">
    <action>
      <cmdType>XJson.Raw</cmdType>
      <params>
        <param>Player.GetItem</param>
        <param>"playerid":1,  "properties": ["title","year"]</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>XJson.ParseTokens</cmdType>
      <params>
        <param>{item.title}-{item.year}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.SetVar</cmdType>
      <params>
        <param>movieinfo</param>
        <param>http://www.tunefind.com/movie/{LastResult}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <params>
        <param>^(.*?)-\d{4}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.SetVar</cmdType>
      <params>
        <param>movietitle</param>
        <param>{Match.1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>OSD.ShowText</cmdType>
      <params>
        <param>{LastResult}</param>
      </params>
      <cmdRepeat>0</cmdRepeat>
    </action>
    <event>XBMC.Player.OnPlay.movie</event>
    <event>Kodi.Player.OnPlay.movie</event>
  </command>
  <command id="84" name="Tell me about this movie soundtrack" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>One moment please</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Scrape</cmdType>
      <params>
        <param>{var.movieinfo}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Tools.Decode.HTML</cmdType>
      <params />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Results.RegEx</cmdType>
      <params>
        <param>class="SongTitle.*?&gt;(.*?)&lt;/a&gt;.*?href="/artist/.*?"&gt;(.*?)&lt;/</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <if ifBlockDisabled="False" ifNot="False">
      <ifType>LastActionSuccess</ifType>
      <ifParams>&amp;&amp;</ifParams>
      <then>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <params>
            <param>Tunefind lists {#M} songs on the {var.movietitle} soundtrack:</param>
            <param>10000</param>
            <param>-5</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>OSD.AddText</cmdType>
          <params>
            <param>{i}. "{Match.{i}.1}", by {Match.{i}.2}</param>
          </params>
          <cmdRepeat>15</cmdRepeat>
        </action>
        <action>
          <cmdType>TTS.SpeakSync</cmdType>
          <params>
            <param>Tune find lists {#M} songs on this soundtrack</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>Would you like to open Tune find?</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>VC.TriggerEvent</cmdType>
          <params>
            <param>tunefind</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </then>
      <else>
        <action>
          <cmdType>TTS.Speak</cmdType>
          <params>
            <param>I'm sorry, I couldn't find soundtrack information for {var.movietitle} on Tune find.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
        <action>
          <cmdType>OSD.ShowText</cmdType>
          <params>
            <param>Attempt to open this page failed.</param>
          </params>
          <cmdRepeat>1</cmdRepeat>
        </action>
      </else>
    </if>
    <phrase>Tell me about this movie soundtrack</phrase>
  </command>
  <command id="485" name="show me the movie soundtrack (in Tunefind)" enabled="true" alwaysOn="False" confirm="True" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TTS.Speak</cmdType>
      <params>
        <param>OK. Launching Tune Find</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Launch.OpenURL</cmdType>
      <params>
        <param>{var.movieinfo}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>show me the movie soundtrack</phrase>
    <event>tunefind</event>
  </command>
</commandGroup>

When you start playing a movie in Kodi, VC stores the information needed to scrape soundtrack data from the Tunefind website in 2 variables. (So, if you then watch a different movie, these variables will be overwritten.)

Then at any time you can say, "Tell me about this movie soundtrack" and it will try to find that information on Tunefind.

Of course, you can change the wording of the voice command if you like.

If successful, it will let you know what it found, and also ask if you want to open the Tunefind website. Otherwise it tells you that it couldn't retrieve soundtrack info from Tunefind.


5
XML Exchange / Find song info for TV shows
« on: November 04, 2016, 12:19:51 PM »
TUNEFIND NO LONGER OFFERS A FREE API.
The minimum plan starts at $25/month.

Now that TV shows are often creative with their soundtracks, we keep wondering what songs (or artists) are playing while watching TV.

I just discovered TuneFind, which has an API we can use in VC. The standard API is free, though it seems to have a few limitations.

I've been testing it out by grabbing show info from Kodi when an episode is playing, and then passing it to Tunefind to get episode soundtrack data (using our trusty Scrape and Regex actions).

The data is crowd-sourced. The site seems quite good for U.S. shows and possibly UK TV, but my test of our non-English-language TV shows suggests it's probably not great for global content.

If anyone is interested, let me know and I'll post some details about how I've implemented it. As always, there are different ways one could approach it.

There are a number of steps, so I don't want to spend half an hour posting an explanation unless it's wortwhile to others. :biglaugh (I live and learn!)

cheers.


6
Hi all,

Some of you may have noticed James's new forum signature (hopefully temporary).

Gmail relies heavily on crowd-sourced information to develop its spam rules. We are having difficulty keeping track of new user posts on the forum — and you may find that you are not receiving notification of replies to your posts — because recently Google has started flagging emails from the VC forum as spam.

This probably means that many of you are telling Google that VC forum messages are spam. Please don't do that.

Google does not allow us to add our website to a whitelist, so the only hope of resolving the problem is a collective response.

Of course, if you don't use gmail, this post doesn't pertain to you.


You have control over the notifications that you receive from the forum.

1. The general notification rules can be changed within your forum profile settings.  [screenshot attached]

2. When you view a specific thread or board on the forum you will see "unnotify" or "notify" buttons that you can also use to change your topical notifications.

3. When you post a message in a thread, if you click on "Attachments and other options" there is a checkbox to control whether you receive notifications of thread-level replies.

4. Every time you receive an email notification, the email message contains a link that makes it easy for you to unsubscribe from that particular thread.

Please use these features for managing notifications, as everyone's behaviour when using Google products impacts everyone else's experience.

Together, hopefully we can fix this problem. Thanks!

Naomi

7
A Russian user reports the following problem. If any Russian users (or people who have experienced this problem with W10) have a solution for him, please reply. We cannot re-create the problem.

 VoxCommando 2 на win 10 Версия 1607 (Сборка ОС 14393.51) 64bit не работает.
Ставил:
1. SpeechPlatformRuntime.msi (x86)
2. MSSpeech_SR_ru-RU_TELE.msi
3. MSSpeech_TTS_ru-RU_Elena.msi
После установки VC Setup 2.221.exe появляется сообщение, что нет голосового движка и отправляет на сайт с битыми ссылками. Провозился с этой прогой час, раза три переустанавливал по разным путям, чистил реестр, читал, мучил, устал.
Если что-то посоветуете кроме отката на win 7 буду признателен.

8
Tips and Tricks / MOVED: Re: Learning Arabic with Voxcommando
« on: April 26, 2016, 08:05:20 AM »
The Al Jazeera news reading part of the original thread has been moved to VoxCommando Basics and Core Features.

http://voxcommando.com/forum/index.php?topic=2571.0

The original section of this thread is still located at: http://voxcommando.com/forum/index.php?topic=1022.0

9
Recently we discovered a new repeating socket message in the VC log.

This could cause your log to grow excessively and may affect performance. We are working to address this for a future VC release.

Generally, we recommend that users keep the log disabled except when trouble-shooting issues, but because of this particular situation Kodi users should consider avoiding the log function entirely.

There is no problem with using the history window in VC to monitor communications between Kodi and VC, but for now you should avoid enabling the Vox log.

10
Yandex offers a free (or, free for now) cloud-based TTS API. It is only for Russian or English. (The documentation says Russian only, but it works for me in English.)

Of course, the TTS will not work unless you're connected to the internet.

1. You need to register by email in order to get your own API key. https://tech.yandex.com/speechkit/cloud/

2. You will need to replace "{M:API.ydx.speechkit.key}" in the XML below with your own API key.

3. Note: For the Russian TTS to work, you will need to have VC 2.2.1.7 or later installed.

This is because Russian-language text needs to be properly URL encoded. In 2.2.1.7, James has added a new Tools.Encode.URI action.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.7-->
<commandGroup open="True" name="yandex" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="304" name="++Speak to me Yandex (use an action like this example in any command that requires TTS)" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>VC.TriggerEvent</cmdType>
      <params>
        <param>Yandex.TTS</param>
        <param>Greetings, earth being.</param>
        <param>en</param>
        <param>jane</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.Pause</cmdType>
      <params>
        <param>2000</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>VC.TriggerEvent</cmdType>
      <params>
        <param>Yandex.TTS</param>
        <param>Я плохо говорю по-русски</param>
        <param>ru</param>
        <param>zahar</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>Speak to me Yandex</phrase>
  </command>
  <command id="159" name="Yandex TTS" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="{1} phrase you want spoken (Russian or English only)&#xD;&#xA;{2} --&gt; lang code options are ru-RU, en-GB. Officially, only Russian is supported, but English seems to work.&#xD;&#xA;{3} --&gt; speaker options are: &#xD;&#xA;female voices: jane or omazh&#xD;&#xA;male voices: zahar or ermil&#xD;&#xA;You will need your own API key to replace {M:API.ydx.speechkit.key}. See: https://tech.yandex.com/speechkit/cloud/doc/dg/concepts/speechkit-dg-tts-docpage/">
    <action>
      <cmdType>Tools.Encode.URI</cmdType>
      <params>
        <param>{1}</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Sound.PlayStream</cmdType>
      <params>
        <param>https://tts.voicetech.yandex.net/generate?text={LastResult}&amp;format=mp3&amp;lang={2}&amp;speaker={3}&amp;key={M:API.ydx.speechkit.key}&amp;emotion=mixed</param>
      </params>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>Yandex.TTS</event>
  </command>
</commandGroup>

To customize the TTS voice, see the documentation here: https://tech.yandex.com/speechkit/cloud/doc/dg/concepts/speechkit-dg-tts-docpage/

11
XML Exchange / Alternative Nest configuration/control -- with Python
« on: March 23, 2016, 03:40:42 PM »
This is an alternative to our Nest command collection posted here: http://voxcommando.com/forum/index.php?topic=1965.0.

In this version, I decided to put the Python plugin to use so you will need to have the Python plugin enabled.

The previously posted collection works great and is probably fine for most users, but it has a few limitations that I wanted to try to address, including:
  • improving how we refresh data from the Nest
  • automatically determining system information such as whether a device is using Fahrenheit or Celsius, so that temps can be reported in that measurement system
  • eliminating some of the complex & fallible regular expressions that were required to read the Nest data (because Python permits us to easily parse json)

The video tutorial in the other thread is still very helpful if you don't yet use Nest commands with VC. You should watch it in order to understand the whole setup process. However, there are a few minor variations when setting up this Python-enabled variation.

1. Put the attached Nest.py in your VC root directory.*
2. Import attached command collection to your tree.
3. Edit the Nest authorization command with your user/pwd info.
--
4. Save & exit the command tree, and then open it up again.
--
5. Execute commands marked 1, then 2, then 3 -- in order.
6. Save & exit the command tree.

Test commands. (You'll probably want to "show help" to see the commands.)

---
* If you are a seasoned VC user, feel free to put this in your \PY subfolder and then edit the command that loads this file to point to the correct filepath.

13
XML Exchange / Trigger VC events from Domoticz
« on: February 28, 2016, 04:06:20 PM »
There are a variety of ways to trigger events in VC from Domoticz.  One way is to use a lua script together with udpsender.exe, which is part of the"Extra utilities" package available on VoxCommando's Downloads page (http://voxcommando.com/home/downloads/)

In the lua script, you can call on the udpsender.exe, which will then send a UDP message to VC (in this case, to trigger events).

Attached to this post is an example lua script called "script_device_VcNotifications".

DO NOT change the name of the attached lua file unless you know what you're doing.

1. If you haven't yet done so, then download the Extra utilities package and put the udpsender program somewhere accessible on your Domoticz machine such as C:\Users\USERNAME\...
2. Put the lua file in C:\Program Files (x86)\Domoticz\scripts\lua (or whatever the correct file path is for your Domoticz installation).
3. Edit the script in Notepad or whatnot, to correct the filepath in the line:
Code: [Select]
UDPfilepath = 'C:/Users/USERNAMEHERE/udpsender.exe' --REPLACE WITH THE CORRECT FILE PATH ON YOUR COMPUTER

That's all you should need to do. Whenever you switch a device on or off, a "Domoticz.state" event should now be generated in VC. It will have 2 payloads: {1} the name of the device, {2} the state of the device.

Here is a very basic example of using an event-triggered command:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.4-->
<command id="266" name="announcing all state changes" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="Change &quot;Living Room Light&quot; to name of your switch. *case sensitive*!">
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>The device {1} is now:</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.AddText</cmdType>
    <params>
      <param>{2}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <event>Domoticz.state</event>
</command>

14
XML Exchange / GgCal -- what's on my agenda Monday/Tuesday/tomorrow/etc.?
« on: February 25, 2016, 08:41:33 PM »
THIS COMMAND REQUIRES VC 2.2.1.6 OR HIGHER.

Don't forget to download the attached payload xml file to your vc\payloads subfolder.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.7-->
<command id="126" name="What's on my agenda {1}" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)&lt;(B)</ifType>
    <ifParams>-1&amp;&amp;{1}</ifParams>
    <then>
      <action>
        <cmdType>Results.SetVar</cmdType>
        <params>
          <param>day</param>
          <param>{1}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>Tools.WeekdayToOffset</cmdType>
        <params>
          <param>{1}</param>
          <param>True</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.SetVar</cmdType>
        <params>
          <param>day</param>
          <param>{LastResult}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <action>
    <cmdType>GgCal.GetDay</cmdType>
    <params>
      <param>{var.day}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{#M}&amp;&amp;0</ifParams>
    <then>
      <action>
        <cmdType>OSD.ShowText</cmdType>
        <params>
          <param>You have no items on your calendar {PF.1}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>OSD.ShowText</cmdType>
        <params>
          <param>On the agenda for {PF.1}:</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>On the agenda for {PF.1}:</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>OSD.AddText</cmdType>
        <params>
          <param>{Match.{i}}</param>
        </params>
        <cmdRepeat>{#M}</cmdRepeat>
      </action>
      <action>
        <cmdType>TTS.Speak</cmdType>
        <params>
          <param>{Match.{i}}</param>
        </params>
        <cmdRepeat>{#M}</cmdRepeat>
      </action>
    </else>
  </if>
  <phrase>What's on my</phrase>
  <phrase>agenda,schedule</phrase>
  <phrase optional="true">for,on</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="False">payloads\weekdays.xml</payloadFromXML>
</command>

15
There is a new Tools action as of the recently released beta, VC 2.2.1.6: Tools.WeekdayToOffset.

i.e., if today is Tuesday, Weather Underground and Google Calendar consider today to be 0, tomorrow to be 1, Thursday to be 2, etc., which means that if we want to add something to our calendar on Saturday or tomorrow, we have to somehow translate these words into number values.

In another thread, I shared a Python script to help getting the weather forecast for specific days with the WUnder plugin: http://voxcommando.com/forum/index.php?topic=1755.0

Below is the exact same weather command I shared previously, but this time I'm using the new Tool.WeekdayToOffset action. No Python script is required.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.6-->
<command id="303" name="What's the forecast for {1}" 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>{1}&amp;&amp;today</ifParams>
    <then>
      <action>
        <cmdType>Results.SetVar</cmdType>
        <params>
          <param>day</param>
          <param>D0</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{1}&amp;&amp;tomorrow</ifParams>
    <then>
      <action>
        <cmdType>Results.SetVar</cmdType>
        <params>
          <param>day</param>
          <param>D1</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <if ifBlockDisabled="False" ifNot="True">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>tomorrow today&amp;&amp;{1}</ifParams>
    <then>
      <action>
        <cmdType>Tools.WeekdayToOffset</cmdType>
        <params>
          <param>{1}</param>
          <param>True</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.SetVar</cmdType>
        <params>
          <param>day</param>
          <param>D{LastResult}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else />
  </if>
  <action>
    <cmdType>WUnder.GetCustom</cmdType>
    <params>
      <param>Weather for {1}: {{var.day}.conditions}, with high of {{var.day}.high} degrees Celsius and a low of {{var.day}.low} degrees. There's a {{var.day}.pop}% chance of precipitation, with winds averaging {{var.day}.avewind} km/h.</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <params>
      <param>{LastResult}</param>
      <param>10000</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>What's the forecast for</phrase>
  <payloadList>today, tomorrow, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday</payloadList>
</command>

I have chosen to use several logic blocks here so that I could use a payload list in my command, rather than needing to attach a payload XML file. The same command could be created using payload XML and fewer logic evaluations in the macro.

For this command, I have set the WeekdayToOffset action to always assume I mean future days, so if I ask for Sunday's forecast on a Monday, it will give me next Sunday's weather, not yesterday's weather.

See the action description in your installation or on the wiki for details.

Pages: [1] 2 3 ... 8