Read weather report after morning alarm, only if rain expect

Share and discuss your flows and ideas with other users.

Moderator: Martin

Post Reply
User avatar
mbirth
Posts: 80
Joined: 17 Mar 2016 00:02
Location: Berlin, Germany
Contact:

Read weather report after morning alarm, only if rain expect

Post by mbirth » 23 Mar 2016 11:05

http://automagic4android.com/flow.php?i ... 0f05b853c6

To make this flow work, you'll first have to get a WeatherUnderground API key from here. It's free.

Store this API key in the global variable global_WUnderKey.

The flow will watch for the ALARM_DONE event (=when you snooze or dismiss an alarm) and only run if it's between 3am and 11:30am. It'll then check your location to get the current weather report from Weather Underground. If there's going to be rain today, it'll read out the weather report to you and also add a notification to the tray.

It's currently made for German language. But you can easily adapt it to any other:
  • Change language parameter in HTTP Request URL
  • Maybe change fcttext_metric to fcttext in the Script: Parse JSON... block to get the forecast text in imperial units
  • Maybe change ['qpf_allday']['mm'] (same Script block) to ['qpf_allday']['in'] to get expected rainfall in inches rather than millimetres
  • Maybe adapt the text replacements (for more natural speech output) in the Script: Prep texts for TTS block
  • Finally, adapt the texts (Notification on Statusbar and Speech Output blocks) to your liking
NOTE: The watched intent, com.android.deskclock.ALARM_DONE is only sent from the built-in Android alarm clock. If you're using an alternative alarm app, you could try other intents from here.

Image
BlackBerry KEY2, Android 8.1.0

eggger
Posts: 13
Joined: 16 May 2013 15:19

Re: Read weather report after morning alarm, only if rain ex

Post by eggger » 23 Mar 2016 11:25

like :mrgreen:

Post Reply