Page 1 of 1

Weather Widgets

Posted: 09 Mar 2019 06:05
by jmckeejr
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

Re: Weather Widgets

Posted: 09 Mar 2019 21:01
by jmckeejr
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".

Re: Weather Widgets

Posted: 09 Mar 2019 23:45
by Horschte
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.

Re: Weather Widgets

Posted: 11 Mar 2019 11:02
by jmckeejr
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.

Re: Weather Widgets

Posted: 11 Mar 2019 19:34
by Horschte
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.

Re: Weather Widgets

Posted: 13 Mar 2019 13:00
by jmckeejr
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.

Re: Weather Widgets

Posted: 13 Mar 2019 16:11
by jmckeejr
Was an error in first temperature folder. Updated link above

Re: Weather Widgets

Posted: 14 Mar 2019 07:40
by jmckeejr
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.