Figured I might as well post here since this is probably better then having a discussion in GitHub
From GitHub post:
The below are the only inputs allowed for HA weather condition. Currently this is pulled from the web API. I was toying with the idea of expanding my weather condition template to pull this locally. I understand I can't get the forecast local only; but I like as much self-hosted as possible. I think the only things I can't verify is clear-night, due to light conditions at night. Thoughts below:
‘clear-night’ can't check if fog at night since no light level to compare to (open to ideas)
‘cloudy’ can get a base line lux amount and compare and if not any other precipitation
‘fog’ same as cloudy but with window below a determined temperature
‘hail’ sensor for this
‘lightning’ sensor for this (maybe any number in last 3 hours)
‘lightning-rainy’ combine sensors for this
‘partlycloudy’ same as cloudy, with maybe a trend/derivative sensor to determine intermittent light levels
‘pouring’ Rain Rate > 0.31 in/hr (7.8 mm/hr)
‘rainy’ sensor for this
‘snowy’ a little more complicated but maybe temperature combined with blocked UV sensor and rain sensor
‘snowy-rainy’ same as snowy but easier to assume around 0C / 32F
‘sunny’ easiest just base on UV/lux level
‘windy’ wind speed >25mpg (11.17 m/s) without clouds
‘windy-variant’ windy with clouds
‘exceptional’ dewpoint between 50-60F, temperature between 68-77F, UV below 2.5 index, not any of the above (except sunny).
So...the actual point of this... should I make my condition template and then PR to the readme example or should we incorporate this to give another calculated sensor output? I'm leaning toward a sensor, but this would add a lot more code and wanted to run it past you before a PR without a big change with any other info. I would keep the current web api returned status as you have it and create some other named sensor. Thoughts?
So I am working on the order to determine conditions but I have some things to start. Not in yaml format yet, just working thru the logic.
Fog is likely when:
Air Temperature - Dew Point < 4.5F (2.5C)
Relative Humidity > 95%
Wind Speed < 10 knots / 11.5 mph / 5.14 m/s
*** near seawater >70% Relative Humidity and wind speed <10 knots (5.14 m/s)could cause fog
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.
Wind Speed > 25mph (11.17 m/s)
Rain Rate > 0.31 in/hr (7.8 mm/hr)
Need to get real world data, but this is a start for figuring out cloudy day & night. Might need to import ‘astral’ into the code. Astral is a python library for Sun & Moon position, we need sunrise/sunset times without pulling from an external source (maybe). There might be other ways.
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.
More to follow.
Just updating this post for now.
Exceptional does not appear to be used by some weather integrations. I looked at the code for the animated weather card and ‘exceptional’ does not reference an icon.