WeatherKit UV index is always returning 0

Hi, i've been playing with WeatherKit for the first 3 betas but each time I try to get the UV Index of a forecast I've got 0 as value. For example the hourly forecast of San Francisco at the time of writing is the following :

Optional(WeatherKit.HourWeather(date: 2022-07-06 14:00:00 +0000, cloudCover: 0.98, condition: Drizzle, symbolName: "cloud.moon.rain", dewPoint: 21.87 °C, humidity: 0.95, isDaylight: false, precipitation: rain, precipitationChance: 0.44, precipitationAmount: 0.44 mm, snowfallAmount: 0.0 mm, pressure: 1000.93 mbar, pressureTrend: Steady, temperature: 22.67 °C, apparentTemperature: 24.89 °C, uvIndex: WeatherKit.UVIndex(value: 0, category: Low), visibility: 8977.97 m, wind: WeatherKit.Wind(compassDirection: South Southeast, direction: 151.0 °, speed: 32.34 km/h, gust: Optional(48.66 km/h))))

While the UV Index at the time from The Weather Network is supposed to be 4. I've got this issue since beta 1 and it's happening on every location I try.

Is this happening as well to other people ? Is there anything on my side in term of configuration that I should do ?

I think it may be a timezone issue. Note "cloud.moon.rain" - moon is a clue that it thinks it's night. Oh, and "isDaylight: false". The time shown is 14:00 +0000. That should surely be 14:00 +0800. (Or is it -0800, I'm never sure about that...)

Ok so i've made a few changes to the code to use the real location and change it on the simulator level + use .current WeatherQuery to fetch weather :

func fetchUVIndex(location: Location) async throws -> Int {
    let clLocation = CLLocation(latitude: location.latitude, longitude: location.longitude)
    let weather = try? await self.weatherService.weather(for: clLocation, including: .current)

    guard let weather else { throw UVError.noWeatherAvailable }

    return weather.uvIndex.value
}

Now it's working fine and returning the correct value

Hi! Can you please share how you got WeatherKit to give you the gust value in your sample output above? I've been trying to get this from my query but I always get 0.00000 for gust. I can see all the other values. Note: I am using WeatherKit to obtain historical data (not forecast data), but it does work for the regular wind speed and other parameters, just not gust. Thanks!

WeatherKit UV index is always returning 0
 
 
Q