New Weather Tags

I tried a few weather tags.
I live in Amsterdam. Experiences will likely vary by location.
WTHR_COND
For the picture. Seems to work well.

WTHR_COND_NAME
For the description. I see differences between the Dutch(Nederlands) translation in WFS and the Watch.
“Deels bewolkt” in WFS and “Gedeeltelijk bewolkt” on the Watch. Can’t test it yet because those conditions must actually be present for the Watch.

WTHR_CHANCE_PPTN
seems OK.

WTHR_UV_INDEX
this does not work for me. Remains 0.
When I look at the weather app on the watch, I see that the UV index says: Low, Average, …
So no numbers. Is that why it doesn’t work?

WTHR_TEM
seems OK. Is refreshed regularly,

WTHR_DAY_TEM_LOW and WTHR_DAY_TEM_HIGH
These are OK right after an update. Then they change to incorrect values. Until the next update. Then they are just as good again.

WTHR_LAST_UPDATED
returns the unix timestamp. Don’t know how to convert that to a date/time in the Watch.
grijs weer mn_20240827_17113382

2 Likes

To convert the [WTHR_LAST_UPDATED] into a text output duration as DD:HH:MM:SS you can use the expression below:

(numberFormat("00",(floor((([UTC_TS]-[WTHR_LAST_UPDATED])/(86400*1000)))))):(numberFormat("00",(floor((([UTC_TS]-[WTHR_LAST_UPDATED])/(1000*60*60))%24)))):(numberFormat("00",(floor((([UTC_TS]-[WTHR_LAST_UPDATED])/(1000*60))%60)))):(numberFormat("00",(floor((([UTC_TS]-[WTHR_LAST_UPDATED])/(1000))%60))))

Explanation:

The code calculates and formats a time duration in days, hours, minutes, and seconds. Here’s a breakdown of each part:

Time Calculation:

[UTC_TS] and [WTHR_LAST_UPDATED] are likely placeholders for timestamps representing two points in time.
[UTC_TS] - [WTHR_LAST_UPDATED] calculates the difference between these timestamps in milliseconds.
/ (86400 * 1000) converts the milliseconds to days, floor() rounds it down to the nearest integer, and numberFormat(“00”, …) formats it as a two-digit number with leading zeros (e.g., “01”).
/ (1000 * 60 * 60) converts the milliseconds to hours, % 24 gets the remainder after dividing by 24 to ensure it’s within the 24-hour range, floor() rounds it down, and numberFormat(“00”, …) formats it as two digits.
/ (1000 * 60) converts the milliseconds to minutes, % 60 gets the remainder after dividing by 60 to ensure it’s within the 60-minute range, floor() rounds it down, and numberFormat(“00”, …) formats it as two digits.
/ (1000) converts the milliseconds to seconds, % 60 gets the remainder after dividing by 60 to ensure it’s within the 60-second range, floor() rounds it down, and numberFormat(“00”, …) formats it as two digits.

Formatting:

numberFormat(“00”, …) is used in each part to format the calculated values as two-digit numbers with leading zeros. This ensures consistent formatting, even if the values are single digits.
Result:

The final output will be a string in the format “DD:HH:MM:SS”, where DD is the days, HH is the hours, MM is the minutes, and SS is the seconds. The values will be formatted with leading zeros as described above.

Example:

If the time difference is 3 days, 1 hour, 23 minutes, and 45 seconds, the output would be “03:01:23:45”.

2 Likes

Wow . Master Class Bookmarked . Thank you @jason.clarke.uk

1 Like

@russellcresser @jason.clarke.uk @hansniekus

This is not necessary. In the ICU Date @ Time you have Last Updated Time which serves exactly for this purpose.

4 Likes

Thanks for the explanation @jason.clarke.uk and @amoledwatchfaces

WTHR_UV_INDEX, WTHR_DAY_TEM_LOW and WTHR_DAY_TEM_HIGH are unusable for me.
(FACER’s UV-index works well.)

The weather update sometimes does not provide data. So everything 0.

Yesterday evening there was suddenly light rain and the WTHR_CHANCE_PPTN was 31%
After an hour it was partly cloudy again and 2%, as it should be.
There was no rain in Amsterdam or anywhere else in the Netherlands.

Which weather provider do they use? The Weather Channel?

Also having an issue with the [WEATHER_IS_DAY] tag. I tried setting Color/Opacity as conditional so I could have Day and Night icons displayed depending on time of day. Set weather is day Day time icons opacity to 0 if weather is day is >0 is false [WEATHER_IS_DAY]>0? 100:0 (btw setting condition to weather is day = 1 or = 0 did not wwork, probably a bug), and set weather is day Nighttime icons opacity to 100 if weather is day <1 is true [WEATHER_IS_DAY]<1? 100:0 . The preview shows the proper icons depending on the preview setting being clicked on Day or Night. However on the actual watchface on the samsung galaxy ultra 7, only the nightime icons show all the time day and night so it always thinks WEATHER_IS_DAY<1 this is 24/7


. Does anyone know how to get different opacity for nightime actuals vs daytime actuals or is this just a bug in the current implementation?

(([WTHR_COND])==1) * (([WTHR_IS_DAY])==0)?100:0
(([WTHR_COND])==1) * (([WTHR_IS_DAY])==1)?100:0
For the day and night icons for the Clear condition, it works fine

1 Like

Do we not need * ( AND ) or + ( OR ) in there some where . Excuse me I came up through Basic . It was more Verbose .

If I edit the text the * is there !
I put some spaces before and after the * now

1 Like

Ah , Bless you . Please excuse me . You can format protect formulas posted here by selecting it then hitting </> In the function bar at the top of the typing Box.
.
like so .
.
(([WTHR_COND])==1)*(([WTHR_IS_DAY])==0)?100:0

(([WTHR_COND])==1)*(([WTHR_IS_DAY])==1)?100:0
.
Excuse me but would it not be + ( AND ) in this case .
Sorry I can not test these tags , I do not have a GW7/ULTRA

I quickly looked at the Examples of the Relational operators. The use the * there.

It works because:
0 * 0 = 0
1 * 0 = 0
1 * 1 = 1
And that is what is needed

1 Like

Ha Ha . My apologies I must have a mistake in my notes . I do not mean to confuse . I started out with Sinclair BASIC . In those days we typed or selected AND or OR .
I better go check the documentation .
.
@hansniekus . So I did make a mistake a above which I have amended . Sorry .

I have the same problem with WTHR_DAY_TEM_LOW and WTHR_DAY_TEM_HIGH

When adding weather tags, the API increases to 34. As a result, the number of supported devices is severely limited. Is it possible to add weather somehow without raising the API to 34?

Alas, no. Google only introduced weather tags in WFF2, which requires Wear OS 5, which requires API 34.

1 Like

When applied to w7 something different happens, weather icons no, centigrade no…