Current Conditions

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:

https://weatherflow.github.io/Tempest/api/swagger/#!/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?

Unfortunately they are the conditions for the day. Mine currently says “conditions”: “Rain Possible”, but currently it’s partly cloudy here with no rain so far.

2 Likes

but combined with my previous answer that is the best you can get from weatherflow directly at the moment.

2 Likes

Thanks everyone, it’s a great product and love the API, keep up the great work!

2 Likes

If you run Weather Flow-through Weather Display then you get current conditions - so cloudy, raining, stopped raining etc

see https://www.weather-display.com/

Hope that helps

Andy

Not really, I am trying to get Current Conditions locally.
My current issue is fog and cloud calculations. I have noticed on cloudy days UV may actually go up (which is actually possible) so I need to look at the curve and/or compare to light levels or UV rad.

on partly cloudy days UV might go up when compared to a clear blue sky by as much as 25%.
If you really want to know the cloud coverage, you might consider buying a cheap camera with a 180 degree fish-eye lens and do some analysis on the image that. I got me one from china which even sees the clouds at night (nightsky2 - YouTube), but I still didn’t write software for calculating the cloud coverage.

Wd does give you local conditions though - as its directly from your local data. It also has fog and cloud calculations, based on solar percentages, also cloud height etc…

Still think its worth a look as its the only software i have found that outputs conditions as a text string - ie Partly Cloudy/Stopped Raining, Foggy etc

Andy

I’ll look again, but seeing the radar image made me think it was not all local.

I’m going about a slightly different route for cloud detection.
I am estimating the expected solar radiation for a non-cloudy day for a given lat/long and elevation.
Top two are two different estimates of solar radiation.
3rd is Solar Zenith, the lowest number is when sun is highest in the sky (solar noon)
The last is the measure solar radiation on the Tempest.

This is a work in progress. I have not had a non-cloudy day in weeks so it is very difficult to check my assumptions, but I think my 1st assumption is more accurate if not a little high. Once I get a full sunny day I can adjust.

I am currently performing the calculations in Node-Red and then sending to MQTT for data capture. Once this is more perfected it will be incorporated into WeatherFlow2MQTT for Home Assistant.

2 Likes

This is in JavaScript for now (I am running in Node-Red for testing purposes).
I first determine if the conditions are True or False (I had issues with Boolean transfer so I went with string ‘true’ and ‘false’. I am still working on Snow, Partly Cloudy, and Fog. I am testing cloudy and it seems to be ‘ok’ but I need a day without clouds to determine. I won’t post the long string of formulas for estimated Solar Radiation since that is a lot and I have several modified equations for testing against each other. My current and apparently working model declares ‘Cloudy’ if estimated Solar Radiation is twice measured Solar Radiation; this does need a little fine tuning as it tends to not track between 80 and 90 degrees Sun Zenith (effectively Golden hour, dusk/dawn, and sun set/rise). It looks like I will use a different approximation during those angles that I already have but is not accurate outside of that range too much.

if (msg.payload >= 1) {
    //Lightning within last hour
    //msg.lightning = Boolean[1];
    msg.lightning = 'true'
} else {
    //msg.lightning = Boolean[0];
    msg.lightning = 'false'
}

return msg
if (msg.precip_type == "Rain") {
    //msg.rain = Boolean[1];
    msg.rain = 'true'
} else if (msg.precip_type == "Heavy Rain") {
    //msg.rain = Boolean[1];
    msg.rain = 'true'
} else {
    //msg.rain = Boolean[0];
    msg.rain = 'false'
}

return msg
if (msg.preip_type == "Hail") {
    //msg.hail = Boolean[1];
    msg.hail = 'true'
} else {
    //msg.hail = Boolean[0];
    msg.hail = 'false'
}

return msg
// Imperial >= 0.31 in/hr, Metric >= 7.8 mm/hr
if (msg.rain_rate >= 0.31) {
    //msg.pouring = Boolean[1];
    msg.pouring = 'true'
} else if (msg.precip_type == "Heavy Rain") {
    //msg.pouring = Boolean[1];
    msg.pouring = 'true'
} else {
    //msg.pouring = Boolean[0];
    msg.pouring = 'false'
}

return msg
// Imperial >= 25 mph, Metric >= 11.17 m/s
if (msg.payload >= 25) {
    //msg.windy = Boolean[1];
    msg.windy = 'true';
} else {
    //msg.windy = Boolean[0];
    msg.windy = 'false';
}

return msg
if (msg.payload == "below_horizon") {
    //msg.day = Boolean[0];
    msg.day = 'false';
} else {
    //msg.day = Boolean[1];
    msg.day = 'true';
}

//context.set("day",day)

return msg
if (msg.payload >= 200) {
    //msg.cloudy = Boolean[1];
    msg.cloudy = 'true'
} else {
    //msg.cloudy = Boolean[0];
    msg.cloudy = 'false'
}

return msg

Then I do a decision tree with if statements:

var lightning=flow.get('lightning')
var hail=flow.get('hail')
var pouring=flow.get('pouring')
//var snow=flow.get('snow')
var rain=flow.get('rain')
var windy=flow.get('windy')
//var fog=flow.get('fog')
var day=flow.get('day')
var cloudy=flow.get('cloudy')
//var part_cloud=flow.get('part_cloud')

if ((lightning == 'true') && (rain == 'true')) {
    msg.current = "Lighning & Rain";
} else if (lightning == 'true') {
    msg.current = "Lightning";
} else if (hail == 'true') {
    msg.current = "Hail";
} else if (pouring == 'true') {
    msg.current = "Pouring";
//} else if ((snow == 'true') && (rain == 'true')){
//    msg.current = "Snowy Rainy";
//} else if (snow == 'true') {
//    msg.current = "Snowy";
} else if (rain == 'true') {
    msg.current = "Rainy";
} else if ((windy == 'true') && (cloudy == 'true')){
    msg.current = "Windy Variant";
} else if (windy == 'true') {
    msg.current = "Windy";
//} else if (fog == 'true') {
//    msg.current = "Fog";
//} else if (part_cloud == 'true') {
//    msg.current = "Partly Cloudy";
} else if (cloudy == 'true') {
    msg.current = "Cloudy";
} else if (day == 'true') {
    msg.current = "Sunny";
} else {
    msg.current = "Clear Night";
}

//msg.current = lightning + " " + hail + " " + pouring  + " " + rain + " " + windy + " " + cloudy  + " " + day

return msg
1 Like