Tasker: weather report
Instead of using a weather app, I made a Tasker task that will give me a notification with a short weather description twice a day. In the morning the weather of the current day, and in the evening with the weather for the next day.
Here is how I created the task for the current day. I used the Wunderground api, I signed up for an api key so I can get that data.
- Create a new task called
Weather Today
. - Add an action
Net -> HTTP Get
. - Set Server:Port to
api.wunderground.com
. - Set Path to
api/API_KEY/conditions/forecast/q/Belgium/ANTWERP.json
. replace theAPI_KEY
with the key you created with Wunderground. ReplaceBelgium
with the country you live in, andANTWERP
with your current city. - Go back to confirm.
In orde to test if this works correctly, you can create an Alert -> Flash
and set %HTTPD
as text. Press Play. If there is output, you know the call is correct.
- Add a new action
Code -> JavaScriptlet
and add this codevar weather = JSON.parse(global('HTTPD')).forecast.txt_forecast.forecastday[0].fcttext_metric;
. - Add a new action
Code -> JavaScriptlet
and add this codevar title = JSON.parse(global('HTTPD')).forecast.txt_forecast.forecastday[0].title;
. - Add a new action
Code -> JavaScriptlet
and add this codevar icon = JSON.parse(global('HTTPD')).forecast.txt_forecast.forecastday[0].icon_url;
. - Add a new action
Code -> JavaScriptlet
and add this codevar city =JSON.parse(global('HTTPD')).current_observation.display_location.city;
. - I used AutoNotification to create the actual notification. When the app is installed, create a new action
Plugin -> AutoNotification
. - Under Texts, as Title and Title Expanded, set
%title
. - Under Texts, as Text and Text Expanded, set
%weather
. - Under Texts, as SubText, set
%city
. - Under Icons and Images, set
%icon
. - Press back to confirm.
Now the task is complete, we need to create a profile that will trigger the task when we want.
- Go to tab
PROFILES
and create a new profileTime
and set the time you would like the notification. - Choose task
Weather Today
. - Press back to confirm.
Here is an example notification: