Weather Tile - Open Weather - Current and Forecast

The sample you are showing looks good. Not sure what’s involved in adding that, and it’s in the “nice to have” category, but if it’s not too much effort, I think it would be a good addition.

How can i edit the code to only show current weather and NO FORECAST please advise and thanks all
Thanks all appreciate the support

1 Like

I was able to get this by deleting lines 91-102 in the custom tile.

I do not have the skills to edit it any further.

Hi, this is amazing,

simple to follow and got it working.

I have one question.

Ive been able to remove the gradient - but i want the tile to match the rest of my dashboard ( like the picture attached)

I can see how to turn the color magnolia but can see how to change the font color to grey - either by changing the font color in the tile editor or by searching in the original code thingy you posted - but if im being honest I have no idea what im looking for :slight_smile:

any advice?

many thanks
Tom

I’m no expert but you can set the font color by specifying it on line 108. Something like the below. You should also be able to set it via hex code like #808080

html, body { height: 100%; margin: 0; font-size: 5vh; color: white }

I pushed a number of neat updates to the Open Weather custom tile this evening:

  • Several new ‘templates’ with various layouts:
    • Default
    • Today
    • Today (Wide)
    • Today (Mini)
    • Forecast
    • Forecast (Horizontal)
  • Toggle the Default Background Gradient
  • Added several attributes to some of the new layouts
    • Humidity
    • Wind Speed
    • Percent Chance of Precipitation
    • Sunset and Sunrise Times
  • Fix for certain edge-case browsers with minor layout glitches
    • Chrome 57-59 and Safari 10.x
  • Fixed font size on 2.5 Multi API
    • The 2.5 Multi API only returns 4 forecast days vs 6 from others
    • Increased the font size to take advantage of the extra space

You can use the Update from Source option to update your tile.

Today

Today (Wide)

Today (Mini)

Forecast

Forecast (Horizontal)

5 Likes

Josh, thanks for all your great work.

On the weather tile I am using 3.0 onecall and in format Today (Wide) but both the sunset and sunrise are the same time and they are both wrong. 9:52 AM
Not sure if my screenshot worked?
Thanks for your help

1 Like

If I switch to 2-5 multi, sunrise and sunset appear to be correct. Just not correct on 2-0 OneCall or 3-0 OneCall.
Also the city name top left appears on 2-5 multi but not 2-0 OneCall or 3-0 OneCall. Data is slightly different when I switch between 2-5 multi and 3-0 OneCall.
I am not sure if the data will update properly if I leave it on 2-5 multi because my api key is 3-0 OneCall?
Thanks

I just pushed an update which should resolve this. Thanks for reporting! :slight_smile:

That’s expected. The city name is only provided with the 2.5 Multi APIs. OpenWeather’s OneCall APIs don’t include the city information.

OpenWeather has a separate dedicated Reverse Geocoding API that I could use to add this information to the OneCall versions though. If there’s enough interest in it, I could add it.

I didn’t want to make one more API call that could increase the consumption of everyone’s API Keys, but I could probably cache and re-use the result as it’s not something that’s likely to change. :wink:

The OneCall APIs are generally preferred from a data quality perspective. The 2.5 Multi option is used as the default since everyone has access to it. This was discussed further up in the thread (1, 2). To summarize:

The 2.5 Multi approach:

  • Uses separate Current Weather and 5 day / 3 Hour Forecast APIs
  • The daily forecast values are aggregated from their 3 hour subcomponents
  • The high/low for the current day is missing, so it queries Open Meteo for this data

In other words, the OneCall versions are directly returning the daily forecasts and the current day’s high/low temperature. And the forecast is for 7 days instead of 5.

2 Likes

I’ve just pushed an update to the Open Weather Custom Tile which adds a new feature that grabs the more accurate Location Name from Open Weather (using their separate ‘geocoding’ API). You can update your copy of the custom tile as noted here:

:page_facing_up: How to use the ‘Update from Source’ option

The option to display the Location Name is enabled by default, but you can toggle it off if the geocoding API is returns an imperfect location name or you otherwise just don’t want to show the location name. This option only shows up when the ‘Today (Wide)’ layout is selected.

For anyone who is curious, this is the approach I ended up going with. I cache the result so we can re-use it without having to make the API call every time.

Hey @josh, I am not sure what happened but Sunrise/Sunset seems to be wrong again as originally reported by @Ken_Newhouse . Also, location does not seem to populate for me unless I revert to using the 2.5 multi.

Edit - I am using Today (Wide).

Make sure you are using the newest code updates (instructions linked above). That sounds like how the old version worked.

The new version shows an option for Show Location Name when you are using the Today Wide layout:

Yep, I pulled down the latest code this morning. I have location checked and using Today Wide. Also sunrise/sunset are both wrong. They say 9:57am/9:58 am.

I’ll try updating it again if this seems like just an issue for me.

Hm. Something does seem off with the OneCall versions. Let me take a look… seems like I might have messed up the commit somehow.

Edit: Okay, I’ve pushed another update which should fix the OneCall versions (sunset/sunrise and location name). You should be able to pull in the update again and see version 2023-09-23 at the top:

CleanShot 2023-09-23 at 15.51.52@2x

Thanks Josh! It works perfectly now. Appreciate you looking into it.

1 Like

This is great - fantastic support, as always!

Hi Josh, great that its now possible to add different layouts. Thank you for that.

I use Today (Mini), that looks good on my google nest hub. I would like to use Today (Wide). The problem is the additional informations looks small on my nest hub with Height 1x and Width 2x. Is there a way to make the writing bigger?

Or for the Today (Mini) tile, would it be possible to add also the condition name like „light rain“?

Best
feron

Can you share a photo of what you’re seeing? The 1x2 Today (Wide) font sizes look reasonable on the various devices I’ve used.

Have you considered using a larger tile? eg. 2x4 or 2x3 or whatever ends up looking good on that device?

Hello, I’m new around here and have been experimenting with this tile.

Can someone point me in the right direction with how to change the layout?

I running V 2023-09-23

Sorry, just found it. :face_with_hand_over_mouth:

Any option to change the time settings to 24hr instead of 12hr?

Also, is it possible to enable a transparent option for this tile?