OpenWeatherMap-Alerts-Weather-Driver

I have not seen that before? Could you PM me your lat/lon coordinates and I'll test it to see if I can replicate it?

Thank you @Matthew, opening the virtual device and clicking 'Save preferences' fixed it as you suggested.

Snow issue?

The OWM API reports snow in mm that is properly converted to inches. However my local forecast currently calls for perhaps 12 to 18 inches of snow in the next two days, while the Three Day tile shows .64in and 1.04in for the next two days. Perhaps that forecast is for "melted snow"?

Any chance for converting the OWM snow value to estimated snow inches or cm?

from Old Farmers Almanac
This varies depending on the type of snow, but to make 1 inch of water (rain), you need 10 inches of average snow, 4 to 5 inches of wet snow, or 15 inches of powdery snow.

image

The driver does add together the forecasted 'rain' + the forecasted 'snow' as 'Precip' as presented by OWM. I suggest you request that OWM report as you have suggested, then the driver will pick that up. If OWM would report the snow accumulation in the 'snow' field from the API, the driver will pick it up. As you suggested, it does look like they report the 'melted' precipitation measurement instead.

As your Old Farmers Almanac suggests, the 'conversion' factors from rain to snow is quite a large range and will vary based on many local conditions. That 1" of precipitation forecasted for Thursday could range from 4 to 15 inches of snow according to it. I have no plans to attempt to codify such a complex and subjective conversion factor selection. It will be wrong at least as often as it is right, if not more.

Thanks.

For what it's worth, I filed an OWM support request.

Meanwhile, multiplying the Imperial snow amount value by 10 gives a rough good enough for me estimate in inches, and I plan adjusting my local code version to do that on the 3day tile when precip is from the snow vs rain. Just have to somehow handle a day with both snow and rain.

Update: I'm planning to append the Precip amount with an S for snow, and leave Rain as is. When both occur on same day insert a <br> html string between the values amounts. None remains the same.

That could be easily done. In the current code the current day 'precip' forecast measurement is on line 523. It adds together both the rain and the snow amounts. You could multiply just the snow amount by 10. So change:
BigDecimal t_p0 = (owmDaily==null || !owmDaily[0]?.rain ? 0.00 : owmDaily[0].rain.toBigDecimal()) + (owmDaily==null || !owmDaily[0]?.snow ? 0.00 : owmDaily[0].snow.toBigDecimal())

to:
BigDecimal t_p0 = (owmDaily==null || !owmDaily[0]?.rain ? 0.00 : owmDaily[0].rain.toBigDecimal()) + (owmDaily==null || !owmDaily[0]?.snow ? 0.00 : owmDaily[0].snow.toBigDecimal() * 10)

Tomorrow's 'precip' amount (t_p1) is on line 529 and day-after-tomorrow (t_p2) is on line 530. The same change should be made there too.

Hope that helps.

1 Like

I updated my post at the same time you posted. Appreciate the code locations and suggestions.

Went with your suggestion. Quick and easy. Thank you! Makes more sense to me.
image

1 Like

Email response from OWM regarding snow. Oh well not going to happen.

Thank you for your inquiry.

Correct, we provide the liquid-equivalent of snow precipitation. Currently, the only way to find the depth of snow value (accumulated) is to use such a layer in Maps 2.0 (paid version)

​​​​​​​

I may have missed it if possible, but is there a way to split out the different weather alerts. For example, we currently have 3 active alerts: special weather statement, hazardous weather outlook and a severe storm warning. When it comes through I only have "Special weather statement +1". I use Node-RED to prioritize my alerts via Pushover and Alexa, but haven't yet ran into a case like this were the Special Weather Statement is the visible alert, but we have a Winter Storm Warning that should be prioritized.

Know of a way to get all the different alerts and possible prioritize the most severe?

There is no prioritization of alerts. The driver just lists the first alert as presented by the alert provider. If there are additional alerts it will show the "+#' to give you that indication. There is a hyperlink on the Tiles (the logo) that will take you to the alert provders details web page where you can see the details of the additional alerts, if they are available. There are no plans to add capabilities to the driver to provide any additional alert listings or prioritization of additional alerts.

Perhap try one of these? I have not used them so I don't know if they provide what you are looking for?

[Release] NOAA Weather Alerts

I'll take a look; thanks for the response.

From the Wiki:

Lux

An estimated Lux is calculated by the driver using sunrise/sunset/twilight begins/twilight ends/cloud cover/ and/or current conditions. The calculation assumes a maximum Lux of 10,000 for a clear sky at noon. It adjusts proportionally for time from twilight ends to Noon in the morning, and Noon to twilight begins in the afternoon (the closer to noon, the higher the number). It also factors in cloud cover. If cloud cover is not available, it will estimate from the weather condition text. The update lux routine checks at least every five minutes to see if a daytime/nighttime schedule change was needed (without polling) even if long polling intervals were selected. It also provides an updated Lux calculation (again, without Polling) due to the time change. The maximum lux is set by time of day as listed below:

  • From Twilight begins until Sunrise: 50
  • From Sunrise until Sunset: 10,000
  • From Sunset to Twilight ends: 50
  • Between Twilight ends and Twilight begins: 5

There is an option for 'lux smoothing/jitter control.' This basically rounds the lux calculation to reduce the variability (code/recommendation from @nh.schottfam) . This is optional and must be selected to enable it. The lux smoothing/jitter control works as follows: If lux estimation is greater than 1,100 --> round to the nearest '800' else If lux estimation is greater than 400 --> round to the nearest '400' else set lux = 5

1 Like

Thanks - I've implemented OWM and it works great. Does anyone know the range of the Lux values? Is there a realtime graph of Lux on the web anywhere I can review that anyone knows of?
thanks for your time.
Shu

1 Like

thanks Matt - I'll code based on 0-10k. I noticed that OWM has a pay for service that allows you to see graphs -but I'm not big on pay-for services that aren't critical... For now, thats what I'm going with. thanks!

HI !
Just wondering - how to get this pretty tiles to Dashboard.
Can pick device, then template. How to get tiles ?

See this post.

Thank You very much, My first day with Hubitat.

BTW noticed two versions of same driver - one for Package Manager, another standalone. Different version numbers with same description. PM version still not generated 3day tile (and not showing version number). Standalone version (0.5.1 by 12/12/2020) looks working better.

The HPM install points to the same driver file/location as the standalone driver file location. You may install it 'standalone' as a user driver, or install with HPM. Either should get you V0.5.1 dated 12/12/2020.