Weather Widgets

Share and discuss your flows and ideas with other users.

Moderator: Martin

Post Reply
jmckeejr
Posts: 32
Joined: 03 May 2015 12:29

Weather Widgets

Post by jmckeejr » 09 Mar 2019 06:05

I finally got my weather widgets working, wanted to post in case anyone wants to use them or collaborate to make them better. There's a 2x2(or other size) home page widget which I set up to open the larger widget when touch bottom area. Larger widget closes when touched. I originally used wunderground API, but they stopped free service so I had to convert everything. I may still make some changes and possibly add a third widget with 5 day forecast if I can figure out how to make everything work. I downloaded the free icons online as well as fonts. There will be extra icons on the folder as it's set up for Open Weather Map API as well. There is a different icon from day and night. There's an umbrella icon that shows half umbrella if chance of precipitation higher than 50 but lower than 75, and full umbrella when over 75% chance that day. I like having the option of a longer summary when I want it. The city is taken from a parse of Automagic provided location (in locationformat) so I'm not sure how it will work in all areas. I'll tweak things as I find problems. Thanks to Automagic I like this widget set better than any I could download. I also have a small one I use on my Android Head Unit in my truck but I haven't merged my files from phone and truck yet and need to update that one.

Setup:
- Import flows
- Copy weather_widgets.zip to "/sdcard/Automagic"
- Sign up for a free Dark Sky API Key
- Have the key copied into clipboard
- Execute "Weather Setup" Flow
- Paste key when prompted and press "OK"

NOTE:
You may need to go into the widget settings and choose the correct fonts (included).

Here is what it looks like on my device. (You may need to adjust sizes for different resolution)



Download:
Download the latest version here, make sure to get the zip file as well as xml file if not posted below.

UPDATE V2.1 you will need the temperature.zip file from my dev folder. If you want notification with weather turn on the flow. You may need to make adjustment for your personal needs or device.

UPDATE v2.2 QuickFix
I had missed a "global_icon", you can also just change instances of global_icon to iconNow. Added option in setup to enable or disable notification when setting up. Do NOT run setup a second time(unless you have just key ready again).

Latest Version 1.0
Attachments
update_2.2_quickfix_weather_widgets.xml
Delete old flows and widgets
(1.39 MiB) Downloaded 194 times
Screenshot_20190308-102951_Samsung Experience Home.jpg
Detailed forecast
Screenshot_20190308-102951_Samsung Experience Home.jpg (527.64 KiB) Viewed 3251 times
SmartSelect_20190308-103120_Samsung Experience Home.jpg
Cropped widget on home screen
SmartSelect_20190308-103120_Samsung Experience Home.jpg (137.18 KiB) Viewed 3251 times
Last edited by jmckeejr on 14 Mar 2019 12:03, edited 2 times in total.

jmckeejr
Posts: 32
Joined: 03 May 2015 12:29

Re: Weather Widgets

Post by jmckeejr » 09 Mar 2019 21:01

Already at v1.2, I've added some widgets with clock (enable Flow "Weather Clock Constant" for time to update). There's a few more fonts included in the zip. Delete Flow "Weather Forecast" before updating. Also added a 3 day long forecast. There's another widget based on RL KWGT widget design. If you need help customizing any widget let me know.

Download v1.2 (or attached xml)

NOTE
As I'm on Note 9 my resolution will be different from other devices so you may have to adjust sizes of certain things (mostly "Show Custom Widget Overlay" x and y). I know I have to adjust this when adding widgets to my truck's android head unit.

Also I'm not sure if the font settings are carried over when importing so they may need to be set.
Clocks are Delirium NVC
High low and detailed are pirouette,
And city is Galactic ...
You can play with them and use whatever you like, but if they don't come up on the list of fonts just choose custom and look in "/sdcard/Automagic/fonts".
Attachments
weather_widgets_v1.2.xml
Updated xml
(1.2 MiB) Downloaded 171 times
Screenshot_20190309-152921_Samsung Experience Home.jpg
Widget based on RL KWGT widget design
Screenshot_20190309-152921_Samsung Experience Home.jpg (460.8 KiB) Viewed 3215 times
Screenshot_20190309-152033_Samsung Experience Home.jpg
3 day home screen widget
Screenshot_20190309-152033_Samsung Experience Home.jpg (615.4 KiB) Viewed 3215 times

Horschte
Posts: 40
Joined: 03 Nov 2014 18:00

Re: Weather Widgets

Post by Horschte » 09 Mar 2019 23:45

Great work, thank you! So impressive what is possible with Automagic. 8-)

I had to tinker with it for a while to localize it (Fahrenheit --> Celsius, weather texts in my language and so on). The fonts didn't work out of the box and the widget Weather1 has clickable actions which don't work.

jmckeejr
Posts: 32
Joined: 03 May 2015 12:29

Re: Weather Widgets

Post by jmckeejr » 11 Mar 2019 11:02

Horschte wrote:Great work, thank you! So impressive what is possible with Automagic. 8-)

I had to tinker with it for a while to localize it (Fahrenheit --> Celsius, weather texts in my language and so on). The fonts didn't work out of the box and the widget Weather1 has clickable actions which don't work.
Hey thanks. I'm still learning this stuff. I just figured out I don't need the extra flow for my clock, I didn't realize you could just put the getDate right in the text line. I don't know if it would update when minutes changed but yeah it does so I'll fix that for the future.
I am just completing one with 5 day forecast with predicted rain for the next 4 hours.
Attachments
Screenshot_20190311-070200_Samsung Experience Home.jpg
Screenshot_20190311-070200_Samsung Experience Home.jpg (602.29 KiB) Viewed 3157 times

Horschte
Posts: 40
Joined: 03 Nov 2014 18:00

Re: Weather Widgets

Post by Horschte » 11 Mar 2019 19:34

I'm looking forward to 5 day forecast and rain prediction.

One more thing I noticed: you have a lot of global variables. I think you can avoid them if you update the widgets by using setWidgetElementProperty in your scripts.

jmckeejr
Posts: 32
Joined: 03 May 2015 12:29

Re: Weather Widgets

Post by jmckeejr » 13 Mar 2019 13:00

Horschte wrote:I'm looking forward to 5 day forecast and rain prediction.

One more thing I noticed: you have a lot of global variables. I think you can avoid them if you update the widgets by using setWidgetElementProperty in your scripts.
I will consider that in future, currently I'm ok with a lot of globals (I don't think there's a limit) because it makes modification and adding widgets a lot easier. I'm still learning though, so that may change in future. You'll see I'm trying to expand by adding some if statements and some for loops in the updated version here. Here is 5 day forecast with rain prediction (Chronus5) and I am working on the attached notification flow a well. If don't want notification simply disable. For the icon option in notification you'll need download temperature.zip and unpack to same folder as bitmapsb(/sdcard/Automagic/weather). Still tweaking on this daily so there may be bugs or inconsistencies. The icon option in notification let you choose between temp in status bar or current icon.

If you want the rain drop image on widget as pictured above a few posts you'll need to add water.png to bitmaps folder.


Edit: If anyone has other suggestions, ways to clean up script, shortcuts, or teachy type stuff I'm happy to learn as much as I can. I have roots in ROM building and modification, theming, and apk editing, but not much on programming from scratch.
Attachments
water.png
Add to bitmaps folder
water.png (27.89 KiB) Viewed 3072 times
Update_v1.3_weather.xml
Update. Delete weather forecast flow before import.
(910.76 KiB) Downloaded 165 times

jmckeejr
Posts: 32
Joined: 03 May 2015 12:29

Re: Weather Widgets

Post by jmckeejr » 13 Mar 2019 16:11

Was an error in first temperature folder. Updated link above

jmckeejr
Posts: 32
Joined: 03 May 2015 12:29

Re: Weather Widgets

Post by jmckeejr » 14 Mar 2019 07:40

V2.0 has many updates. Removed many many global's (like 30), switched to a global_list option which should make things even easier in the future to add more days or a detailed day view. Again if you don't want notification just turn the flow off. Delete all previous flows AND widgets as changes occur throughout. There are 4 options for the way icons are made in status bar (current condition, premade icons >don't forget to unpack the temperature. Zip, widget to image convert, and Java). I like the convert method as you can use custom fonts if you edit the widget. Just select "Icon" from the notification to choose whatever you want.
Attachments
update_2.2_quickfix_weather_widgets.xml
This one is the better version
(1.39 MiB) Downloaded 221 times

Post Reply