Author Topic: Weather Underground - WUnder Plugin  (Read 16750 times)

0 Members and 1 Guest are viewing this topic.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Weather Underground - WUnder Plugin
« on: September 27, 2012, 03:44:39 PM »
I've been making some pretty good progress on a new weather plugin to replace the one that google closed.  This one will be better although I'm not 100% sure how it is going to work in terms of the "freeness" of the api.

Please put the WUnder folder from the .rar in your plugins and put the file "Newtonsoft.Json.dll" in your VC main folder.  Then go to VC options and enable the WUnder plugin and restart VC.

[Outdated attachments deleted. Wunder plugin is now standard in VC.]
« Last Edit: June 25, 2016, 10:53:11 AM by nime5ter »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Weather Underground - WUnder Plugin
« Reply #1 on: September 27, 2012, 03:48:17 PM »
Goto plugin settings for WUnder

1) set your language

2) enter your location in one of the following formats:

US Zip Code
Canadian Postal Code
(some other postal code in another country? - I don't know)
County/Cityname
###,###   (longitude and latitude)

3) Customize your format strings as you like.  Play with it for now, I'll try to provide more information.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Weather Underground - WUnder Plugin
« Reply #2 on: September 27, 2012, 05:41:15 PM »
About Variables

Current
Looks like this:  {C.temp_c}
This is current data only so there is no #


10 Day Text
Looks like this:  {T#.title}
# can be anything from 0 to 19
0=today (day)
1=today (night)
2=tomorrow (day)
3=tomorrow (night)
etc.


10 Day Data
Looks like this:  {D#.snow_allday}
# can be anything from 0 to 9
0=today (all day)
1=tomorrow (all day)
2=day after tomorrow (all day)
etc.



When you drop a variable onto one of the 4 numbered Format Fields (0-3) the # will be automatically replaced with the number of the field, but you can still change it to something else.  For example I used field 3 to retrieve the upcoming highs for each day:

Highs this week, {D0.weekday} {D0.high}, {D1.weekday} {D1.high}, {D2.weekday} {D2.high}, {D3.weekday} {D3.high}, {D4.weekday} {D4.high}.

a variation on this would be:

Highs this week, Today: {D0.high}, Tomorrow: {D1.high}, {D2.weekday} {D2.high}, {D3.weekday} {D3.high}, {D4.weekday} {D4.high}.
« Last Edit: September 27, 2012, 05:51:34 PM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Weather Underground - WUnder Plugin
« Reply #3 on: September 27, 2012, 08:15:42 PM »
&feature=player_detailpage

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Weather Underground - WUnder Plugin
« Reply #4 on: September 29, 2012, 04:03:15 AM »
&feature=player_detailpage
perfect job - a very good video tutorial  :clap  ::bow

Kalle
« Last Edit: September 29, 2012, 04:43:52 AM by Kalle »
***********  get excited and make things  **********

Brian

  • $upporter
  • Jr. Member
  • *****
  • Posts: 27
  • Karma: 3
    • View Profile
Re: Weather Underground - WUnder Plugin
« Reply #5 on: December 28, 2013, 01:42:54 PM »
Hi,

I enabled the plugin but I'm not seeing it in the command tree. Not sure what to do next.

Thanks!

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Weather Underground - WUnder Plugin
« Reply #6 on: December 28, 2013, 02:31:14 PM »
Hi Brian,

I'm not sure what you mean by "not seeing it in the command tree". The command tree will contain the commands that came with the configuration you installed, plus whatever new commands you may have created. It doesn't show plugins.

However, possibly you mean the action selection tree? Whenever you enable a new plugin in the Options, you need to save the options and then do a full restart of VoxCommando before you can select plugin actions: http://voxcommando.com/mediawiki/index.php?title=Plugins).

Once you've done a full restart, you can start typing an action name or click the magic wand to access the action selection tree in the Logical Command Builder (LCB) as always. Plugin actions are located in their own tab of the action selection tree. (http://voxcommando.com/mediawiki/index.php?title=Logical_Command_Builder)

For the Wunder plugin you'll also need to go into the plugin's settings and provide your location. I recommend watching James's tutorial to get a better sense of how the plugin works and how to set it up:
&feature=youtu.be&t=37s.

The plugins screen will look slightly different because the demo was made with an earlier version of VC, but the information is still valid.

« Last Edit: December 28, 2013, 02:43:31 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)

Brian

  • $upporter
  • Jr. Member
  • *****
  • Posts: 27
  • Karma: 3
    • View Profile
Re: Weather Underground - WUnder Plugin
« Reply #7 on: December 28, 2013, 02:46:20 PM »
Thanks for the info.

I enabled the plugin and changed the settings. I restarted Vox. I clicked on Edit and a new window opens up called voicecommands.xml. Should Wunder be in that list somewhere?

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Weather Underground - WUnder Plugin
« Reply #8 on: December 28, 2013, 03:00:50 PM »
When you click on "Edit", you are indeed accessing the command tree. That tree shows the commands (organized into groups) that already exist in your configuration.

Activating new plugins does not automatically install new commands to your command tree. You will have to import relevant commands (e.g., by copying commands posted here on the forum) or create them yourself.

To copy code from the forum, you select all the code, copy it (Ctrl-C), then open your command tree window and paste it in (Ctrl-V). If you're copying a whole command group, that group will appear in your tree. If you copy just a single command, it will be pasted into whatever group you have selected in your command tree.

http://voxcommando.com/mediawiki/index.php?title=XML_on_the_forum

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: Weather Underground - WUnder Plugin
« Reply #9 on: December 28, 2013, 03:05:17 PM »
To clarify, if you install the Wunder plugin and restart, you'll then have access to new actions that you didn't have previously, which you can use when building new commands in the Logical Command Builder.

So when you open the LCB (that is, double-click on a command in your command tree), that's when you'll see that actions of the form Wunder.x will appear if you start typing the action name or if you look in the action selection tree.
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)

Brian

  • $upporter
  • Jr. Member
  • *****
  • Posts: 27
  • Karma: 3
    • View Profile
Re: Weather Underground - WUnder Plugin
« Reply #10 on: December 28, 2013, 03:20:23 PM »
Thanks for the help!

Indy

  • $upporter
  • Jr. Member
  • *****
  • Posts: 23
  • Karma: 1
    • View Profile
Re: Weather Underground - WUnder Plugin
« Reply #11 on: February 05, 2014, 12:15:40 AM »
Just having a small problem with the replace this string.  I also didn't like the TTS saying C so I changed it to Degrees as well so when it see 1C it reads 1 degree which is what I want.  But when it saw the word "Chance" it said "Degreehance"  Can I specify it to use replace C only when following a number?

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Weather Underground - WUnder Plugin
« Reply #12 on: February 05, 2014, 09:26:46 AM »
The easiest way is to replace the string "C " (i.e., 'C' + a space) with " degrees " (space+'degrees'+space), rather than just "C".

Other options are to fiddle around in the plugin settings to create your own custom Weather Underground forecast using their list of variables. (Video tutorial on the Wunder plugin here:
)

If you're comfortable with regular expressions (regex) or would like to learn how to use them, then within your actual command you can use Results.RegExReplace (http://voxcommando.com/mediawiki/index.php?title=Actions#RegExReplace).
« Last Edit: February 25, 2014, 11:39:10 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)

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Weather Underground - WUnder Plugin
« Reply #13 on: February 05, 2014, 09:34:04 AM »
Here is an example of how to use the regex replace action.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="635" name="sample regex replace" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Results.SetLastResult</cmdType>
    <cmdString>it is 15C out there.</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegExReplace</cmdType>
    <cmdString>(\d)C&amp;&amp;$1 degrees</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <cmdString>{LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
</command>

The first Results.SetLastResult action here is just a test action rather than using the Wunder plugin. You wouldn't need that line.
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)

Indy

  • $upporter
  • Jr. Member
  • *****
  • Posts: 23
  • Karma: 1
    • View Profile
Re: Weather Underground - WUnder Plugin
« Reply #14 on: February 06, 2014, 01:03:26 PM »
Thanks nime5ster, I'm sorry, this is going to be a dumb question but where do I insert this code?  Or is this just sample code on how to do it and I have to hax0r the Results.RegExReplace into the current xml and try and make this work.  Its been a while since I've done any regex and that was all linux command line with awk but I'm sure the principals still apply.  I think I understand what it is doing, I'm just not sure how to use this, I'm still to green to this.  
« Last Edit: February 06, 2014, 11:25:01 PM by jitterjames »