Voice Weather.....

Post your questions and help other users.

Moderator: Martin

Post Reply
Randy Watson
Posts: 13
Joined: 14 Jan 2015 14:18

Voice Weather.....

Post by Randy Watson » 18 Jan 2015 05:17

I'm very new to automagic and i'm trying to get voice weather working.......
I did a search and there doesn't seem to be any sample flows which voice the weather.

My requirements are every 3 hours automagic automates weather through voice stating the current temp, today's forecast temp, description ;ie cloudy. Chance of rain and tomorrow's forecast.

So far I have registered an api at weather underground.

Trigger: periodic timer 3 hours > condition: time range > condition active network type >


Could someone please spare me sometime helping me fill in the rest.

Thanks in advance.

Randy Watson
Posts: 13
Joined: 14 Jan 2015 14:18

Re: Voice Weather.....

Post by Randy Watson » 18 Jan 2015 15:45

Well I managed to get it working with alot of help from this post below.....I now have weather alerts every 3 hours through voice.

http://automagic4android.com/forum/view ... f=3&t=1853


I'd like to add 3 day weather forecast.....have no idea how to find the scripts used for this.
anyone have experience implementing the 3 day forecast.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Voice Weather.....

Post by Martin » 18 Jan 2015 16:51

Hi,

You could use XPath to extract the values of another forecastday element.
Example to get the low temperature of the first forecast day:
temp=evaluateXPathAsString(response, "/response/forecast/simpleforecast/forecastdays/forecastday[1]/low/celsius");
or to get the temperature of the second day:
temp=evaluateXPathAsString(response, "/response/forecast/simpleforecast/forecastdays/forecastday[2]/low/celsius");

Regards,
Martin

Randy Watson
Posts: 13
Joined: 14 Jan 2015 14:18

Re: Voice Weather.....

Post by Randy Watson » 19 Jan 2015 11:06

Martin wrote:Hi,

You could use XPath to extract the values of another forecastday element.
Example to get the low temperature of the first forecast day:
temp=evaluateXPathAsString(response, "/response/forecast/simpleforecast/forecastdays/forecastday[1]/low/celsius");
or to get the temperature of the second day:
temp=evaluateXPathAsString(response, "/response/forecast/simpleforecast/forecastdays/forecastday[2]/low/celsius");

Regards,
Martin

Hey Martin, love your creation, i'm a giddy little school girl at a 1 direction concert. I can't stop playing with my phone. haha

With your help I managed to get voice for another 3 days of forecast.......although I'm having a bit of trouble figuring out how to script the 3rd day. I have Voice saying Today > Tomorrow, how do i get the the 3rd day say the exact day and date: ie Tuesday.... (The day after tomorrow doesn't sound to crash hot.)

Thanks again for your support.

I have attatched my flow for your guidance.
http://automagic4android.com/flow.php?i ... b494640717

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Voice Weather.....

Post by Martin » 20 Jan 2015 19:43

:-)

You could calculate the third day in a script and then use a date pattern to format it to a text you like:

Code: Select all

day3 = addDays(getDate(), 2);//adds two days to the current date
day3text = "{day3,dateformat,EEEE dd.}";//will produce something like "Thursday 22."
You could also use an inline script in action Speech Output to achieve the same, but it looks a bit complex in this case:
{addDays(getDate(),2),dateformat,EEEE dd.}

The documentation about date format patterns contains some other examples.

Regards,
Martin

Mar
Posts: 49
Joined: 20 May 2015 23:24
Location: Germany

Re: Voice Weather.....

Post by Mar » 03 Jan 2016 16:01

Hey,

I wouldn't suggest you to post your flow without the delete of your api.
Everybody could use your api now. I would worry about that. I would suggest you to reset your api on api.wunderground.com
I haven't tried it myself but it should be the best way.

Post Reply