Author Topic: Weather Command in VC 0.984 ?  (Read 6134 times)

0 Members and 1 Guest are viewing this topic.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Weather Command in VC 0.984 ?
« Reply #15 on: April 29, 2013, 02:28:31 PM »
Hi Snodric,

Please watch the whole video tutorial and then post back if you still have any questions.  This is all explained in the video as far as I know.  You can probably skip the first 6 minutes or so if you've already got the plugin working for your area.



You don't have to do any "coding" you just need to click "pick variables" and then drag variables into your format fields and change the # to the number for the time period you want.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Weather Command in VC 0.984 ?
« Reply #16 on: April 29, 2013, 02:45:08 PM »
Here is something along the lines of what you want for Tomorrow's weather:

Code: [Select]
Weather for {D1.weekday}, {D1.conditions}. High of {D1.high} degrees. Chance of rain: {D1.pop} %
But it is not possible to get the detailed variables for tomorrow night.  Only for tomorrow.  That is just how Wunderground does it.

Snodric

  • $upporter
  • Jr. Member
  • *****
  • Posts: 23
  • Karma: 0
    • View Profile
Re: Weather Command in VC 0.984 ?
« Reply #17 on: April 29, 2013, 03:20:36 PM »
I put in the code you suggested but it seems to 'mash' the results together. I've attached a screen print of the code in Option '0' and the result displayed when I click on 'test'

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Weather Command in VC 0.984 ?
« Reply #18 on: April 29, 2013, 03:33:23 PM »
I put in the code you suggested but it seems to 'mash' the results together. I've attached a screen print of the code in Option '0' and the result displayed when I click on 'test'
Ok, you can delete the replace "C" with "degress".
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Weather Command in VC 0.984 ?
« Reply #19 on: April 29, 2013, 03:39:21 PM »
It's just replacing every occurrence of C with degress, which you don't want.

In this case, because you are creating a custom response you don't need to do any replacing, but if you did still want to replace C for other formats, it would be better to replace

Code: [Select]
C.
with

Code: [Select]
Degrees.
in other words, include the period.

Snodric

  • $upporter
  • Jr. Member
  • *****
  • Posts: 23
  • Karma: 0
    • View Profile
Re: Weather Command in VC 0.984 ?
« Reply #20 on: April 29, 2013, 04:31:40 PM »
Thanks. I stopped replacing the 'c' with 'degrees' and simply put the word 'degrees' into the code wherever I wanted the computer to say 'degrees' and that works perfectly. A couple of follow-up questions, if I may  ;D

What does the period (".") represent when it appears OUTSIDE of the curly brackets?

How do you get the computer to pause (I'm having it do tts) between phrases such as follows :

Here's my code for today's weather:   The current temperature is {C.temp_c} degrees The forecast for today is a high of {D0.high} and {D0.conditions} with a low tonight of {D1.low}

The output is :      The current temperature is 2 degrees the forecast for today is a high of 9 and mostly cloudy with a low tonight of  -5

In other words, what can I add to the above code to have it pause after the word 'degrees'?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Weather Command in VC 0.984 ?
« Reply #21 on: April 29, 2013, 04:39:35 PM »
What does the period (".") represent when it appears OUTSIDE of the curly brackets?
It represents a period, as in the end of a sentence.

How do you get the computer to pause (I'm having it do tts)

In other words, what can I add to the above code to have it pause after the word 'degrees'?

TTS will pause when it encounters a comma.

edit: it may vary a bit from one TTS engine (voice) to another but it will pause for various punctuation such as , . ! : ; and the duration of the pause may vary for each, but comma is a reliable way to pause for most TTS engines.

« Last Edit: April 29, 2013, 04:48:24 PM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Weather Command in VC 0.984 ?
« Reply #22 on: April 29, 2013, 04:41:59 PM »
By the way, I think that:

Code: [Select]
{D#.low}
Is just the overall low for a particular day, not for that evening, so it might be the temperature in the morning if that is colder than the temp at night.

Of course I could be completely wrong.

« Last Edit: April 29, 2013, 04:49:11 PM by jitterjames »

Snodric

  • $upporter
  • Jr. Member
  • *****
  • Posts: 23
  • Karma: 0
    • View Profile
Re: Weather Command in VC 0.984 ?
« Reply #23 on: April 29, 2013, 04:53:58 PM »
Thanks! That's awesome. That fixed it and helped me make it sound nice!  Here's my code for today's weather and the result :

Code : The current temperature is {C.temp_c} degrees and {C.weather}. The forecast for today is a high of {D0.high} and {D0.conditions}, with a low tonight of {D1.low}

Result : The current temperature is 2 degrees and Light Snow. The forecast for today is a high of 9 and Mostly Cloudy, with a low tonight of -5


And here's my code for the weeks' forecast  :

Code : Forecast for the week is a high of {D0.high} and {D0.conditions} today. {D1.weekday} {D1.high} and {D1.conditions}, {D2.weekday} {D2.high} and {D2.conditions}, {D3.weekday} {D3.high} and {D3.conditions}, {D4.weekday} {D4.high} and {D4.conditions}.

Result : Forecast for the week is a high of 9 and Mostly Cloudy today. Tuesday 3 and Mostly Cloudy, Wednesday 10 and Partly Cloudy, Thursday 16 and Mostly Cloudy, Friday 13 and Chance of Rain.

I assumed that the daily low temperatures start with today's low which would use a '0' for the # in [D#.low} and that tomorrow's low temperature would be {D1.low}

This would be consistent (I think) with the other numbering for daily numbers as they start at '0' for today and '1' for tomorrow and so on, but I'm not sure.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Weather Command in VC 0.984 ?
« Reply #24 on: April 29, 2013, 05:36:29 PM »
I assumed that the daily low temperatures start with today's low which would use a '0' for the # in [D#.low} and that tomorrow's low temperature would be {D1.low}

This would be consistent (I think) with the other numbering for daily numbers as they start at '0' for today and '1' for tomorrow and so on, but I'm not sure.

That is correct.  I'm just pointing out that today's low and tonight's low are not necessarily the same thing.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Weather Command in VC 0.984 ?
« Reply #25 on: April 29, 2013, 06:01:42 PM »
for the super weather geeks out there, I'm talking about this:

https://pantherfile.uwm.edu/kahl/www/Research/Kahl&Horwitz2003.pdf

but I don't know which convention the WeatherUnderground follows.

mparks

  • $upporter
  • Contributor
  • *****
  • Posts: 93
  • Karma: 0
    • View Profile
Re: Weather Command in VC 0.984 ?
« Reply #26 on: April 29, 2013, 10:09:56 PM »
Hi James, since I started my quest to get my private pilots license, I have been using Nav Canada for all my weather ( http://www.flightplanning.navcanada.ca/cgi-bin/CreePage.pl?Langue=anglais&NoSession=NS_Inconnu&Page=forecast-observation&TypeDoc=html )

Just learning the codes they use is an adventure onto its own. I have gain a great appreciation for weather forecasting. Your plugin works perfectly for me and I have been using it as a daily overview and then Navcanada for everything else.

I am still just learning but it's been a fun ride so far.