Closed txNgineer closed 5 years ago
Here is my understanding of the API conditions:
If some digs into this, I think the api condition codes need to be changed too... "exceptional" comes up too often, when better information is being reported by the api.
The biggest issue I have had when digging into it is the lack of information from the API web site on what the allowable values are. I will try contacting OpenWeatherMap directly and see if I can get any info directly. Should a more complete API document become available, I will be glad to do the digging. While I can code the changes, my style may not be properly "pythonic", and while it works for me it makes me hesitant to share.
Further info from the API shows the JSON decoder must handle missing parameters more fully:
If you do not see some of the parameters in your API response it means that these weather phenomena are just not happened for the time of measurement for the city or location chosen. Only really measured or calculated data is displayed in API response.
I did find the following table on the weather station POST description. It has a minimum of what needs to be considered to avoid exceptions (Note - the units could also be returned in imperial quantities if the GET request specified them that way):
Parameter | Type & Units | Description |
---|---|---|
station_id | The internal ID of the station which is generated during creation | |
dt | Unix Timestamp | Time of measurement |
temperature | Celsius | The air temperature |
wind_speed | m/s | Wind speed |
wind_gust | m/s | Maximum speed of wind gusts |
wind_deg | Degrees from 0 to 360 | Wind direction |
pressure | Hectopascal | Atmospheric pressure |
humidity | % | Relative air humidity |
rain_1h | mm | Rainfall in the last hour |
rain_6h | mm | Rainfall in the last 6 hours |
rain_24h | mm | Rainfall for the last days |
snow_1h | mm | Snow in the last hour |
snow_6h | mm | Snow in the last 6 hours |
snow_24h | mm | Snow for the last days |
dew_point | Celsius | Dew point |
humidex | Celsius | Index of temperature and humidity |
heat_index | Celsius | Heat index |
visibility_distance | km | Distance of direct visibility, METAR |
visibility_prefix | N, E, S, W | Prefix at distinctions of visibility in the directions, METAR |
clouds[]:distance | m | Height of the lower bound of overcast, METAR |
clouds[]:condition | SKC, NSC, FEW, SCT, BKN, OVC | Cloud amount, METAR |
clouds[]:cumulus | CB, TCU | Convective overcast, METAR |
weather[]:precipitation | Additional description, METAR | |
weather[]:descriptor | Additional description, METAR | |
weather[]:intensity | Additional description, METAR | |
weather[]:proximity | Additional description, METAR | |
weather[]:obsruration | Additional description, METAR | |
weather[]:other | Additional description, METAR |
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
Home Assistant release with the issue:
0.85.1 and prior
Last working Home Assistant release (if known): none, to my knowledge
Operating environment (Hass.io/Docker/Windows/etc.):
homeassistant on Raspian running on Raspberry Pi 3. OS: Raspbian 9.6 stretch Kernel: armv7l Linux 4.14.79-v7+ CPU: ARMv7 rev 4 (v7l) @ 1.2GHz RAM: 346MiB / 926MiB
Component/platform:
sensor.owm_rain Likely code error in: homeassistant/components/openweathermap.py
Description of problem: The sensor always shows "Not Raining" even when a query to the API directly shows a value for the rain sensor.
Problem-relevant
configuration.yaml
entries and (fill out even if it seems unimportant):Traceback (if applicable):
Additional information: Line 164 of the python file gets the rain data with