Accepts
App Store Apps, Articles, Contacts, Dates, Email Addresses, Files, Images, iTunes Products, Locations, Map Links, Media, PDFs, Phone Numbers, Rich Text, Safari Web Pages, Text and URLs
DICTIONARY

Dictionary
COMMENT
This section sets options such as setting units of measurement to either Imperial or Metric and setting the option for the hearing impaired (read instead of hear Siri's weather report.)
IMPORTANT: DO NOT EDIT QUESTIONS. DOING SO WILL CAUSE THE SHORTCUT TO NOT WORK PROPERLY.
Setting the dictionary values below to "True", will switch:
Text output instead of Siri.
Precipitation from inches to millimeters.
Wind Speed from miles per hour to kilometers per hour.
Barometric Pressure from inches of mercury to hectopascals.
Visibility from miles to kilometers.
You may select temperature units (°F or °C) in your device settings. Go to General > Language & Region > Temperature Unit.
DICTIONARY

Dictionary
SCRIPTING
Get dictionary from
Dictionary

Dictionary
VARIABLES
Set variable
OptionsDict
to
Dictionary
COMMENT
This section sets the rate and pitch of Siri's voice for consistency and a more natural speech.
NUMBER
0.45

Number
VARIABLES
Set variable
SiriRate
to
Number
NUMBER
1

Number
VARIABLES
Set variable
SiriPitch
to
Number
COMMENT
This section gets the weather data from www.weather.com for the user's current location and passes the name of the city on for use by Siri.
NOTIFICATIONS
Show notification
Input
Options Under Construction
LOCATION
Get current weather at
Current Location

Weather Conditions
VARIABLES
Set variable
WeatherConditions
to
Weather Conditions
LOCATION
Get
City
from
WeatherConditions

City
VARIABLES
Set variable
City
to
City
LOCATION
Get
Location
from
WeatherConditions

Location
VARIABLES
Set variable
Location
to
Location
LOCATION
Get
Daily
forecast at
Location

Weather Conditions
VARIABLES
Set variable
WeatherForecast
to
Weather Forecast
COMMENT
This section gets the current date and time and sets the time period of the day (morning, afternoon, evening, or night.)
DICTIONARY

Dictionary
VARIABLES
Set variable
TimePeriods
to
Dictionary
DATE
Current Date

Date
VARIABLES
Set variable
Now
to
Date
LOCATION
Get
Longitude
from
Location

Longitude
LOCATION
Get
Latitude
from
Location

Latitude
DICTIONARY

Dictionary
COMMENT
If a remote weather location has been selected, an optional Total Weather Time Adjust module may be run by inserting a Run Shortcut action here. It will get the current day and time for the selected remote location from the TimeZoneDB.com API (requires a free API Key by registering.)
Insert a Run Shortcut action below and set to run the Total Weather Time Adjust Module shortcut and set the Input to the above "Dictionary" (magic variable.) "Show While Running" should be switched off.
Reset the variable RemoteDict below from "Dictionary" to "Shortcut Result".
VARIABLES
Set variable
RemoteDict
to
Dictionary
SCRIPTING
Get
Value
for
Now
in
RemoteDict

Dictionary Value
VARIABLES
Set variable
Now
to
Dictionary Value
CALENDAR
Format
Now
Options Under Construction

Formatted Date
VARIABLES
Set variable
DateToday
to
Formatted Date
CALENDAR
Add
1
days
from
DateToday

Adjusted Date
CALENDAR
Format
Adjusted Date
Options Under Construction

Formatted Date
VARIABLES
Set variable
DateTomorrow
to
Formatted Date
CALENDAR
Subtract
1
days
from
DateToday

Adjusted Date
CALENDAR
Format
Adjusted Date
Options Under Construction

Formatted Date
VARIABLES
Set variable
DateYesterday
to
Formatted Date
CALENDAR
Format
Now
Options Under Construction

Formatted Date
VARIABLES
Set variable
WeekDayNow
to
Formatted Date
CALENDAR
Format
Now
Options Under Construction

Formatted Date
VARIABLES
Set variable
TimeNow
to
Formatted Date
CALENDAR
Format
Now
Options Under Construction

Formatted Date
VARIABLES
Set variable
HourNow
to
Formatted Date
SCRIPTING
Get
Value
for
HourNow
.report
in
TimePeriods

Dictionary Value
VARIABLES
Set variable
TimeOfDay
to
Dictionary Value
CALENDAR
Get time between
Current Date
and
Now
in
Hours

Time Between Dates
VARIABLES
Set variable
TimeDiff
to
Time Between Dates
SCRIPTING
Get
Value
for
RemoteTimeDay
in
RemoteDict

Dictionary Value
VARIABLES
Set variable
RemoteTimeDay
to
Dictionary Value
COMMENT
This section creates a dictionary of phrases for Siri to use to improve grammar when describing current (0) and forecasted (1) weather conditions. The appropriate phrase is then selected to match current conditions. The dictionary below may need to be manually updated from time to time when a condition is added by weather.com that is not included.
DICTIONARY

Dictionary
VARIABLES
Set variable
ConditionsDict
to
Condition Dictionary
SCRIPTING
Get
All Keys
in
ConditionsDict

Dictionary Value
SCRIPTING
If
Dictionary Value
contains
WeatherConditions
SCRIPTING
Get
Value
for
WeatherConditions
.0
in
ConditionsDict

Dictionary Value
TEXT
City
in
Condition Dictionary Value

Text
VARIABLES
Set variable
ConditionPhrase
to
Text
SCRIPTING
Otherwise
TEXT
There are currently
WeatherConditions
conditions in
City

Text
VARIABLES
Set variable
ConditionPhrase
to
Text
SCRIPTING
End If

If Result
COMMENT
This section determines and formats the wind direction and rounds off the wind speed. The dictionary of wind directions was designed by Joe Really.
DICTIONARY

Dictionary
VARIABLES
Set variable
WindDirDict
to
Dictionary
SCRIPTING
Count
Characters
in
WeatherConditions

Count
SCRIPTING
If
Count
has any value
MATHS
WeatherConditions
÷
45
Options Under Construction

Calculation Result
MATHS
Round
Calculation Result
to
Ones Place

Rounded Number
SCRIPTING
Get
Value
for
Rounded Number
in
WindDirDict

Dictionary Value
VARIABLES
Set variable
WindDirection
to
Dictionary Value
SCRIPTING
Get
Value
for
Switch wind to km/h?
in
OptionsDict

Dictionary Value
SCRIPTING
If
Dictionary Value
is
0
VARIABLES
Get
WeatherConditions
MATHS
Round
WeatherConditions
to
Ones Place

Rounded Number
VARIABLES
Set variable
WindSpeed
to
Rounded Number
SCRIPTING
If
WindSpeed
is
1
TEXT
mile per hour

Text
VARIABLES
Set variable
WindUnit
to
Text
SCRIPTING
Otherwise
TEXT
miles per hour

Text
VARIABLES
Set variable
WindUnit
to
Text
SCRIPTING
End If

If Result
SCRIPTING
Otherwise
VARIABLES
Get
WeatherConditions
MATHS
Round
WeatherConditions
to
Ones Place

Rounded Number
VARIABLES
Set variable
WindSpeed
to
Rounded Number
SCRIPTING
If
WindSpeed
is
1
TEXT
kilometer per hour

Text
VARIABLES
Set variable
WindUnit
to
Text
SCRIPTING
Otherwise
TEXT
kilometers per hour

Text
VARIABLES
Set variable
WindUnit
to
Text
SCRIPTING
End If

If Result
SCRIPTING
End If

If Result

Text
VARIABLES
Set variable
WindPhrase
to
Text
SCRIPTING
Otherwise