Current Conditions

I’m keen to build a website for our community and this might sound like a silly question, but is there any way to determine the current conditions. i.e. is it sunny, overcast etc? I want to use an icon based on current conditions.

I don’t think so at least not at the moment. The icon that is displayed by the app as based on the prediction, not the measurements. However when there is rain detected the icon immediately changes to a cloud with rain (even if it might be only partly cloudy), or when lightning is detected it changes to a rainless cloud with some lightning. So in fact it is kind of a mix between prediction and measurement.
The forecast, rain and lightning condition are available through the api, so you could do that (I’m just not sure if the icon itself is directly available)

I’m still hoping that at some point they come up with a good way to determine the amount of sunshine (hours per day), based on brightness/uv measurements, date and the location of the device. Once they have that, they could make a guess about cloud cover, based on the time pattern in the sun intensity. (e.g. if during the last half hour, the sun did shine between 5 and 25 minutes you might call it partly cloudy)

Working on it.

I have more under the Weatherflow2MQTT for Home Assistant GitHub page and more offline.
As @sunny stated determining sunsine has issues but with Latitude you can figure most of it, there will have to be some tweaking for shade at one’s specific location. For me, I am having the most difficulty calculating snow and fog. I can easily do fog with one additional sensor, but I am attempting to get current conditions with just the sensors available on the Tempest weather station at this time.

This is my most current (I think):

Establishing order of checks (priority):
‘lightning-rainy’ 10 < (sensor.wf_lightning_count_3_hours < 450 (attempt to eliminate false reports from noise on detector) & sensor.wf_precipitation_type > 0

‘lightning’ 3 hour lightning count 10 < (sensor.wf_lightning_count_3_hours < 450 (attempt to eliminate false reports from noise on detector) & sensor.wf_precipitation_type > 0

‘hail’ sensor.wf_precipitation_type = 2

‘snowy-rainy’ sensor.wf_precipitation_type > sensor.wf_temperature = 32F / 0C

‘snowy’ --- snowy is a guess since there is no 'sensor' that detects snow
(temperature in C) sensor.wf_temperature < 1.44 - 0.08 * sensor.wf_humidity)
(temperature in F) sensor.wf_temperature < 34.29 - 0.14 * sensor.wf_humidity)
sensor.wf_temperature < 40F / 4.44C
sensor.wf_illuminance < 1000 if sun angle > 0

‘pouring’ sensor.wf_rain_rate > 0.31 in/hr (7.8 mm/hr) or sensor.wf_precipitation_type = 3

‘rainy’ sensor.wf_precipitation_type = 1

‘windy-variant’ Wind Speed > 25mph (11.17 m/s) & cloudy

‘windy’ Wind Speed > 25mph (11.17 m/s)

‘fog’ Fog is likely when:
Air Temperature - Dew Point < 4.5F (2.5C)
Relative Humidity > 95%
Wind Speed (above) > 5 knots / 5.7 mph / 2.57 m/s
Wind Speed (below) < 10 knots / 11.5 mph / 5.14 m/s
Clear skies overnight (???) maybe from Pressure
'> -40F (typically >14F)
*** near seawater >70% Relative Humidity and wind speed <10 knots (5.14 m/s)could cause fog (might skip this caveat for now)
Need more conditions for fog, it looks like this might throw a lot of false fog.
There is some trends for heating/cooling but most would not have a derivative sensor for air temperature.

‘cloudy’ reduced illuminance with a steady tread

‘partlycloudy’ trend of alternating lower and higher lux

‘clear-night’ sun angle < 0 and no other events

‘sunny’ no other events and sun angle > 0 (minimum of 10,000 lux)

‘exceptional --?? (looked at some weather cards and does not seem to be used)

Need to look at more data and adjust for latitude and time of day.
0.0001 lux – Moonless, overcast night sky.
0.002 lux – Moonless clear night sky with airglow.
0.27–1.0 lux – Full moon on a clear night.
3.4 lux – Dark limit of civil twilight under a clear sky.
100 lux – Very dark overcast day.
400 lux – Sunrise or sunset on a clear day.
1000 lux – Overcast day
10000–25000 lux – Full daylight (not direct sun).
32000–100000 lux – Direct sunlight.

I’ve had good results using historical clear-sky UV index compared to actual UV index to determine a good idea of the sky state. Of course, determining the nuances of Fog, Snow, Sleet, etc is very difficult. oh…that compass is way better than what I’ve been using.
For the compass are you rotating the image or do you have separate images for each position?

Do you have your code somewhere that I can take a look at and steal any of the appropriate parts?

Your humidity seems to be stuck at 99%
Here are some little enhancements you could do. The Air Quaility is the only one not from my weather station.

I rotate the compass needle when the bearing changes.
For that page, the code is all HTML/Javascript (which you can see by right-clicking and ‘view source’).

As far as the humidity… 100% is more accurate, as TS Claudette passed through this weekend, and now we are getting residual popup storms coming off the Gulf. I don’t see the sky conditions as determined by UV. I see the display but not the determining of.

Apologies, forgot how I originally implemented that:

  1. Build database of historical world-wide Max UV data by month (I pulled 2010 data from a US Gov website), based on Lat/Long
    On the fly:
  2. Extrapolate the Max UV by Lat/Long down to 0.1 degrees
  3. Extrapolate the monthly Max UV for a given Lat/Long from #2
  4. Extrapolate the daily Max UV from #3
  5. Extrapolate the hourly Max UV from #4, based on sunrise, sunset and solar noon
  6. Apply arbitrary scale to generate a UV curve from sunrise → solar noon → sunset
  7. Compare to live UV, based on Max UV from #6 based on current live time

Not 100% perfect, but it works really well. On my page, I allow users to submit SkyState ‘corrections’, which will be incorporated into the Max UV database soon, to help fine-tune the process.

I could be convinced to share access to the Max UV database/process… :smiley:

1 Like
I would like to see the process. I am trying to get as close as possible to display current condition based on only information from the weather station, this will be incorporated into @bjarne WeatherFlow2MQTT for use in Home Assistant. You are farther along than I am, and there is no reason to reinvent the wheel.

PM’d you about the process.

Go it, thanks.
How big is the database that you are using?

Lemme check… hold on

25MB total, I have 12 individual SQL files.
1MB compressed.

Size is not too bad.
Why 12 different files?

One for each month.
My database has monthly tables… and that is how I was able to download the data, by month.

I can PM you the ZIP file.

That works for me.
I will work your cloudy into what I have already but yours is the bulk of it.
Any luck and calculating Fog?

I have not tried to work fog into the equation, but I can see where you may be able to deduce fogginess due to UV, Solar Radiation and Humidity levels.

Current conditions are part of the Forecast API:!/forecast/getBetterForecast

  "status": {
    "status_code": 0,
    "status_message": "SUCCESS"
  "current_conditions": {
    "time": 1608668142,
    "conditions": "Clear",
    "icon": "clear-day",
    "air_temperature": 67,
    "sea_level_pressure": 30.195,

Is that usable?