Page 1 of 1

Read weather report after morning alarm, only if rain expect

Posted: 23 Mar 2016 11:05
by mbirth
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

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

Posted: 23 Mar 2016 11:25
by eggger
like :mrgreen: